2.
declare -a distance_arr
function add_distance()
{
local today="$1"
local total="0"
distance_arr+=($today)
for distance in "${distance_arr[@]}"
do
let "total += distance"
done
echo $total
}
2.
declare -a distance_arr
function add_distance()
{
local today="$1"
local total="0"
distance_arr+=($today)
for distance in "${distance_arr[@]}"
do
let "total += distance"
done
echo $total
}