grep - Bugs: bug #25197, grep -R defaults to stdin, not the...
You are not allowed to post comments on this tracker with your current authentication level.
bug #25197: grep -R defaults to stdin, not the current directory
Submitter: | None | ||
Submitted: | Sun 28 Dec 2008 09:21:49 PM UTC | ||
Votes: | 110 | ||
Category: | None | Severity: | 3 - Normal |
Item Group: | None | Status: | None |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed |
Fri 04 Dec 2009 11:28:39 PM UTC, comment #5: |
Paolo Bonzini <bonzini> |
Fri 04 Dec 2009 10:58:37 PM UTC, comment #4: Hi Paolo,
|
Geoffrey Thomas <geofft> |
Fri 04 Dec 2009 01:00:38 PM UTC, comment #3: Not a bug, there is an open ticket about adding the warning. |
Paolo Bonzini <bonzini> |
Sat 14 Feb 2009 03:30:45 AM UTC, comment #2: The work around I use is either being above the directory to scan or placing a ./ at the end of the command.
|
-Deleted Account- <nicalvaro> |
Sun 28 Dec 2008 09:46:28 PM UTC, comment #1: Apple's patch to print a warning but continue with stdin appears to be
|
Geoffrey Thomas <geofft> |
Sun 28 Dec 2008 09:21:49 PM UTC, original submission:
When I type "grep -R pattern", I never want to search stdin, because it's meaningless to search stdin recursively. I usually meant to do "grep -R pattern .". grep -R should default to searching the current directory, or at least give an error message and quit, instead of hanging waiting for input.
|
Anonymous |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 110 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2009-12-04 | bonzini | Open/Closed | Open | Closed | |
2009-07-31 | divanorama | Carbon-Copy | - | Added divanorama | |
2008-12-28 | ebroder | Carbon-Copy | - | Added ebroder | |
2008-12-28 | geofft | Carbon-Copy | - | Added geofft |
Powered by Savane 3.13-758e.
Corresponding source code
Sorry for being a bit too terse. The main reason why this cannot be changed is interoperability. Even though POSIX does not include -r, other grep implementations such as NetBSD grep do, and it would be bad to break compatibility with it (as well as with scripts written in the past ~20 years). I do see the point in your proposal, but it's not really feasible to go beyond warning.
This is different; git grep does not have a non-recursive mode (AFAICT) and cannot ever get its input from stdin.