GNU bug report logs - #75582
GNU grep 3.4 — enhancing manual

Previous Next

Package: grep;

Reported by: Anton Samokat <samokat700 <at> gmail.com>

Date: Wed, 15 Jan 2025 14:37:03 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Meyering <jim <at> meyering.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#75582: closed (GNU grep 3.4 — enhancing
 manual)
Date: Thu, 16 Jan 2025 05:03:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 15 Jan 2025 21:02:34 -0800
with message-id <CA+8g5KF5ck32cSNnOsAv3Aa5o_oomgiGwzC7CmDme5ZJNFk3uQ <at> mail.gmail.com>
and subject line Re: bug#75582: GNU grep 3.4 — enhancing manual
has caused the debbugs.gnu.org bug report #75582,
regarding GNU grep 3.4 — enhancing manual
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
75582: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75582
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Anton Samokat <samokat700 <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: GNU grep 3.4 — enhancing manual
Date: Wed, 15 Jan 2025 13:51:00 +0300
[Message part 3 (text/plain, inline)]
Hello

In *man grep* page, in the beginning, in the *description* section, 
there is phrase:

/A FILE of “-” stands for standard input.  If no FILE is given, 
recursive searches examine the  working  directory, and  nonrecursive
       searches read standard input./

This is for GNU grep 3.4 in Ubuntu 20.04. At first read I thought that 
this phrase is non accurate, that it have mistakes. I read and 
understand it as follows:

/    If no FILE is given, recursively examine the working directory, and 
nonrecursively read standard input./

/Which does not have sense./

/But t/his phrase is accurate and means the following: _If no FILE is 
given, recursive searches (grep with -r option), examine the working 
directory; nonrecursive searches (without -r option), read standard input._

Though it will be hard to get for non experienced user. Please, make it 
more simple and straightforward, remove possible ambiguity. You can use 
my version above or correct it as you prefer.

As I understand this ambiguity created related discussion on Unix & 
Linux Stack Exchange: Why is "grep keyword" causing the terminal to 
stand by forever? — https://unix.stackexchange.com/a/789609/585416

Thanks, Anton.
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Jim Meyering <jim <at> meyering.net>
To: sur-behoffski <sur-behoffski <at> grouse.com.au>
Cc: 75582-done <at> debbugs.gnu.org
Subject: Re: bug#75582: GNU grep 3.4 — enhancing manual
Date: Wed, 15 Jan 2025 21:02:34 -0800
On Wed, Jan 15, 2025 at 8:16 PM sur-behoffski
<sur-behoffski <at> grouse.com.au> wrote:
> On 2025-01-16 08:05, Paul Eggert wrote:
> > On 2025-01-15 02:51, Anton Samokat wrote:
> >> Please, make it more simple and straightforward, remove possible ambiguity
> >
> > Unfortunately these are competing goals.
> >
> > Perhaps this would be better:
> >
> > If no FILE is given read standard input, but if -r is given recursively
> > search the working directory instead.
> > [...]
>
> Interesting.  How about:
>
>     If no FILE is given, grep's behaviour depends on the -r (recursive)
>     option, which is disabled (non-recursive) by default:
>
>         - If non-recursive, then read standard input; otherwise
>         - If recursive, examine all files in the working directory,
>           including recursively descending into subdirectories.
>
> No idea if this is good, bad, or indifferent... others can decide.

Thanks for the suggestions. I went with Paul's (keeping it concise is
important), so --help now prints this:

When FILE is '-', read standard input.  If no FILE is given, read standard
input, but with -r, recursively search the working directory instead.  With
fewer than two FILEs, assume -h.  Exit status is 0 if any line is selected,
1 otherwise; if any error occurs and -q is not given, the exit status is 2.

Here's the commit:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=v3.11-56-gfc6aba9

Marking this as done.


This bug report was last modified 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.