-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2208
Joachim Ansorg edited this page Nov 12, 2021
·
2 revisions
[ -v foo[0] ]
[ -v 'foo[0]' ]
With [
, arguments will undergo glob expansion. If a file foo0
exists when the problematic code is run, it will check for the variable foo0
instead of the array entry foo[0]
. If there additionally exists a foo1
, it will simply fail with an error.
Use [[ ]]
or quote the argument.
None.