Re: How to get the child process pid ?

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 11/20/03

  • Next message: Gwalarn: "Re: Monitoring tools (was: Re: F____la H___x)"
    Date: Thu, 20 Nov 2003 16:02:48 GMT
    
    

    In article <5cc87ce9.0311200615.39f161ba@posting.google.com>,
    pthomsin <pthomsin@yahoo.com> wrote:
    >I would like to find an (easy) way to automatically get the process id
    >of the latest child process of a user per tty. (the process that he
    >currently executes in each terminal)
    >I looked in the man ps, and did not see any option about it.
    >I found pgrep -lnu [username] , but this shows only the most recent
    >process among all (if several sessions of the same user)
    >Same for pstree ...

    Try the "w" command.

    -- 
    Barry Margolin, barmar@alum.mit.edu
    Level(3), Woburn, MA
    *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
    Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
    

  • Next message: Gwalarn: "Re: Monitoring tools (was: Re: F____la H___x)"

    Relevant Pages

    • Re: How to get the child process pid ?
      ... > of the latest child process of a user per tty. ... > currently executes in each terminal) ... Mike ...
      (comp.unix.admin)
    • Re: Time::Local busted?
      ... It traps the signal, executes an 'exit', and then ... PID: 13796 ... You have an I/O running in a child process 'tail', ...
      (comp.lang.perl.misc)
    • Re: how to modify the variable of environment !
      ... executes. ... DOS session. ... like a msg from the main application to a print procedure, ... child process or the next app could check the presence of the file. ...
      (comp.lang.clipper)
    • How to get the child process pid ?
      ... of the latest child process of a user per tty. ... process among all (if several sessions of the same user) ... Same for pstree ... ...
      (comp.unix.admin)
    • Re: Notify parent that a background process failed
      ... executes them one by one, does something with the output and goes to ... some of these commands have to be executed in the ... if (!defined($pid = fork)) ... know that the child process was started since fork didn't return undef. ...
      (comp.lang.perl.misc)