bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep . /; echo $?


From: Julian Foad
Subject: Re: grep . /; echo $?
Date: Fri, 04 Nov 2005 16:50:55 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511

bash$ src/grep asdf *
src/grep: autom4te.cache: Is a directory
src/grep: bootstrap: Is a directory

Andreas Schwab wrote:
Benno Schulenberg <address@hidden> writes:
Benno Schulenberg <address@hidden> writes:

(The message itself is a bit strange though: it doesn't sound
like an error.  "Cannot read a directory" would be better.)
[...]
But grep has this information: it knows what it was trying to do, so it could replace the standard message with something more specific.

All it would need to do is add some descriptive comment, like "cannot read
%s:", where %s substitutes the file name, before the errno text.

Yes, that's true: the message could quite easily be extended or replaced, but is this really something that needs fixing? It doesn't seem like a significant problem to me. It's fairly obvious from its form that it's an error message.

Anyway, it's the same message as is printed by other standard utilities such as "cat dir", "foo < dir" (redirection in Bash), etc. There's not much point in changing one program to be different from the others.

- Julian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]