user786 has asked for the wisdom of the Perl Monks concerning the following question:
Is there way to run these commands in a single line. I mean is there a way to execute the three commands listed below with one single variable $cmd instead of using $cmd1, $cmd2, $cmd3 for ls, configure and exit respectively.
For remote login we do the following:my $cmd1 = $ssh->exec("ls"); my $cmd2 = $ssh->exec("configure"); my $cmd3 = $ssh->exec("exit");
my $ssh = Net::SSH::Expect->new (host => "ip addr", password=> 'pwd', user => 'username', raw_pty => 1);
similarly is there a way to execute commands?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: cpan module to execute multiple commands
by jeffa (Bishop) on Jun 18, 2014 at 21:18 UTC |