Aim : Write a shell script to find mean and standard deviation of three numbers
#!/bin/bash echo "Enter three integers with space between" read a b c sum=`expr $a + $b + $c` mean=`expr $sum / 3` aa=$((($a - $mean) * ($a - $mean))) bb=$((($b - $mean) * ($b - $mean))) cc=$((($c - $mean) * ($c - $mean))) sd=$( echo "sqrt(($aa + $bb + $cc) / 3)" | bc -l ) echo "sum=$sum" echo "mean=$mean" echo "Sd=$sd"
It’s Nice! Great!
We are glad that you have enjoyed your learning experience with us.