Can I do filename pattern matching in a bash script?
- by Bob Bowden
Can I do filename pattern matching in a bash script?
"test" is a directory with the following files ...
bob@bob-laptop:~/test$ ls
exclude exclude1 exclude2 include1 include2
from the command line, if I want to exclude some of the files, I
can do ...
bob@bob-laptop:~/test$ echo !(exclude*)
include1 include2
but, if I put that…