I have 10 commands executing in parallel:
comdA & comdB & comdC & comdD
…
Is there a way to execute a callback if any of these commands return an exit status other than 0?
If this is not possible with bash. how about php? Can I
function exec_with_callback ($comd) {
shell_exec($comd);
callback();
}
exec_with_callback("comdA");
exec_with_callback("comdB");
...
but in parallel?
If no, what other language can I use?