[Toybox] grep corner cases

Felix Janda felix.janda at posteo.de
Mon Aug 19 12:26:55 PDT 2013


Hi,

I saw the comment in changeset 1017 on possible bugs in GNU grep.

The failing tests are for me:

testing "grep -vo" "grep -vo one input" "two\nthree\n" "onetwoonethreeone\n" ""
testing "grep -Fx ''" "grep -Fx '' input" "one one one\n" "one one one\n" ""
testing "grep -F -e blah -e ''" "grep -F -e blah -e '' input" "one one one\n" \
  "one one one\n" ""

-o is a GNU extension making grep only output the matched parts of each
matched line. So since -v inverts the set of all matched lines grep -vo
should not output anything.

-F turns on fixed string matching so '' is no longer the empty regex
which matches everything, but the empty string. Combined with -x IMO
it should only match empty lines.

Something similar applies to the last test.

Cheers,
Felix


More information about the Toybox mailing list