2

I am using grep from Gnuwin32 on Windows.

On Windows XP, the following

grep -e "foo" NUL

results in the following output

grep: NUL: invalid argument

On Windows 7, the same arguments result in no output at all.

grep just exits without any error message.

Why is the output different between Windows XP and Windows 7?

cschol
  • 892

1 Answers1

2

NUL is the batch keyword for the null device (like /dev/null in linux) It is possible that in the second case, grep is correctly treating it as input, whereas in the first it is trying to access a file called 'NUL' (although this would not be the desired behavour since a file called 'NUL' cannot be created)