I need to run 2 shell_exec or exec commands in PHP I know I can
exec(command1 ; command2) //run both uncondtionally)
exec(command1 && command2) //run command2 only if command 1 is successful.
I would like to use the second, that is run the second only if the first is successful. The second command only works after the first has finished.
I also know that I can
exec(command1 > /dev/null 2>&1 &) //run command 1 not wait for it to finish, go on with PHP> /dev/null 2>&1 &
Now if I
exec(command1 && command2 > /dev/null 2>&1 &)
If I am not mistaken this seems to mean that run the first command, while PHP waits, then run the second command and not wait around for only the second command to finish?? I need to wait for command 1 to complete before executing command 2 but PHP need not wait for either to complete
Thanks,
Mark