find_average()
{
sum=0
i=1
len=$#
x=$((len + 1))
while [ $i -lt $x ]
do
arg=${!i}
sum=$((sum + arg))
i=$((i + 1 ))
done
avg=$((sum / len))
return $avg
}
find_average 10 20 30 40
echo $?
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024
thanks for sharing shell scripting blogs. keep writing blogs that helps no of software developer