grep: Exit Status

1 
1 2.3 Exit Status
1 ===============
1 
1 Normally the exit status is 0 if a line is selected, 1 if no lines were
1 selected, and 2 if an error occurred.  However, if the ‘-q’ or ‘--quiet’
1 or ‘--silent’ option is used and a line is selected, the exit status is
1 0 even if an error occurred.  Other ‘grep’ implementations may exit with
1 status greater than 2 on error.
1