On 2013-08-26 21:41, David Lehmann wrote: > I expected the '!' to reverse the exit code, such that if the grep return 0 > (success), the expression would return 1 (failure); if the grep returned > non-zero (failure), the expression would return 0 (success). i.e. I > expected the '!' to behave like it does in C.
It does -- like Andreas said, it just makes it immune to `set -e'. $ set -e $ > file $ ! grep foo file $ echo $? 0
pgp6GAOUZq2tk.pgp
Description: PGP signature