in reply to Re: How to remotely execute a command that requires input?
in thread How to remotely execute a command that requires input?

Well i'm running the perl script locally on a server, what it is doing is ssh-ing into a 2nd server and running a shell script that requires input. While i've had success i locally opening pipes and feeding input into them, i've yet to successfully do this on a remote machine. system("ssh xxx.xxx.xxx.xxx -l user '..shell script that needs input..'"); thanks!
  • Comment on Re^2: How to remotely execute a command that requires input?

Replies are listed 'Best First'.
Re^3: How to remotely execute a command that requires input?
by Tanktalus (Canon) on Sep 26, 2006 at 14:42 UTC

    How do you do this with local programs? Why do you think that remote programs will be any different? Just remember: ssh is, itself, a local program. Treat it as such, and you may find things are much simpler.

    If you use open("| localprogram") to write to a local program, just use open("|ssh xxx.xxx.xxx.xxx -l user 'shell script that needs input'") to run the local program of 'ssh'.

    (PS: you should respond sooner ... as you notice, most new topics get responses fairly quickly - 12 days is more than enough time for responses. In fact, if you don't have a response within 24 hours, chances of getting any responses goes way down.)