I am trying to add every value in an array together in a single variable. The script is working, but throws an error:
syntax error: operand expected (error token is "+")
Is it not possible to add values from an array into a non-array variable?
echo Input some numbers, separated by a space please:
read -a choice
for a in `seq 0 $amount`; do
echo The result after adding all numbers is: $sum
Thanks in advance.