Re: how to get the PID of an SSH tunnel

From: all mail refused (elvis_at_notatla.org.uk)
Date: 03/04/04


Date: 4 Mar 2004 22:06:49 GMT

In article <c9d82136.0403041335.68d710cb@posting.google.com>, Noah wrote:

>pa@invalid.invalid (Pierre Asselin) wrote in message
news:<3ne32c.e9s.ln@brick.verano.sba.ca.us>...

>> > I'm creating an SSH tunnel using a command like this:
>> > ssh -C -n -L 25:example.com:25 -L 110:example.com:110 \
>> > my_name@example.com -f nothing_script.sh
>> The shell variable $! contains the pid of the most recently executed
>The problem is that SSH does a fork/exec, so the pid is not what the shell sees

How about using some random distinct string on the command-line
    "... -f nothing_script.sh hereiam=7658769175"

-- 
Elvis Notargiacomo  master AT barefaced DOT cheek


Relevant Pages