Getting pid of a remote process

Kurt Mueller mu at
Tue Aug 19 13:50:25 CEST 2008

srinivasan srinivas schrieb:
> Thanks a lot.
> But i am wondeing will it return correct pid if more than one instance of <scriptname> run on the remote machine??
> Thanks,
> Srini

On UNIX-like OS:

If you start the process in the background, you can
get the PID with:

<myhost>:~> ssh <remotehost> 'ls -l & echo PID=$!'  | grep PID

man bash
-> Special Parameters

Kurt Müller, mu at

More information about the Python-list mailing list