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.


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

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

[EMAIL PROTECTED] /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.

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

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

[EMAIL PROTECTED] /c/music/nsf
$

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


[EMAIL PROTECTED]:~/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.

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

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

Any thoughts?  Thanks in advance!

-- 
smu johnson <[EMAIL PROTECTED]>

Reply via email to