Bash: One-liner to exit with the opposite status of a grep command? May 10, 2023 by Tarik Just negate the return value. ! grep -P "STATUS: (?!Perfect)" recess.txt