[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep: Misleading Description of '-s' Option in Man Page
From: |
Paul Eggert |
Subject: |
Re: grep: Misleading Description of '-s' Option in Man Page |
Date: |
Fri, 25 Jun 2004 14:14:34 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
MARSHALL Keith <address@hidden> writes:
> In UNIX System V Release 3, which has a traditional implementation
> of grep,
By "traditional" the grep documentation means _really_ traditional,
i.e., 7th-edition Unix "grep". USG arbitrarily changed the meaning of
-s, which is what started all this mess. Here's a proposed patch to
help clear up this confusion.
This patch is against <http://savannah.gnu.org/projects/grep/>, though
I note those files haven't been updated for a while -- has grep
development moved elsewhere?
2004-06-25 Paul Eggert <address@hidden>
* doc/grep.texi, doc/grep.1: Document USG grep -s too.
Suggested by Keith Marshall.
Index: doc/grep.texi
===================================================================
RCS file: /cvsroot/grep/grep/doc/grep.texi,v
retrieving revision 1.46
diff -p -u -r1.46 grep.texi
--- doc/grep.texi 16 Jun 2003 08:34:16 -0000 1.46
+++ doc/grep.texi 25 Jun 2004 21:11:35 -0000
@@ -209,13 +209,14 @@ see the @samp{-s} or @samp{--no-messages
@opindex --no-messages
@cindex suppress error messages
Suppress error messages about nonexistent or unreadable files.
-Portability note: unlike @sc{gnu} @command{grep}, traditional
address@hidden did not conform to @sc{posix.2}, because traditional
address@hidden lacked a @samp{-q} option and its @samp{-s} option behaved
-like @sc{gnu} @command{grep}'s @samp{-q} option. Shell scripts intended
-to be portable to traditional @command{grep} should avoid both
+Portability note: unlike @acronym{GNU} @command{grep}, 7th Edition
+Unix @command{grep} did not conform to @acronym{POSIX}, because it
+lacked @samp{-q} and its @samp{-s} option behaved like @sc{gnu}
address@hidden's @samp{-q} option. @acronym{USG}-style @command{grep}
+also lacked @samp{-q} but its @samp{-s} option behaved like
address@hidden @command{grep}. Portable shell scripts should avoid both
@samp{-q} and @samp{-s} and should redirect
-output to @file{/dev/null} instead.
+standard and error output to @file{/dev/null} instead.
@item -v
@itemx --invert-match
Index: doc/grep.1
===================================================================
RCS file: /cvsroot/grep/grep/doc/grep.1,v
retrieving revision 1.24
diff -p -u -r1.24 grep.1
--- doc/grep.1 16 Jun 2003 08:34:16 -0000 1.24
+++ doc/grep.1 25 Jun 2004 21:11:35 -0000
@@ -333,25 +333,32 @@ Recurse in directories skip file matchin
Suppress error messages about nonexistent or unreadable files.
Portability note: unlike \s-1GNU\s0
.BR grep ,
-traditional
+7th Edition Unix
.B grep
-did not conform to \s-1POSIX.2\s0, because traditional
-.B grep
-lacked a
+did not conform to \s-1POSIX\s0, because it lacked
.B \-q
-option and its
+and its
.B \-s
option behaved like \s-1GNU\s0
.BR grep 's
.B \-q
option.
-Shell scripts intended to be portable to traditional
+\s-1USG\s0-style
.B grep
+also lacked
+.B \-q
+but its
+.B \-s
+option behaved like \s-1GNU\s0
+.BR grep .
+Portable shell scripts
should avoid both
.B \-q
and
.B \-s
-and should redirect output to /dev/null instead.
+and should redirect standard and error output to
+.B /dev/null
+instead.
.TP
.BR \-U ", " \-\^\-binary
Treat the file(s) as binary. By default, under MS-DOS and MS-Windows,