in reply to Re^6: Shell to Perl conversion
in thread Shell to Perl conversion
You won't be able to handle any password prompt by ssh in your script. This is why I mentioned passwordless keys. Also, there is little difference between `/bin/sh ...` (and throwing the result away) and system(). If the backticks work for you, you can now move the contents of the shell script into that command line and use that.
You might want to read up about backticks in perlop - you don't need redirection with backticks because they return the script output:
my @output = `/bin/sh ...`; print "I got: @output";
Let me repeat: You won't be able to supply a password to sudo or ssh.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Shell to Perl conversion
by rockmountain (Sexton) on Sep 01, 2008 at 08:25 UTC | |
by Corion (Patriarch) on Sep 02, 2008 at 19:20 UTC |