Hi,
try
SUM=0; for i in `seq 0 10`; do SUM=`echo "$SUM+$i"|bc`; echo -n $SUM ;done
here is the o/p...
0 1 3 6 10 15 21 28 36 45 55
On Tue, 15 Jan 2002, Parvez Lanewala wrote:
hi luggers,
i'm having a problem with the following code...
--snip--
for i in `seq 0 10`; do SUM=`echo $SUM+${ARR[$i]}|bc` done
--snip--
error says : (standard_in) 1: parse error
although the segment
echo $SUM+${ARR[$i]}|bc
works fine outside the for loop. any hints on why and how i can avoid it.
thanks, parvez