How can I reduce the following bash script?
grep -P \"STATUS: (?!Perfect)\" recess.txt && exit 1 exit 0
It seems like I should be able
To make it work with set -e surround it in a sub-shell with ( and ):
set -e
(
)
$ cat test.sh #!/bin/bash set -ex (! ls /tmp/dne) echo Success $ ./test.sh + ls /tmp/dne ls: cannot access /tmp/dne: No such file or directory + echo Success Success $ mkdir /tmp/dne $ ./test.sh + ls /tmp/dne $