Bash Pattern Matching Syntax

Drew Tomlinson drew at mykitchentable.net
Sat Oct 15 15:37:18 PDT 2005


I want to list the files in a directory that end in ".jpg" irregardless 
of case.  Thus after reading the bash man page, it seems I should be 
able to issue a command something along the lines of "ls [*.[JjPpGg]]"  
or "ls *.[JjPpGg]" but neither of these work and return a "No such file 
or directory" message.  I've also tried various ways of  escaping the 
'*' and '." but that didn't help either.  However "ls *[JjPpGg]" does 
work by listing the files.  However I want to match the "." before "jpg" 
as well.  What is the correct syntax for what I'm trying to do?

Thanks,

Drew

-- 
Visit The Alchemist's Warehouse
Magic Tricks, DVDs, Videos, Books, & More!

http://www.alchemistswarehouse.com



More information about the freebsd-questions mailing list