Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: timeout problem in ssh sessions



On 2008-02-15, 19:26, Bart Schaefer wrote:
> }  ps="$(/bin/grep -v 'etime,bsdtime,cmd' =(ps -eo user,pid,ppid,s,cpu,pmem,rss,vsize,bsdstart,etime,bsdtime,cmd))" 
> } 
> } Is that ok / efficient?
> 
> There's no particular problem with it but I think it's unnecessary given
> the way you're filtering the output later.  The "ps" command is a child
> of the subshell $(...), not of the login shell, so it will match neither
> the grep for $$ nor the grep for $PPID (nor for xsel, obviously).

Uhmm, no.  Here the ps process is a direct child of the login shell:

Terminating shell (PID 26166) on TTY /dev/pts/16:
USER       PID  PPID S CPU %MEM   RSS    VSZ  START     ELAPSED   TIME CMD
spiegl   26166 26163 S   -  0.6 20292  23116  11:24       00:02   0:01 -zsh
spiegl   26245 26166 R   -  0.0   944   2544  11:24       00:00   0:00 ps -eo user,pid,ppid,s,cpu,pmem,rss,vsize,bsdstart,etime,bsdtime,cmd

Thanks,
 Andy.

-- 
 You can't run sausage backwards through a meat grinder and end up with a
 whole pig."
  (Tim Peoples talking about the irreversability of UNIX password encoding)



Messages sorted by: Reverse Date, Date, Thread, Author