3 ms·
Not true. This is grep's default behavior. From https://linux.die.net/man/1/grep https://linux.die.net/man/1/grep: > Normally, the exit status is 0 if selected
by matt_kantor 10y ago
Not true. This is grep's default behavior. From https://linux.die.net/man/1/grep https://linux.die.net/man/1/grep:
> Normally, the exit status is 0 if selected lines are found and 1 otherwise.
$ touch bar
$ grep foo bar
$ echo $?
1