On 2015-04-30 04:16, Mark Kettenis wrote:
Date: Thu, 30 Apr 2015 07:51:55 +0200
From: Martin Natano <nat...@natano.net>

grep reads from standard input when no files are specified. It also does
so when -R is used, which doesn't really make sense. I think using the
current working directory as a fallback when no directories are
specified would make sense. POSIX says "If no file operands are
specified, the standard input shall be used.", but -R is an extension
to POSIX, so I guess it is not bound by that.

Far too often I've started a grep -R and waiting for the output, only to
recognize minutes later, that I forgot to add the '.' at the end of the
command and it is reading from stdin.
I do that without the -R option too ;).

Any thoughts? OK?
Not convinced this is an improvement.

Some other *Nixes print a warning in that event, which I find more useful
than grepping a directory I didn't mean. On OS X f'rinstance:

$ grep -r foo
grep: warning: recursive search of stdin
$

Reply via email to