NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/43896 (grep -o match problem)



Synopsis: grep -o match problem

State-Changed-From-To: closed->open
State-Changed-By: dholland%NetBSD.org@localhost
State-Changed-When: Mon, 27 Sep 2010 08:29:53 +0000
State-Changed-Why:
A bug does exist here, however. grep -o apparently prints each distinct
match for a given input line separately:
 
   % echo ' 1 2 3 4 ' | grep -o '[0-9]'
   1
   2
   3
   4
   % echo ' the quick brown fox ' | grep -o '[a-z][a-z]*'
   the
   quick 
   brown
   fox 
   %
 
Therefore, the original example, which can match the empty string, should
print all the possible empty strings it can match and also the nonempty
match, and not just stop with the first empty match at the beginning of the
line.

Reportedly, updating grep will fix the problem.





Home | Main Index | Thread Index | Old Index