It is not a bug in grep. It's documented although very surprising behaviour:
-q, --quiet, --silent Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the -s or --no-messages option.
It is not a bug in grep. It's documented although very surprising behaviour:
Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the -s or --no-messages
option.
-q, --quiet, --silent