URL:
  <http://savannah.gnu.org/bugs/?24452>

                 Summary: grep -w doesn't always grab whole words - broken
multibyte support
                 Project: grep
            Submitted by: jblallement
            Submitted on: Sat 04 Oct 2008 08:48:51 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

I'm reporting this for a Ubuntu user. 
Original report at
https://bugs.edge.launchpad.net/ubuntu/+source/grep/+bug/274221

1)
[EMAIL PROTECTED]:~$ lsb_release -rd
Description: Ubuntu 8.04.1
Release: 8.04

2) [EMAIL PROTECTED]:~$ 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://au.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

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) [EMAIL PROTECTED]:~$ grep -w alloca devel/kernel/linux-2.6/kernel/pid.c
 * Generic pidhash and scalable, time-bounded PID allocator
[EMAIL PROTECTED]:~$ grep -w alloca devel/kernel/linux-2.6/kernel/pid.c | grep 
-w
alloca
[EMAIL PROTECTED]:~$
[EMAIL PROTECTED]:~/devel/kernel/patches/linux-2.6$ LANG=C grep -w alloca
kernel/pid.c
[EMAIL PROTECTED]:~/devel/kernel/patches/linux-2.6$ grep -w alloca kernel/pid.c
 * Generic pidhash and scalable, time-bounded PID allocator
[EMAIL PROTECTED]:~/devel/kernel/patches/linux-2.6$ locale
LANG=en_AU.UTF-8
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME="en_AU.UTF-8"
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY="en_AU.UTF-8"
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER="en_AU.UTF-8"
LC_NAME="en_AU.UTF-8"
LC_ADDRESS="en_AU.UTF-8"
LC_TELEPHONE="en_AU.UTF-8"
LC_MEASUREMENT="en_AU.UTF-8"
LC_IDENTIFICATION="en_AU.UTF-8"
LC_ALL=

Sample file is attached.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sat 04 Oct 2008 08:48:51 PM GMT  Name: pid.c  Size: 13kB   By:
jblallement

<http://savannah.gnu.org/bugs/download.php?file_id=16607>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24452>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



Reply via email to