get pid of process in subprocess python + bash
<p>I need to find pid of proccess started in bash script with another program. I use sshpass to enter the password, sshpass start ssh client and that client open sshtunnel to server.
Here is examples:</p>

<pre><code>start_tunnel.sh
#!/bin/bash
exec sshpass -p 'passw' ssh -D :port user@$server -o StrictHostKeyChecking=no -f -N
exit
</code></pre>

<p>And I start it with <code>subrocess.Popen</code>:</p>

<pre><code>proc = subprocess.Popen('start_tunnel.sh')
</code></pre>

<p>The script start just fine, it normally finish and return 0, I can get it PID, but is it possible to get the PID of started sshclient?</p>