[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in grep meta-character ^
From: |
E. Choroba |
Subject: |
Bug in grep meta-character ^ |
Date: |
Thu, 4 Dec 2003 20:00:30 +0100 (CET) |
Hi,
I think I have found a little bug in grep, I hope it has not been reported yet
so I do not waste your time.
It seems as if the meta-character ^ matched not just the first character on a
line, but just any character under some circumstances - I discovered this
behaviour while using --color=always, but later I found out it does the same
with -o.
The easiest example I was able to find is this:
$ echo -e "ac\nbb" | grep -o '^.'
a
c
b
b
The "c" and second "b" should not have been there. (On the other hand, '.$'
returns just two lines as it should.)
Additional information you might need:
$ grep --version
grep (GNU grep) 2.5.1
$ cat /etc/issue
Red Hat Linux release 9 (Shrike)
$ bash --version
GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)
E. Ch.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Bug in grep meta-character ^,
E. Choroba <=