[wplug] perl help

John Harrold jmh17 at pitt.edu
Sun Feb 15 13:08:57 EST 2004


Sometime in February Ryan Frenz assaulted the keyboard and produced:

| I'm executing the program using 'system'.  But what I want to do is after
| the command is executed remotely, get the pid of that command.  I'm trying
| to append '|ps' to the ssh command, and it prints the output to stdout.
| Is there a way I can capture this output in the perl script (without
| showing it to the user) and still allow the user to enter the ssh
| password?
| 
| The current script:
| 
| # !perl
| 
| $prog = $ARGV[0];
| $label = $ARGV[1];
| $machine = $ARGV[2];
| 
| system ( "ssh $machine \"$prog | ps\"");

the only way i think you can get a pid, i believe, is to fork the process.
perldoc -f fork, should give you a man page on it. i don't know how useful
this will be since you want the user to be interactive with the program.

perhaps someone more familiar with forking processes could help out.

-- 
--------------------------------------------------------------------------
                                               | /"\
 john harrold                                  | \ / ASCII ribbon campaign
      jmh at member.fsf.org                    |  X  against HTML mail
           the most useful idiot               | / \
--------------------------------------------------------------------------
 What difference does it make to the dead, the orphans, and the homeless,
 whether the mad destruction is brought under the name of totalitarianism or
 the holy name of liberty and democracy?
 --Gandhi
--------------------------------------------------------------------------
gpg --keyserver keys.indymedia.org --recv-key F65A739E
--------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://penguin.wplug.org/pipermail/wplug/attachments/20040215/bd7d25d7/attachment-0001.bin


More information about the wplug mailing list