[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: failed grep should cause subshell to exit

From: David Lehmann
Subject: Re: failed grep should cause subshell to exit
Date: Mon, 26 Aug 2013 21:41:52 -0400


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.


On Mon, Aug 19, 2013 at 3:43 AM, Andreas Schwab <address@hidden> wrote:

> David Lehmann <address@hidden> writes:
> > ! grep hello x****
> ! causes the shell to ignore -e.
> Andreas.
> --
> Andreas Schwab, SUSE Labs, address@hidden
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]