Skip to main content
1 of 5
muru
  • 78.1k
  • 16
  • 213
  • 319

Brace expansion does not support variables since it is done before variables are expanded. Use seq instead, if you absolutely must:

for i in $(seq 0 ${num})

Or get the array keys directly:

for i in "${!assets[@]}"

(Also, for i in .., not for $i in ...)


Huake Laging got the first error. Once you fix that, this will probably be the next error.

muru
  • 78.1k
  • 16
  • 213
  • 319