[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to grep/doc/grep.texi
From: |
Charles Levert |
Subject: |
Changes to grep/doc/grep.texi |
Date: |
Tue, 08 Nov 2005 16:35:40 -0500 |
Index: grep/doc/grep.texi
diff -u grep/doc/grep.texi:1.57 grep/doc/grep.texi:1.58
--- grep/doc/grep.texi:1.57 Tue Nov 8 19:45:05 2005
+++ grep/doc/grep.texi Tue Nov 8 21:35:33 2005
@@ -87,9 +87,9 @@
@ifnottex
@node Top
address@hidden Grep
address@hidden grep
address@hidden searches for lines matching a pattern.
+The @command{grep} command searches for lines matching a pattern.
This document was produced for version @value{VERSION} of @sc{gnu}
@command{grep}.
@@ -99,7 +99,7 @@
* Introduction:: Introduction.
* Invoking:: Invoking @command{grep}; description of
options.
* Diagnostics:: Exit status returned by @command{grep}.
-* Grep Programs:: @command{grep} programs.
+* grep Programs:: @command{grep} programs.
* Regular Expressions:: Regular Expressions.
* Usage:: Examples.
* Reporting Bugs:: Reporting Bugs.
@@ -115,7 +115,7 @@
@cindex Searching for a pattern.
address@hidden searches the input files
+The @command{grep} command searches the input files
for lines containing a match to a given
pattern list. When it finds a match in a line, it copies the line to standard
output (by default), or does whatever other sort of output you have requested
@@ -375,8 +375,8 @@
@opindex --label
@cindex changing name of standard input
Display input actually coming from standard input as input coming from file
address@hidden This is especially useful for tools like zgrep, e.g.
address@hidden -cd foo.gz |grep --label=foo something}
address@hidden This is especially useful for tools like @command{zgrep}, e.g.,
address@hidden -cd foo.gz | grep --label=foo something}
@item -L
@itemx --files-without-match
@@ -567,11 +567,12 @@
@end table
Several additional options control which variant of the @command{grep}
-matching engine is used. @xref{Grep Programs}.
+matching engine is used. @xref{grep Programs}.
@section Environment Variables
-Grep's behavior is affected by the following environment variables.
+The behavior of @command{grep} is affected
+by the following environment variables.
A locale @address@hidden is specified by examining the three
environment variables @env{LC_ALL}, @address@hidden, and @env{LANG},
@@ -707,13 +708,15 @@
@option{--quiet} or @option{--silent} option is used and a selected line
is found.
address@hidden Grep Programs
address@hidden grep Programs
@chapter @command{grep} programs
address@hidden searches the named input files (or standard input if no
-files are named, or the file name @file{-} is given) for lines containing
-a match to the given pattern. By default, @command{grep} prints the
-matching lines. There are four major variants of @command{grep},
+The @command{grep} command searches the named input files
+(or standard input if no files are named,
+or the file name @file{-} is given)
+for lines containing a match to the given pattern.
+By default, @command{grep} prints the matching lines.
+There are four major variants of @command{grep},
controlled by the following options.
@table @samp
@@ -749,9 +752,14 @@
@end table
-In addition, two variant programs @sc{egrep} and @sc{fgrep} are available.
address@hidden is the same as @samp{grep -E}. @sc{fgrep} is the
-same as @samp{grep -F}.
+In addition,
+two variant programs @command{egrep} and @command{fgrep} are available.
address@hidden is the same as @samp{grep@ -E}.
address@hidden is the same as @samp{grep@ -F}.
+Direct invocation as either
address@hidden or @command{fgrep} is deprecated,
+but is provided to allow historical applications
+that rely on them to run unmodified.
@node Regular Expressions
@chapter Regular Expressions
@@ -1042,13 +1050,13 @@
@cindex interval specifications
Traditional @command{egrep} did not support the @address@hidden metacharacter,
and some @command{egrep} implementations support @address@hidden instead, so
-portable scripts should avoid @address@hidden in @samp{egrep} patterns and
+portable scripts should avoid @address@hidden in @samp{grep@ -E} patterns and
should use @address@hidden to match a literal @address@hidden
address@hidden @command{egrep} attempts to support traditional usage by
address@hidden @command{grep@ -E} attempts to support traditional usage by
assuming that @address@hidden is not special if it would be the start of an
invalid interval specification. For example, the shell command
address@hidden '@{1'} searches for the two-character string @address@hidden
address@hidden@ -E@ '@{1'} searches for the two-character string @address@hidden
instead of reporting a syntax error in the regular expression.
@sc{posix.2} allows this behavior as an extension, but portable scripts
should avoid it.
@@ -1244,7 +1252,7 @@
characters long.
@example
-egrep -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\9\8\7\6\5\4\3\2\1$' file
+grep -E -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\9\8\7\6\5\4\3\2\1$' file
@end example
Note this is done by using GNU ERE extensions, it might not be portable on
@@ -1254,7 +1262,7 @@
Why is this back-reference failing?
@example
-echo 'ba' | egrep '(a)\1|b\1'
+echo 'ba' | grep -E '(a)\1|b\1'
@end example
This gives no output, because the first alternate @samp{(a)\1} does not match,
@@ -1264,7 +1272,7 @@
matched -- making the second one superfluous.)
@item
-What do @command{grep, fgrep, egrep} stand for?
+What do @command{grep}, @command{fgrep}, and @command{egrep} stand for?
The name @command{grep} comes from the way line editing was done on Unix. For
example, @command{ed} uses the following syntax to print a list of matching
@@ -1275,8 +1283,8 @@
g/re/p
@end example
address@hidden stands for Fixed @command{grep}, @command{egrep} Extended
address@hidden
address@hidden stands for Fixed @command{grep};
address@hidden stands for Extended @command{grep}.
@end enumerate