How to add arithmetic variables in a script

view full story

http://unix.stackexchange.com – I want to accumulate the line size of a number of files contained in a folder. I have written the following script: let a=0 let num=0 for i in folder/* do num=`cat $i | wc -l` a=$a+$num done echo $a What i am geting at the end of the script is 123+234+432+... and not the result of the arithmetic operation of addition. (HowTos)