bug-grep
[Top][All Lists]
Advanced

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

bug#19261: Recursive grep even when content on stdin


From: Jim Meyering
Subject: bug#19261: Recursive grep even when content on stdin
Date: Wed, 3 Dec 2014 07:32:18 -0800

On Wed, Dec 3, 2014 at 7:05 AM,  <address@hidden> wrote:
> I'm forwarding a bug report filed in debian. Is this the expected
> behavior?
>
> /tmp/greptest %  dpkg -l | grep -r grep
> wtf:hello grep
> /tmp/greptest %  dpkg -l | grep grep
> ii  grep                                                        2.21-1
> amd64        GNU grep, egrep and fgrep
>
> grep -r takes the current dir as input instead of stdin.

Hi Santiago,

That is the expected/documented behavior.
It was changed upstream 2.5 years ago (as seen in the NEWS file):

* Noteworthy changes in release 2.11 (2012-03-02) [stable]

** Bug fixes
...
** New features

  If no file operand is given, and a command-line -r or equivalent
  option is given, grep now searches the working directory.  Formerly
  grep ignored the -r and searched standard input nonrecursively.
  An -r found in GREP_OPTIONS does not have this new effect.
--------------------

Note that GREP_OPTIONS has recently been deprecated,
so this functionality will disappear.





reply via email to

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