Discussion:
Usage of Cygwin GNU grep missing files when using wild cards.
(too old to reply)
Steven Bender
2014-09-25 17:11:55 UTC
Permalink
Apparently the command grep -i PATN *.* will scan files and indicate special results for .EXE files,
and it will locate files of extension .BAT with the wildcard usage, but when I subset the search
by using grep -i PATN *.BAT to look for patn in just batch text files, it finds no matches.
By copying files (copy *.bat *.qqq) and making new copies, I can then use
grep -i PATN *.qqq and get the expected results.

It appears to treat the .BAT text file contents specially.
Is there a way around this ?




Steven Bender
***@yahoo.com
John Cowan
2014-09-25 21:53:50 UTC
Permalink
Post by Steven Bender
by using grep -i PATN *.BAT to look for patn in just batch text files,
it finds no matches.
I am not able to replicate this problem with grep 2.16.

If you mail me some of your .BAT files and tell me the pattern you are
looking for, I may be able to help. Don't mail them to the mailing list
at large, though.
--
John Cowan http://www.ccil.org/~cowan ***@ccil.org
Even the best of friends cannot attend each others' funeral.
--Kehlog Albran, The Profit
Eli Zaretskii
2014-09-26 06:59:31 UTC
Permalink
Date: Thu, 25 Sep 2014 10:11:55 -0700
Apparently the command grep -i PATN *.* will scan files and indicate special results for .EXE files,
and it will locate files of extension .BAT with the wildcard usage, but when I subset the search
by using grep -i PATN *.BAT to look for patn in just batch text files, it finds no matches.
By copying files (copy *.bat *.qqq) and making new copies, I can then use
grep -i PATN *.qqq and get the expected results.
Could it be that the files are called *.bat (lowercase) and not *.BAT
(uppercase), and that the Cygwin grep is case-sensitive about file
names?
It appears to treat the .BAT text file contents specially.
I'd be very surprised if it did that.
John Cowan
2014-09-26 16:29:20 UTC
Permalink
Post by Eli Zaretskii
Could it be that the files are called *.bat (lowercase) and not *.BAT
(uppercase), and that the Cygwin grep is case-sensitive about file
names?
Cygwin is indeed case-sensitive about file names, though it's bash's
globbing that's involved here, not grep.
--
John Cowan http://www.ccil.org/~cowan ***@ccil.org
Híggledy-pìggledy / XML programmers
Try to escape those / I-eighteen-N woes;
Incontrovertibly / What we need more of is
Unicode weenies and / François Yergeaus.
Loading...