4 ms·
> i think it's perfectly reasonable to return a non-zero status in certain non-error conditions, like when `grep` doesn't find a match To be fair, grep only do
by pyre 10y ago
> i think it's perfectly reasonable to return a non-zero status in certain non-error conditions, like when `grep` doesn't find a match
To be fair, grep only does that if you explicitly pass it an option that whose only purpose is to enable that behaviour.
- matt_kantor 10y agoNot 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