Hi,

Please consider this patch to clarify the use of multiple -e and -f
options in grep. I think the current documentation is inconsistent with
grep behaviour and POSIX man page for grep.

This patch is intended to close another long-standing bug reported in
Debian: https://bugs.debian.org/356120

Cheers,

Santiago
>From 3e6c7dbb30aa51c08d5b5fd8143051055dc26a43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Santiago=20Ruano=20Rinc=C3=B3n?= <santi...@debian.org>
Date: Fri, 4 Mar 2016 17:52:43 +0100
Subject: [PATCH] doc/ multiple -e,-f arguments

---
 doc/grep.in.1 | 16 ++++++++++------
 doc/grep.texi |  6 ++++--
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/doc/grep.in.1 b/doc/grep.in.1
index ade11b4..4713228 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -35,10 +35,9 @@ grep, egrep, fgrep \- print lines matching a pattern
 .B grep
 .RI [ OPTIONS ]
 .RB [ \-e
-.I PATTERN
-|
-.B \-f
-.IR FILE ]
+.IR PATTERN ].\|.\|.
+.RB [ \-f
+.IR FILE ].\|.\|.
 .RI [ FILE .\|.\|.]
 .
 .SH DESCRIPTION
@@ -110,8 +109,10 @@ may warn of unimplemented features.
 Use
 .I PATTERN
 as the pattern.
-This can be used to specify multiple search patterns,
-or to protect a pattern beginning with a hyphen
+Multiple
+.BR \-e
+can be used to specify different search patterns.
+This option is also useful to protect a pattern beginning with a hyphen
 .RB ( \- ).
 .TP
 .BI \-f " FILE" "\fR,\fP \-\^\-file=" FILE
@@ -119,6 +120,9 @@ Obtain patterns from
 .IR FILE ,
 one per line.
 The empty file contains zero patterns, and therefore matches nothing.
+Multiple
+.BR \-f
+can be used to specify different files.
 .TP
 .BR \-i ", " \-\^\-ignore\-case
 Ignore case distinctions in both the
diff --git a/doc/grep.texi b/doc/grep.texi
index 8883b27..1ad31c7 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -175,8 +175,9 @@ This version number should be included in all bug reports.
 @opindex --regexp=@var{pattern}
 @cindex pattern list
 Use @var{pattern} as the pattern.
-This can be used to specify multiple search patterns,
-or to protect a pattern beginning with a @samp{-}.
+Multiple @option{-e} can be used to specify different search patterns.
+This option is also useful  to protect a pattern beginning with a
+@samp{-}.
 (@option{-e} is specified by POSIX.)
 
 @item -f @var{file}
@@ -186,6 +187,7 @@ or to protect a pattern beginning with a @samp{-}.
 @cindex pattern from file
 Obtain patterns from @var{file}, one per line.
 The empty file contains zero patterns, and therefore matches nothing.
+Multiple @option{-f} can be used to specify different files.
 (@option{-f} is specified by POSIX.)
 
 @item -i
-- 
2.4.6

Reply via email to