Hello, I'm trying to figure out why my system calls are being called in parallel. My knowledge of Perl and Linux is fairly basic so I'm having trouble figuring out what's wrong with my code...
foreach(@testarray)
{
my $returnCode = system("gnome-terminal --window-with-profile=
+test -e 'fio $fioconfigs{$_}'");
print "$returnCode = return code";
until ($returnCode == 0)
{
wait();
}
}
I've tried forking the process and using waitpid, I've tried(like the code above tries) waiting until the child process has a return code of 0, I've tried using backticks instead of system, etc. Basically every time I run this code, the system command runs as many tests as I've told it to, all at once. It seems like the child process returns 0 immediately instead of waiting for the program fio to terminate. I'm not sure if this is fio causing an issue, or if something else is going on. Any ideas?