You also could rely on the calling shell to do it for you.
But this solution fits more in the ShellMonks :-)$rc=system(<<EOF); set -e ls this_command_does_not_exist EOF die if $rc;
PS: I don't know why, but $? is not set!!
In reply to Re: Is "die" the best way to be atomic?
by mce
in thread Is "die" the best way to be atomic?
by BuddhaNature
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |