I have a command (that would take a long time to run) launched in detached mode:
cmd1 &
After launching the command, I would like to get the status of this command (whether it has successfully executed or not).
I know that if the command is not in detached mode (run without the &
), I can check, after the command has finished, if $?
equals to 0
, but what if my command is detached? (moreover considering also that I do not have to know if the command has finished or not).
Any ideas?