Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

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 (much more preferable) get the array keys directly:

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

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


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


And instead of

read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`

Consider using:

tmp=($(ledger -f finances balance "${assets[${i}]}"))

The () outside the command substitution converts it into an array.

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 (much more preferable) get the array keys directly:

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

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


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


And instead of

read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`

Consider using:

tmp=($(ledger -f finances balance "${assets[${i}]}"))

The () outside the command substitution converts it into an array.

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 (much more preferable) get the array keys directly:

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

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


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


And instead of

read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`

Consider using:

tmp=($(ledger -f finances balance "${assets[${i}]}"))

The () outside the command substitution converts it into an array.

added 23 characters in body
Source Link
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 (much more preferable) get the array keys directly:

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

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


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


And instead of

read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`

Consider using:

tmp=($(ledger -f finances balance "${assets[${i}]}"))

The () outside the command substitution converts it into an array.

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 ...)


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


And instead of

read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`

Consider using:

tmp=($(ledger -f finances balance "${assets[${i}]}"))

The () outside the command substitution converts it into an array.

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 (much more preferable) get the array keys directly:

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

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


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


And instead of

read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`

Consider using:

tmp=($(ledger -f finances balance "${assets[${i}]}"))

The () outside the command substitution converts it into an array.

edited body
Source Link
Hauke Laging
  • 94.6k
  • 21
  • 132
  • 185

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 ...)


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


And instead of

read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`

Consider using:

tmp=($(ledger -f finances balance "${assets[${i}]}"))

The () outside the command substitution converts it into an array.

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.


And instead of

read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`

Consider using:

tmp=($(ledger -f finances balance "${assets[${i}]}"))

The () outside the command substitution converts it into an array.

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 ...)


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


And instead of

read -a tmp <<< `ledger -f finances balance "${assets[${i}]}"`

Consider using:

tmp=($(ledger -f finances balance "${assets[${i}]}"))

The () outside the command substitution converts it into an array.

added 239 characters in body
Source Link
muru
  • 78.1k
  • 16
  • 213
  • 319
Loading
Source Link
muru
  • 78.1k
  • 16
  • 213
  • 319
Loading