I want to process a bunch of files ending in some suffixes, so I wrote the following zsh script but it did not work.
EXT=(.jpg .png .gif)
EXT=${(j.|.)EXT} # EXT becomes '.jpg|.png|.gif'
for f in *($EXT); do # should become '*(.jpg|.png|.gif)' but failed
process-one-file $f
done
Why doesn't it work? How can I mix parameter substitution and glob pattern?