Thread Net::OpenSSH > nachfolgende, abhängige Kommandos
(11 answers)
Opened by Martin at 2013-09-19 18:32
Running a shell is easy:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 my $ssh = Net::OpenSSH->new(...); my ($in, $out, $pid) = $ssh->open2(); # passing no cmd will start a shell print {$in} "ls\n"; while (<$out>) { print "out: $_"; last if /$prompt_re/; } print {$in} "pwd\n"; ... Sometimes the following also works: Last edited: 2013-09-23 12:26:53 +0200 (CEST) |