bug-grep
[Top][All Lists]
Advanced

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

Possible case-sensitive with -o option bug


From: smu johnson
Subject: Possible case-sensitive with -o option bug
Date: Fri, 7 Mar 2008 13:05:59 -0800

Dear grep programmers,

I found an interesting case of grep malfunctioning and I'm not sure if it's
Cygwin's fault or greps... in either case it has stumped even the nerdiest
of my colleagues as well as I.

Simple examples show a Cygwin machine vs. an Ubuntu machine.  Sorry about
the ugly ascii text documenting this... wasn't sure if you guys accept HTML
formatted e-mails.

======================
1.  Cygwin Windows XP:
======================

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


address@hidden /c/music/nsf
$ echo x.nsF |  grep -i -o '[^ ]\+\.nsf$'

^^^^^^^^^^^^^^ =====> failure!

address@hidden /c/music/nsf
$ echo x.nsF |  grep -i '[^ ]\+\.nsf$'
x.nsF

^^^^^^^^^^^^^^ =====> omitting -o option makes the regex match now.... but I
still need -o on this one.

address@hidden /c/music/nsf
$ echo x.nsF |  grep -i -o '[^ ]\+\.nsf'

^^^^^^^^^^^^^^ =====>  dollar sign omitted doesn't help.

address@hidden /c/music/nsf
$

======================
2.  Ubuntu GNU/Linux machine:
======================


address@hidden:~/perl/pubst$ 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.

address@hidden:~/perl/pubst$ echo x.nsF |  grep -i -o '[^ ]\+\.nsf$'
x.nsF

^^^^^^^^^^^^^^ =====> success!

Any thoughts?  Thanks in advance!

-- 
smu johnson <address@hidden>


reply via email to

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