Could someone please help me out with loop problem. I need it to display the total of all the numbers. This is what i have tried so far:
sum=0
for numbers in 6 9 -4 7
do
sum=$(($sum+$numbers))
echo $sum
done
The output shows these numbers:
6
15
11
18