Actually, there is some evidence that this is a bug, and that current
behaviour is not intentional.

$ grep . . ; echo $?
1

open(".", O_RDONLY|O_LARGEFILE)         = 3
read(3, 0x8061000, 32768)               = -1 EISDIR (Is a directory)
close(3)                                = 0

So there was a read error, and grep didn't report it.

NEWS.gz reads:

|- `grep' now searches directories just like ordinary files; it no longer
|silently skips directories.  This is the traditional behavior of
|Unix text utilities (in particular, of traditional `grep').
|Hence `grep PATTERN DIRECTORY' should report
|`grep: DIRECTORY: Is a directory' on hosts where the operating system
|does not permit programs to read directories directly, and
|`grep: DIRECTORY: Binary file matches' (or nothing) otherwise.

So it would seem that grep really should have generated a
diagnostic/warning. 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to