Bug 132651 - grep -r should warn if no filenames are given
grep -r should warn if no filenames are given
Product: Fedora
Classification: Fedora
Component: grep (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2004-09-15 12:02 EDT by Luke Ross
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-09-27 13:09:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to correct this (613 bytes, patch)
2004-09-15 12:03 EDT, Luke Ross
no flags Details | Diff

  None (edit)
Description Luke Ross 2004-09-15 12:02:23 EDT
Description of problem:
If grep -r is given no filename parameters, it will wait until entry
is provided on stdin, just as if no -r has been specified. This is
annoying as if the filename is omitted grep hangs, but it is difficult
to tell the difference between grep taking a while and grep waiting
for stdin. I have spent ten minutes waiting for grep to finish a large
directory before realising it had been doing nothing.

As -r makes no sense on stdin (you can't recursively search a
filehandle), how about -r only working if you give a filename?

How reproducible:

Steps to Reproduce:
1. Type command 'grep -r foo' into a console

Actual Results:  Silence

Expected Results:  Receive some indication that -r makes no sense on stdin
Comment 1 Luke Ross 2004-09-15 12:03:30 EDT
Created attachment 103867 [details]
Patch to correct this

Makes grep -r with no filenames stop with an error message.

Note You need to log in before you can comment on or make changes to this bug.