Bug 132651

Summary: grep -r should warn if no filenames are given
Product: [Fedora] Fedora Reporter: Luke Ross <luke>
Component: grepAssignee: Tim Waugh <twaugh>
Status: CLOSED UPSTREAM QA Contact: Mike McLean <mikem>
Severity: low Docs Contact:
Priority: medium    
Version: 2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-27 17:09:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to correct this none

Description Luke Ross 2004-09-15 16:02:23 UTC
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:
Always

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 16:03:30 UTC
Created attachment 103867 [details]
Patch to correct this

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