LRC wrote:
I am trying to get a list of files that do not include a group of characters withing a file name.
I can: ls *[!dod].so
and all files ending in dod.so are excluded
I can: ls [!dod]*.so and all *.so files that begin with dod are excluded.
I want to ls *[!dod]*.so to exclude all *.so that have dod anywhere in the file name to be excluded and ls grabs stuff even outside the dir I am in. Is this a bug or am I supposed to do something else to control the search. And if it is a bug is there a work around
Your statements are not true. ls *[!dod].so is the same as ls *[^do].so: it matches everything except files with "d" or "o" before the .so extension.
You need to turn on the
extglob option, then you can use:
Code:
ls !(*dod).so
ls !(dod*).so
ls !(*dod*).so