Cygwin find not ignoring glob characters

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am attempting to find files that match a list of files I have already generated.

The script I have is:



IFS=$'n' # make newlines the only separator 
set -f # disable globbing
set -o noglob

ls e:/fantasypics > c:/tmp/files
for i in $(cat c:/tmp/files); do
echo "$i"
find "c:/Program Files/SomeDir" -iname "$i" >> c:/tmp/foundfiles
done


Some filenames look something like: blahblah[moreblahs]blah.bleh.
find does not match these files.



Any ideas?







share|improve this question






















  • Using MingW bash and find also produce the same results.
    – ajjb
    Apr 3 at 12:20










  • What exactly is the output? (Note: you shouldn't ever try to parse or script against the output of ls. Use find or simple globbing instead.) (Note2: you might want to use /cygdrive/c/... rather than C:/...)
    – B Layer
    Apr 3 at 13:16











  • Also, your example filename is ambiguous with the[..]. I can interpret that a couple ways. Can you provide one or two concrete examples?
    – B Layer
    Apr 3 at 13:22











  • One more thing, I highly recommend you read these pages: mywiki.wooledge.org/BashFAQ/001 mywiki.wooledge.org/BashFAQ/020 . Decent chance that you'll solve your problem by using one of the methods described there.
    – B Layer
    Apr 3 at 13:36











  • As an example for the problematic file: somefile[somecomment]something.jpg ls in the script is not giving me any problems. Nor is using C:/, some files are matching (those without the "").
    – ajjb
    Apr 4 at 16:14















up vote
0
down vote

favorite












I am attempting to find files that match a list of files I have already generated.

The script I have is:



IFS=$'n' # make newlines the only separator 
set -f # disable globbing
set -o noglob

ls e:/fantasypics > c:/tmp/files
for i in $(cat c:/tmp/files); do
echo "$i"
find "c:/Program Files/SomeDir" -iname "$i" >> c:/tmp/foundfiles
done


Some filenames look something like: blahblah[moreblahs]blah.bleh.
find does not match these files.



Any ideas?







share|improve this question






















  • Using MingW bash and find also produce the same results.
    – ajjb
    Apr 3 at 12:20










  • What exactly is the output? (Note: you shouldn't ever try to parse or script against the output of ls. Use find or simple globbing instead.) (Note2: you might want to use /cygdrive/c/... rather than C:/...)
    – B Layer
    Apr 3 at 13:16











  • Also, your example filename is ambiguous with the[..]. I can interpret that a couple ways. Can you provide one or two concrete examples?
    – B Layer
    Apr 3 at 13:22











  • One more thing, I highly recommend you read these pages: mywiki.wooledge.org/BashFAQ/001 mywiki.wooledge.org/BashFAQ/020 . Decent chance that you'll solve your problem by using one of the methods described there.
    – B Layer
    Apr 3 at 13:36











  • As an example for the problematic file: somefile[somecomment]something.jpg ls in the script is not giving me any problems. Nor is using C:/, some files are matching (those without the "").
    – ajjb
    Apr 4 at 16:14













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am attempting to find files that match a list of files I have already generated.

The script I have is:



IFS=$'n' # make newlines the only separator 
set -f # disable globbing
set -o noglob

ls e:/fantasypics > c:/tmp/files
for i in $(cat c:/tmp/files); do
echo "$i"
find "c:/Program Files/SomeDir" -iname "$i" >> c:/tmp/foundfiles
done


Some filenames look something like: blahblah[moreblahs]blah.bleh.
find does not match these files.



Any ideas?







share|improve this question














I am attempting to find files that match a list of files I have already generated.

The script I have is:



IFS=$'n' # make newlines the only separator 
set -f # disable globbing
set -o noglob

ls e:/fantasypics > c:/tmp/files
for i in $(cat c:/tmp/files); do
echo "$i"
find "c:/Program Files/SomeDir" -iname "$i" >> c:/tmp/foundfiles
done


Some filenames look something like: blahblah[moreblahs]blah.bleh.
find does not match these files.



Any ideas?









share|improve this question













share|improve this question




share|improve this question








edited Apr 3 at 11:38









Wouter Verhelst

7,146831




7,146831










asked Apr 3 at 11:36









ajjb

1




1











  • Using MingW bash and find also produce the same results.
    – ajjb
    Apr 3 at 12:20










  • What exactly is the output? (Note: you shouldn't ever try to parse or script against the output of ls. Use find or simple globbing instead.) (Note2: you might want to use /cygdrive/c/... rather than C:/...)
    – B Layer
    Apr 3 at 13:16











  • Also, your example filename is ambiguous with the[..]. I can interpret that a couple ways. Can you provide one or two concrete examples?
    – B Layer
    Apr 3 at 13:22











  • One more thing, I highly recommend you read these pages: mywiki.wooledge.org/BashFAQ/001 mywiki.wooledge.org/BashFAQ/020 . Decent chance that you'll solve your problem by using one of the methods described there.
    – B Layer
    Apr 3 at 13:36











  • As an example for the problematic file: somefile[somecomment]something.jpg ls in the script is not giving me any problems. Nor is using C:/, some files are matching (those without the "").
    – ajjb
    Apr 4 at 16:14

















  • Using MingW bash and find also produce the same results.
    – ajjb
    Apr 3 at 12:20










  • What exactly is the output? (Note: you shouldn't ever try to parse or script against the output of ls. Use find or simple globbing instead.) (Note2: you might want to use /cygdrive/c/... rather than C:/...)
    – B Layer
    Apr 3 at 13:16











  • Also, your example filename is ambiguous with the[..]. I can interpret that a couple ways. Can you provide one or two concrete examples?
    – B Layer
    Apr 3 at 13:22











  • One more thing, I highly recommend you read these pages: mywiki.wooledge.org/BashFAQ/001 mywiki.wooledge.org/BashFAQ/020 . Decent chance that you'll solve your problem by using one of the methods described there.
    – B Layer
    Apr 3 at 13:36











  • As an example for the problematic file: somefile[somecomment]something.jpg ls in the script is not giving me any problems. Nor is using C:/, some files are matching (those without the "").
    – ajjb
    Apr 4 at 16:14
















Using MingW bash and find also produce the same results.
– ajjb
Apr 3 at 12:20




Using MingW bash and find also produce the same results.
– ajjb
Apr 3 at 12:20












What exactly is the output? (Note: you shouldn't ever try to parse or script against the output of ls. Use find or simple globbing instead.) (Note2: you might want to use /cygdrive/c/... rather than C:/...)
– B Layer
Apr 3 at 13:16





What exactly is the output? (Note: you shouldn't ever try to parse or script against the output of ls. Use find or simple globbing instead.) (Note2: you might want to use /cygdrive/c/... rather than C:/...)
– B Layer
Apr 3 at 13:16













Also, your example filename is ambiguous with the[..]. I can interpret that a couple ways. Can you provide one or two concrete examples?
– B Layer
Apr 3 at 13:22





Also, your example filename is ambiguous with the[..]. I can interpret that a couple ways. Can you provide one or two concrete examples?
– B Layer
Apr 3 at 13:22













One more thing, I highly recommend you read these pages: mywiki.wooledge.org/BashFAQ/001 mywiki.wooledge.org/BashFAQ/020 . Decent chance that you'll solve your problem by using one of the methods described there.
– B Layer
Apr 3 at 13:36





One more thing, I highly recommend you read these pages: mywiki.wooledge.org/BashFAQ/001 mywiki.wooledge.org/BashFAQ/020 . Decent chance that you'll solve your problem by using one of the methods described there.
– B Layer
Apr 3 at 13:36













As an example for the problematic file: somefile[somecomment]something.jpg ls in the script is not giving me any problems. Nor is using C:/, some files are matching (those without the "").
– ajjb
Apr 4 at 16:14





As an example for the problematic file: somefile[somecomment]something.jpg ls in the script is not giving me any problems. Nor is using C:/, some files are matching (those without the "").
– ajjb
Apr 4 at 16:14
















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f435259%2fcygwin-find-not-ignoring-glob-characters%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f435259%2fcygwin-find-not-ignoring-glob-characters%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)