This was suggested in bug 566342 comment #30; filing a separate bug for it. > In my opinion, even adding a wrapper to coalesce grep exit status would be a > cleaner approach here, however bad an idea that is. So the idea would be to add a wrapper (name and exact API to be discussed) that would map a given (single, or list of) exit status to 0, as in this example: $ true | map_status 1 grep foo | true; pipestatus; echo $? 0 Then again, doing this explicitly isn't much longer, e.g. the second command in the example above could be replaced by "{ grep foo || [[ $? -eq 1 ]]; }". Also, are there any use cases other than grep? As pointed out by mgorny, in many cases sed can be used instead of grep, in order to avoid exit status 1.
(In reply to Ulrich Müller from comment #0) > Also, are there any use cases other than grep? As pointed out by mgorny, in > many cases sed can be used instead of grep, in order to avoid exit status 1. If there aren't, we could alternatively think of just adding a wrapper for grep that would return 0 instead of 1. (Unfortunately, the name "egrep" is already taken ...) Again, not sure if it's worth the effort.