Use awk rather than shell script for grep with reversed exit code