[paramiko] pid of command executed on remote machine.

jd jdsw2002 at yahoo.com
Mon May 21 16:47:21 PDT 2007


Thanks Robey.

In the given example, it would get the pid of the sh
on the remote machine, I am looking for pid of 'ls'
command.

/Jd
--- Robey Pointer <robey at lag.net> wrote:

> On 4 May 2007, at 2:49, jd wrote:
> 
> > Hi everyone
> >
> >   I would like to  start the process on a remote
> node is  
> > background, get its pid. How  does one do that ?
> >     I am using chan.exec_command
> 
> If you know you're connecting to a unix machine, you
> can execute a  
> shell command like:
> 
> sh -c 'echo $$; ls'
> 
> (Replace "ls" with whatever you're executing.)  That
> will have it  
> print out the pid ("$$") before executing the
> command.  The SSH  
> protocol doesn't otherwise expose a way to get the
> pid.
> 
> robey
> 
> 



       
____________________________________________________________________________________Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222



More information about the paramiko mailing list