grep -w doesn't always grab whole words - broken multibyte support
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grep |
Unknown
|
Unknown
|
|||
grep (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: grep
1)
rusty@vivaldi:~$ lsb_release -rd
Description: Ubuntu 8.04.1
Release: 8.04
2) rusty@vivaldi:~$ apt-cache policy grep
grep:
Installed: 2.5.3~dfsg-3
Candidate: 2.5.3~dfsg-3
Version table:
*** 2.5.3~dfsg-3 0
500 http://
100 /var/lib/
3) Only whole words returned. There were a couple of spurious results in a large grep. Example file (from Linux kernel) is enclosed, and as you can see, piping through same grep expression again "fixes" the problem.
4) rusty@vivaldi:~$ grep -w alloca devel/kernel/
* Generic pidhash and scalable, time-bounded PID allocator
rusty@vivaldi:~$ grep -w alloca devel/kernel/
rusty@vivaldi:~$
Thanks for your report. This is reproducible in Intrepid. I suspect that this is one of those multibyte bugs of grep.
Does it work correctly with the following command:
LANG=C grep -w alloca kernel/pid.c
Can you post the output of the command : locale
Thanks in advance.