unexpected grep -o behavior

Stefan Ehmann shoesoft at gmx.net
Sun Nov 27 20:52:48 UTC 2016


When I try to match the first character of a line grep also matches all
subsequent characters:

$ echo 123 | grep -o '^.'
1
2
3

Same with bsdgrep.
grep from ports works as expected:

$ echo 123 | /usr/local/bin/grep -o '^.'
1

Tested on 11.0.

Bug 195763 looks related, but I'm not sure it's the same issue.



More information about the freebsd-stable mailing list