I need to write a bash script that adds the current values and returns the average. When I run the script ./average I get the error message: missing}. I am not sure why the script isn’t printing the average to screen when I run it.
Here’s what I have written thus far:
#! /bin/csh
for var in "${sum[store1=100, store2= 75, store3= 74, store4= 100, store5= 100])}"
do
total= $sum(store1+store2+ store3+store4+store5))
echo $sum / 5
done
Fixed: (Updated)