in reply to Re: Net::OpenSSH and background process
in thread Net::OpenSSH and background process
Besides that, you can use Net::OpenSSH spawn method to launch the command in the background:
# this code does not check for errors! my $pid = $ssh->spawn('/usr/sbin/tcpdump -i eth1 -s 1500 -w /tmp/tmp.p +cap'); ($out,$err) = $ssh->capture2('ping -I eth1 -c 3 192.168.107.254'); $ssh->system('killall tcpdump'); waitpid($pid, 0); ($out,$err) = $ssh->capture2('tcpdump -r /tmp/tmp.pcap'); print "THE OUT IS $out\nTHE ERROR IS $err\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Net::OpenSSH and background process
by josh803316 (Beadle) on Aug 24, 2010 at 23:28 UTC |