[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Grep -r with no files should imply ./
From: |
Tom Felker |
Subject: |
Grep -r with no files should imply ./ |
Date: |
Fri, 6 Feb 2004 19:16:15 -0600 |
User-agent: |
KMail/1.5.4 |
Hi,
When I mean "grep -r foo ." but type "grep -r foo", grep just waits for input
until I notice my disk not chugging and correct my mistake: the --recursive
option has no effect unless there are input files. Since I usually mean to
search the current directory, I think --recursive should cause the input to
default to . instead of stdin.
If someone applies this, it'll save me a lot of typing. Please cc: me.
Thanks,
Tom Felker
--- grep-2.5.1-orig/src/grep.c 2002-03-26 09:54:12.000000000 -0600
+++ grep-2.5.1-new/src/grep.c 2004-02-06 18:14:24.526419584 -0600
@@ -1733,6 +1733,8 @@
}
while ( ++optind < argc);
}
+ else if (directories == RECURSE_DIRECTORIES)
+ status = grepfile (".", &stats_base);
else
status = grepfile ((char *) NULL, &stats_base);
- Grep -r with no files should imply ./,
Tom Felker <=