in reply to The system command and waiting for the child process to finish

Ampersands and accidental backgrounding aside, it's also possible that system encountered a problem but since you have no error checking on the call it's blithely continuing on to the next iteration immediately with no indication a failure occured.

$ perl -le 'for (0..3) { system( "Idonotexist $_" ) }' $ perl -le 'for (0..3) { system( "Idonotexist $_" ) == 0 or warn "syst +em problem (exit $?): $!\n" }' system problem (exit -1): No such file or directory system problem (exit -1): No such file or directory system problem (exit -1): No such file or directory system problem (exit -1): No such file or directory $

Update: Not to say that's what happened here since as you say you did see a lot of processes running; just that in general it pays to take the extra 15 seconds and put the error handling in place.

The cake is a lie.
The cake is a lie.
The cake is a lie.

  • Comment on Re: The system command and waiting for the child process to finish
  • Download Code