[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sr #107100] grep --word-regexp doesn't work (in only one case)
From: |
John Graham |
Subject: |
[sr #107100] grep --word-regexp doesn't work (in only one case) |
Date: |
Sun, 01 Nov 2009 22:53:13 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.4) Gecko/20091028 Ubuntu/9.10 (karmic) Firefox/3.5.4 |
URL:
<http://savannah.gnu.org/support/?107100>
Summary: grep --word-regexp doesn't work (in only one case)
Project: grep
Submitted by: johngraham
Submitted on: Sun 01 Nov 2009 22:53:12 GMT
Category: None
Priority: 5 - Normal
Severity: 3 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Operating System: GNU/Linux
_______________________________________________________
Details:
On my Ubuntu 9.10 system, the --word-regexp option outputs words that match,
but aren't complete words, under certain (weird) circumstances. For example, a
cut & paste from a terminal session:
address@hidden ~]$ cat > greptest << 'EOF'
> aa
> aaa
> aaabbb
> EOF
address@hidden ~]$ grep -w aa greptest
aa
aaabbb
address@hidden ~]$
I'd expect the output of the last command to be just 'aa', and not have
'aaabbb' there as well.
This is quite sensitive to what you put in - from the small amount of playing
around with it I've done, any letter will work so long as it replaces all the
a's above, and you get this result if the b's in the grepped file are any
letters, so long as the first isn't also an 'a' (or whatever you changed all
those a's to).
Just in case it helps, the output of 'grep --version' is:
GNU grep 2.5.4
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
I'd be more than happy to provide any other info that can help with
finding/classifying this.
John G
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/support/?107100>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [sr #107100] grep --word-regexp doesn't work (in only one case),
John Graham <=