in reply to How to run process in the backround even after perl script exit?
`ssh remotehost "sleep 30000"`;
Never use backticks if you do nothing with the captured output. Use system instead.
$ date; perl -e 'system q{nohup ping -c 5 perlmonks.org &};'; date; sl +eep 10; date; cat nohup.out Sat 11 Apr 11:06:34 BST 2020 nohup: appending output to ‘nohup.out’ Sat 11 Apr 11:06:34 BST 2020 Sat 11 Apr 11:06:44 BST 2020 PING perlmonks.org (209.197.123.153) 56(84) bytes of data. 64 bytes from perlmonks.com (209.197.123.153): icmp_seq=1 ttl=57 time= +96.2 ms 64 bytes from perlmonks.com (209.197.123.153): icmp_seq=2 ttl=57 time= +95.5 ms 64 bytes from perlmonks.com (209.197.123.153): icmp_seq=3 ttl=57 time= +95.1 ms 64 bytes from perlmonks.com (209.197.123.153): icmp_seq=4 ttl=57 time= +94.5 ms 64 bytes from perlmonks.com (209.197.123.153): icmp_seq=5 ttl=57 time= +95.1 ms --- perlmonks.org ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4015ms rtt min/avg/max/mdev = 94.518/95.322/96.248/0.563 ms $
|
|---|