in reply to How to hold execution of perl script while it runs command on remote machine

is it possible to combine the set of commands into one so that you only need to do ssh once and run this one command ?

BTW, Comparing to the openssh (and others?), Net::SSH::Perl is much slower when trying to establish the connection. you can setup your ssh key on both side to speed it up.

  • Comment on Re: How to hold execution of perl script while it runs command on remote machine

Replies are listed 'Best First'.
Re^2: How to hold execution of perl script while it runs command on remote machine
by perlfan (Parson) on Feb 19, 2005 at 19:02 UTC
    # ssh user@host 'command1 && command2 && command3...'
    Also note that using single quotes allows you to save wildcard expansion for the remotehost side.
Re^2: How to hold execution of perl script while it runs command on remote machine
by Qiang (Friar) on Feb 19, 2005 at 18:34 UTC
    oops, forgot to login.
Re^2: How to hold execution of perl script while it runs command on remote machine
by linuxfan (Beadle) on Feb 22, 2005 at 19:53 UTC
    I create only one SSH connection at the beginning of my script, and use this handle to send commands to the server. The overhead of using Net::SSH::Perl over openssh with public key authentication does not seem to hurt my program's performance.

    Thanks!