GaijinPunch
MIS
I know the syntax (I thought anyway).
basically what I've got is a list of integers that I can successfully bring into the file.
What I want to do is add them all together. What I *THOUGHT* would work, is:
list=list.txt
numbers=`cat $list`
typeset -i increment; increment=0
teypset -i total; total=0
for increment in $numbers
do
(( $total = $total + $increment ))
echo $total
done
exit
But I always get a:
expression requires lvalue error.
Sorry if this is a ridiculously inane question. I've never done any arithmetic with shells before.
basically what I've got is a list of integers that I can successfully bring into the file.
What I want to do is add them all together. What I *THOUGHT* would work, is:
list=list.txt
numbers=`cat $list`
typeset -i increment; increment=0
teypset -i total; total=0
for increment in $numbers
do
(( $total = $total + $increment ))
echo $total
done
exit
But I always get a:
expression requires lvalue error.
Sorry if this is a ridiculously inane question. I've never done any arithmetic with shells before.