in reply to Perl - running remote script doesn't return back the control to perl.

Hi,

I'm not sure why you want a expect session for that. If it's not due to entering a password (which is not recommended anyway because you have to store it somewhere in your program) you could just simply call a subshell this way:

my $rc = system("ssh -i private.key myhost.mydomain.tld '/root/scripts +/restart.sh'");

McA

  • Comment on Re: Perl - running remote script doesn't return back the control to perl.
  • Download Code

Replies are listed 'Best First'.
Re^2: Perl - running remote script doesn't return back the control to perl.
by bshah (Novice) on Mar 21, 2014 at 16:54 UTC

    Thank you for the great suggestion. I'll try it.