grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v2.10-57-g0dc6ab4


From: Paul Eggert
Subject: grep branch, master, updated. v2.10-57-g0dc6ab4
Date: Wed, 04 Jan 2012 17:50:26 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  0dc6ab4153de00e530669e2b7d47b8c1968e1fa1 (commit)
      from  d1d7245219bc56e6a4f25c18d6f8f4b4b9bb42d6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=0dc6ab4153de00e530669e2b7d47b8c1968e1fa1


commit 0dc6ab4153de00e530669e2b7d47b8c1968e1fa1
Author: Paul Eggert <address@hidden>
Date:   Wed Jan 4 09:49:50 2012 -0800

    doc: document empty pattern better
    
    * doc/grep.texi (Top, Fundamental Structure, Usage):
    Explain how grep deals with the empty pattern.
    Problem spotted by Bernhard Voelker in
    <http://lists.gnu.org/archive/html/bug-grep/2012-01/msg00050.html>.

diff --git a/doc/grep.texi b/doc/grep.texi
index 78efb18..de73d7f 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -50,7 +50,7 @@ Texts.  A copy of the license is included in the section 
entitled
 @node Top
 @top grep
 
address@hidden prints lines that match a pattern.
address@hidden prints lines that contain a match for a pattern.
 
 This manual is for version @value{VERSION} of GNU Grep.
 
@@ -1170,6 +1170,7 @@ The preceding item is matched at least @var{n} times, but 
not more than
 
 @end table
 
+The empty regular expression matches the empty string.
 Two regular expressions may be concatenated;
 the resulting regular expression
 matches any string formed by concatenating two substrings
@@ -1629,6 +1630,19 @@ grep 'paul' /etc/motd | grep 'franc,ois'
 finds all lines that contain both @samp{paul} and @samp{franc,ois}.
 
 @item
+Why does the empty pattern match every input line?
+
+The @command{grep} command searches for lines that contain strings
+that match a pattern.  Every line contains the empty string, so an
+empty pattern causes @command{grep} to find a match on each line.  It
+is not the only such pattern: @samp{^}, @samp{$}, @samp{.*}, and many
+other patterns cause @command{grep} to match every line.
+
+To match empty lines, use the pattern @samp{^$}.  To match blank
+lines, use the pattern @samp{^[[:blank:]]*$}.  To match no lines at
+all, use the command @samp{grep -f /dev/null}.
+
address@hidden
 How can I search in both standard input and in files?
 
 Use the special file name @samp{-}:

-----------------------------------------------------------------------

Summary of changes:
 doc/grep.texi |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]