`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 $

In reply to Re: How to run process in the backround even after perl script exit? by hippo
in thread How to run process in the backround even after perl script exit? by purus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.