in reply to Re^6: System Function...script does not move until process ends.
in thread System Function...script does not move until process ends.
What I had thought it would do was to start the execution of the command and then bail. Well.. it didn't. It waited.#!/usr/bin/perl -w use strict; use POSIX ":sys_wait_h"; defined (my $pid = fork()) or die "D'oh"; if ( $pid ) { print "$$ gonna wait...\n"; my $kid; do { $kid = waitpid $pid, WNOHANG; } until ( $kid > 0 ); print "Ok, done waiting\n"; } else { exec 'sleep 10; echo "Done sleeping\n"'; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: System Function...script does not move until process ends.
by polettix (Vicar) on Apr 07, 2005 at 08:48 UTC |