Here is my current code:
for i do
sum=$(expr $sum + $i)
done
echo =$sum
Now this works, but I want it to display all of the numbers. For example, If I enter ./sum 1 2 3, I want it to display 1+2+3=6. Right now it only displays the answer. Also, is there a way I could execute the file without ./. For instance, could I use sum 1 2 3 instead of ./sum 1 2 3. I've tried chmod 700 "myfile," but that didn't seem to work.