BASH: create an array of all directory names in a directory that does NOT have a specific pattern in the name
2 answers
If you can include extglob
like this:
shopt -s extglob
declare -a files=( !(*.zip) )
Learn more about bash pattern matching on the pattern matching page .
+5
source to share