The actual answer to this question is to add || true
to the end of the command, e.g.:
echo thing | grep x || true
This will still output a 0 return code.
The actual answer to this question is to add || true
to the end of the command, e.g.:
echo thing | grep x || true
This will still output a 0 return code.