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
Use the special ? variable:
grep -P "STATUS: (?!Perfect)" recess.txt exit $((1-$?))
(But note that grep may also return 2, so it's not clear what you'd want to occur in such cases.)
grep