bug-gnu-utils
[Top][All Lists]
Advanced

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

grep bug/inconsistency


From: David Liang
Subject: grep bug/inconsistency
Date: Mon, 21 Apr 2008 16:07:43 -0700

Hi, regarding these two options:
       -n, --line-number
              Prefix each line of output with the line number within its
input file.
       -o, --only-matching
              Show only the part of a matching line that matches PATTERN.

If there are multiple matches on a line, the -o option prints each match on
a separate line, but the line number prefix is printed only for the first
match (I'm running GNU grep 2.5.1).
For example, `grep -no "[fb][oa][or]" afile' gives me this:

30:foo
bar
far
31:boo
for
32:foo
...

Thanks for your attention.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]