in reply to Net::OpenSSH multiple commands
#!/usr/bin/perl use strict; use warnings; use Net::OpenSSH; my $ssh = Net::OpenSSH->new(host=>"$host, user=>"$user, port=>$port, p +assword=>$password); my $cmd1 = 'cd /path/to/file'; my $cmd2 = "ls -a\n"; my $cmd3 = join ('&&', $cmd1, $cmd2); print $cmd3; $ssh->system($cmd3);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::OpenSSH multiple commands
by salva (Canon) on Apr 07, 2013 at 20:06 UTC |