There seems to be a POSIX issue with 'set -e' ('set -o errexit') on mksh.
The script:
set -e
! false && false
echo wrong
should not output anything, which is the actual behaviour on every shell
except pdksh and mskh.
This only occurs if the command starts with a '!'. The following script
works correctly on pdksh and mksh:
set -e
true && false
echo wrong
Ref.:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_25
| 2. The -e setting shall be ignored when executing the compound list
| following the while, until, if, or elif reserved word, a pipeline
| beginning with the ! reserved word, or any command of an AND-OR list
| other than the last.
Thanks,
- Martijn