[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: failed grep should cause subshell to exit
From: |
Chris Down |
Subject: |
Re: failed grep should cause subshell to exit |
Date: |
Tue, 27 Aug 2013 03:53:20 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On 2013-08-27 03:48, Chris Down wrote:
> It does -- like Andreas said, it just makes it immune to `set -e'.
>
> $ set -e
> $ > file
> $ ! grep foo file
> $ echo $?
> 0
Or, perhaps more closely matching your case:
$ set -e
$ echo foo > file
$ ! grep foo file
foo
$ echo $?
1
pgpLL1CyahQeb.pgp
Description: PGP signature