[Toybox] Endless grep corner cases...
Rob Landley
rob at landley.net
Sat Aug 10 23:23:36 PDT 2013
Does grep -F support the empty regex ("") matching everything? Yes it
does! How about 'grep -Fx "" filename' and that never matches anything.
Same for grep -o "" and grep -w "".
here's a fun one:
touch empty
grep -f empty test.txt
Does not block reading from stdin (I.E. not eating test.txt as a
regex), but it doesn't match anything in test.txt either (I.E. does not
treat empty as a "" regex line). However, "echo > empty" (creating a
file containing just a newline) _does_ do the "" matching everything
behavior.
Not quite sure what the right behavior is. The posix guys never
actually try weird stuff, it seems. Trying to make it all work...
Test suite updated for all but that last one, because I'm not quite
sure what the proper behavior _is_ there yet...
Rob
1376202216.0
More information about the Toybox
mailing list