Using PHP on Linux, I\'d like to determine whether a shell command run using exec() was successfully executed. I\'m using the return_var parameter to check for a successful
Just my 2 cents, how about using the || or && bash operator?
||
&&
exec('ls && touch /tmp/res_ok || touch /tmp/res_bad');
And then check for file existence.