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

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

grep bug


From: Wayne Pollock
Subject: grep bug
Date: Fri, 04 Mar 2005 13:49:01 -0500
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

-----BEGIN PGP SIGNED MESSAGE-----

A problem recently came to light about grep.  Try this
to reproduce:

$ echo '1.1.1.2
123.123.123.2 is different than 321.123.321.1 so there
no ip here
0.0.0.0
bye' > grep-test-file1

$ touch grep-test-file2

$ egrep -Ho '([0-9]{1,3}\.){3}[0-9]{1,3}' grep-test-file1 grep-test-file2
grep-test-file1:1.1.1.2
grep-test-file1:123.123.123.2
321.123.321.1
grep-test-file1:0.0.0.0

$

Now the man and info pages state that the "-H" option is supposed
to "Print the filename for each match."  Clearly this is not
happening with multiple matches per line.

It seems to me that either grep or the documentation needs updating.

- --- My System Info ---

$ grep --version
grep (GNU grep) 2.5.1

Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$  rpm -qf /bin/egrep
grep-2.5.1-26

$ uname --all
Linux cws 2.6.10-1.14_FC2smp #1 SMP Thu Feb 10 17:32:40 EST 2005 i686 i686 i386 
GNU/Linux

- -Wayne Pollock,  address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows 98)

iQCVAwUBQiitnexqnBf+HxUtAQExXwP+K3xm3kxzzBpDoCh+rilMty7a5KhrmGQ2
Jhf/odYjTh6NK8MJIHIN7sgaUBo2+oMlXg4yXN6SfmTgxFxxM9Om2p7kelGN+z5L
VTnKvdcIreX8HmysJ2TvZWizl7q7tFlTHl8HW+3NDzyKLGK3YIq+GjPZENc98xj/
mrJIF3v8w5k=
=TJ8l
-----END PGP SIGNATURE-----




reply via email to

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