#!/bin/bash
## Addition of any numbers.
## date: Feb. 02, 2016.
## author: Xiaoxu Guan at LSU HPC.



LIST="$@"
echo ${LIST}
echo "No of arguments is" $#

function_add() {
      let asum=0
    for i in ${LIST[@]}
    do
##       let asum=$asum+$i
        asum=`echo "scale=5 ; $asum+$i"  |  bc`
    done
      function_add=$asum
}


function_add

echo "sum ="  $function_add

