summaryrefslogtreecommitdiff
path: root/doc/grep.texi
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-01-03 14:42:28 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-01-04 09:17:19 -0800
commitd1d7245219bc56e6a4f25c18d6f8f4b4b9bb42d6 (patch)
tree2627a72409bcaf965d667c3176603cc5563a1f8b /doc/grep.texi
parentaab59eb87d7fade0ca8a0f444f222284eb28694f (diff)
downloadgrep-d1d7245219bc56e6a4f25c18d6f8f4b4b9bb42d6.tar.gz
grep: with no args, search "." only if command-line -r
* NEWS: Document this. * doc/grep.texi (Environment Variables, grep Programs): Likewise. * src/main.c (usage): Likewise. (main): Implement this. (prepend_default_options): Return a count of prepended options. * tests/r-dot: Test the above.
Diffstat (limited to 'doc/grep.texi')
-rw-r--r--doc/grep.texi13
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/grep.texi b/doc/grep.texi
index 5d779c11..78efb189 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -801,6 +801,13 @@ whitespace.
A backslash escapes the next character, so it can be used to
specify an option containing whitespace or a backslash.
+The @code{GREP_OPTIONS} value does not affect whether @command{grep}
+without file operands searches standard input or the working
+directory; that is affected only by command-line options. For
+example, the command @samp{grep PAT} searches standard input and the
+command @samp{grep -r PAT} searches the working directory, regardless
+of whether @code{GREP_OPTIONS} contains @option{-r}.
+
@item GREP_COLOR
@vindex GREP_COLOR @r{environment variable}
@cindex highlight markers
@@ -1014,9 +1021,9 @@ instead of strict equality with@ 2.
for lines containing a match to the given pattern.
By default, @command{grep} prints the matching lines.
A file named @file{-} stands for standard input.
-If no input is specified, a recursive @command{grep}
-searches the working directory @file{.}, and a
-nonrecursive @command{grep} searches standard input.
+If no input is specified, @command{grep} searches the working
+directory @file{.} if given a command-line option specifying
+recursion; otherwise, @command{grep} searches standard input.
There are four major variants of @command{grep},
controlled by the following options.