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

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

grep -F -w sometimes fails to notice "whole word" matches


From: Bob Byrnes
Subject: grep -F -w sometimes fails to notice "whole word" matches
Date: Tue, 16 Sep 2003 12:32:56 -0400

I would expect the command ...

    ( echo food ; echo foo ) | grep -F -w foo

... to print "foo", and indeed it does, at least for versions of grep
before 2.5.

However, starting with 2.5, grep fails to find "foo" on the second line.
If I interchange the two lines, it works.

It seems like a failed "whole word" match on one line prevents "whole
word" matches on subsequent lines, but only for fixed strings (-F).

Version info:

shell> 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.

shell> uname -a
Linux wildcard.curl.com 2.4.20-18.9 #1 Thu May 29 07:08:16 EDT 2003 i686 i686 
i386 GNU/Linux

--
Bob Byrnes                        e-mail: address@hidden
Curl Corporation                  phone:  617-761-1238
1 Cambridge Center, 10th Floor    fax:    617-761-1201
Cambridge, MA 02142-1612




reply via email to

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