707 |
But the exit status is 2 if an error occurred, unless the @option{-q} or |
But the exit status is 2 if an error occurred, unless the @option{-q} or |
708 |
@option{--quiet} or @option{--silent} option is used and a selected line |
@option{--quiet} or @option{--silent} option is used and a selected line |
709 |
is found. |
is found. |
710 |
|
Note, however, that @sc{posix} only mandates, |
711 |
|
for programs such as @command{grep}, @command{cmp}, and @command{diff}, |
712 |
|
that the exit status in case of error be greater than 1; |
713 |
|
it is therefore advisable, for the sake of portability, |
714 |
|
to use logic that tests for this general condition |
715 |
|
instead of strict equality with 2. |
716 |
|
|
717 |
@node grep Programs |
@node grep Programs |
718 |
@chapter @command{grep} programs |
@chapter @command{grep} programs |