Hi Aia & drl,
Sorry. Yes, you are correct. I have updated the script in post #3 of this thread to:
- Change [[ template != "" ]] to [[ $template != "" ]].
- Add shopt -s nullglob before the for loop.
I'm most familiar with the features in the standards. And, although arithmetic expansion (i.e.,
$((expression))) is in the standards; arithmetic commands (i.e.,
((expression))) and compound conditions (i.e.,
[[ expression ]]) are not in the standards (at least not yet, and not currently planned even for the next revision). I believe the treatment of variables in arithmetic expansions and arithmetic commands are the same; I incorrectly assumed that that behavior carried over into compound conditions as well.
Thanks you both for clarifying the distinction for me.
- Don