Keep It Simple, Stupid | |
PerlMonks |
Executing a command after the preceding command finished processingby Locutus_ (Initiate) |
on Mar 29, 2018 at 23:36 UTC ( [id://1212005]=perlquestion: print w/replies, xml ) | Need Help?? |
Locutus_ has asked for the wisdom of the Perl Monks concerning the following question: I am creating a basic Perl script for a capstone project to automate a few different Unix commands that need to be executed in a specific order. Using system() to call these commands: system("nohup scripts_pl/RunAll.pl &"); This is one of two commands that needs time to finish processing before the rest of the script can run. It is in its own subroutine so this part of the code can be run with a flag, although there is another flag to run the entire script (the line below behaves similarly): system("nohup run_decode.pl $shortDir $shortDir $senone &"); This line also executes a Unix command that needs time to process before the next (and final) line should execute. That isn't the case which is resulting in erroneous data for my project; the command is executed and the process runs in the background but the final line executes before it finishes. I'd like a print statement "X has finished processing" to follow each of these commands once they have finished processing so the user knows they have successfully processed and the code can safely continue compiling (or the user can execute another part of the code with a different flag). I hope this is clear enough. Thank you!
Back to
Seekers of Perl Wisdom
|
|