[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 |
Andreas,
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.
-David
On Mon, Aug 19, 2013 at 3:43 AM, Andreas Schwab <schwab@suse.de> wrote:
> David Lehmann <david.lehmann@alumni.rutgers.edu> writes:
>
> > ! grep hello x****
>
> ! causes the shell to ignore -e.
>
> Andreas.
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
>