On 12/20/2011 06:20 AM, Eli Zaretskii wrote:
>  The intent of the test is that grep should behave differently when
>  operating on a directory instead of a regular file.
Can you elaborate on that difference in behavior?  I mean the
difference between

   echo foo | grep -f empty-directory/

This should be a hard failure. Asking grep to open a directory and search for patterns in it is wrong.

and

   echo foo | grep -f empty-file

This should search for "no pattern", and hence print nothing but still consume the input.

So, these should print nothing:

    echo foo | grep -f /dev/null
    echo foo | (grep -f /dev/null; cat)

This should print an error message:

    echo foo | grep -f /

This should print an error message followed by "foo":

    echo foo | (grep -f /; cat)

If you get XPASSes from the last two on Windows, that's good. :) It's working better than POSIX. :)

Paolo

Reply via email to