in reply to Re: How do you launch a background process and get pid?
in thread How do you launch a background process and get pid?
#!/usr/bin/perl use strict; use warnings; my $pid = fork; if ((defined $pid) && ($pid == 0)) { open(STDOUT, "/dev/null"); # suppressing output open(STDERR, "/dev/null"); # suppressing output exec("sleep", "30"); exit; } print "child pid [$pid]\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How do you launch a background process and get pid?
by afoken (Chancellor) on Apr 18, 2016 at 17:12 UTC |