Subject: Re: bug#18651: Clarify exit status description

From: Santiago Ruano Rincón <[email-masked]>
Date: Wed, 8 Oct 2014 10:44:53 +0200

Control: tags -1 + patch

El 07/10/14 a las 09:27, Paul Eggert escribió:
> Hmmm, well, to me the proposed clarification is not that clear either.  And
> the man page is no place for a chatty discussion about what POSIX allows of
> other implementations; the full manual is the place for that sort of thing.
> So, how about the attached patches instead?  I've pushed them.

Thanks. And here you have remaining doc-related changes included in Debian.

Cheers,

Santiago
>From 99ddde23dc02f10fb4ed37e0463209dd557d9b19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Santiago=20Ruano=20Rinc=C3=B3n?= <[email-masked]>
Date: Wed, 8 Oct 2014 09:51:51 +0200
Subject: [PATCH] Doc minor changes

* doc/grep.in.1, doc/grep/texi: clarify info related to -F, -x, PCRE and
the matchers.
---
 doc/grep.in.1 | 16 ++++++++++------
 doc/grep.texi | 11 ++++++-----
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/doc/grep.in.1 b/doc/grep.in.1
index b6362ee..a480069 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -87,8 +87,8 @@ as an extended regular expression (ERE, see below).
 .BR \-F ", " \-\^\-fixed\-strings
 Interpret
 .I PATTERN
-as a list of fixed strings, separated by newlines,
-any of which is to be matched.
+as a list of fixed strings (rather than regular expressions), separated
+by, separated by newlines, any of which is to be matched.
 .TP
 .BR \-G ", " \-\^\-basic\-regexp
 Interpret
@@ -99,7 +99,7 @@ This is the default.
 .BR \-P ", " \-\^\-perl\-regexp
 Interpret
 .I PATTERN
-as a Perl regular expression.
+as a Perl regular expression (PCRE, see below).
 This is highly experimental and
 .B "grep \-P"
 may warn of unimplemented features.
@@ -138,6 +138,10 @@ Word-constituent characters are letters, digits, and the underscore.
 .TP
 .BR \-x ", " \-\^\-line\-regexp
 Select only those matches that exactly match the whole line.
+This option has the same effect as anchoring the expression with
+.BR ^
+and
+.BR $ .
 .TP
 .B \-y
 Obsolete synonym for
@@ -524,7 +528,7 @@ expressions, by using various operators to combine smaller expressions.
 .PP
 .B grep
 understands three different versions of regular expression syntax:
-\*(lqbasic,\*(rq \*(lqextended\*(rq and \*(lqperl.\*(rq In
+\*(lqbasic\*(rq (BRE), \*(lqextended\*(rq (ERE) and \*(lqperl\*(rq (PRCE). In
 .RB "\s-1GNU\s0\ " grep ,
 there is no difference in available functionality between basic and
 extended syntaxes.
@@ -532,8 +536,8 @@ In other implementations, basic regular expressions are less powerful.
 The following description applies to extended regular expressions;
 differences for basic regular expressions are summarized afterwards.
 Perl regular expressions give additional functionality, and are
-documented in pcresyntax(3) and pcrepattern(3), but may not be
-available on every system.
+documented in pcresyntax(3) and pcrepattern(3), but only work if pcre
+is available in the system.
 .PP
 The fundamental building blocks are the regular expressions
 that match a single character.
diff --git a/doc/grep.texi b/doc/grep.texi
index da9a1be..a7ae8c6 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -239,8 +239,9 @@ Word-constituent characters are letters, digits, and the underscore.
 @opindex -x
 @opindex --line-regexp
 @cindex match the whole line
-Select only those matches that exactly match the whole line.
-(@option{-x} is specified by POSIX.)
+Select only those matches that exactly match the whole line. This option
+has the same effect as anchoring the expression with @samp{^} and
+@samp{$}. (@option{-x} is specified by POSIX.)
 
 @end table
 
@@ -1070,8 +1071,8 @@ Interpret the pattern as an extended regular expression (ERE).
 @opindex -F
 @opindex --fixed-strings
 @cindex matching fixed strings
-Interpret the pattern as a list of fixed strings, separated
-by newlines, any of which is to be matched.
+Interpret the pattern as a list of fixed strings (rather than regular
+expressions), separated by newlines, any of which is to be matched.
 (@option{-F} is specified by POSIX.)
 
 @item -P
@@ -1113,7 +1114,7 @@ The following description applies to extended regular expressions;
 differences for basic regular expressions are summarized afterwards.
 Perl regular expressions give additional functionality, and are
 documented in the @i{pcresyntax}(3) and @i{pcrepattern}(3) manual pages,
-but may not be available on every system.
+but only work if pcre is available in the system.
 
 @menu
 * Fundamental Structure::
-- 
2.1.0