perlpal has asked for the wisdom of the Perl Monks concerning the following question:
I need to execute parallel flows in my script.How do i obtain the following :
Start a process on linux.Without waiting for the process to complete, the script flow should go to the next step to determine the process id of the process initiated in the previous step.
I tried to run the process in the background . But that does not help my cause.Sample test script is mentioned below . This script still gives me sequential execution flow.
#!/usr/software/bin/perl my $sio_cmd = `./sio_linux random 100 1k 0 512k 20 1 testfile &`; print "The command output = $sio_cmd"; $proc_cmd = `ps -ef | grep -i sio`; print "\nThe process output is : $proc_cmd\n"; if($proc_cmd =~ /\w+?\s+?(\d+)\s+?.*$sio_cmd.*/){ print "\nThe process id is : $1 \n"; }else{ print "\nNo process id\n"; }
After the execution of $sio_cmd ,the script should proceed to execute $proc_cmd without waiting for the process initiated by the execution of $sio_cmd to complete.
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parallel Execution Flows
by Corion (Patriarch) on Mar 08, 2010 at 08:59 UTC | |
by perlpal (Scribe) on Mar 08, 2010 at 09:38 UTC | |
by Corion (Patriarch) on Mar 08, 2010 at 09:43 UTC | |
|
Re: Parallel Execution Flows
by cdarke (Prior) on Mar 08, 2010 at 15:39 UTC |