Professional Documents
Culture Documents
Assignment No:9: Que. Write A Menu Driven Shell Program in LINUX To Perform Tasks, 1) 2) 3) 4) 5)
Assignment No:9: Que. Write A Menu Driven Shell Program in LINUX To Perform Tasks, 1) 2) 3) 4) 5)
1)
echo -n "Enter radius of circle: "
read r
echo -n "\nArea of circle is : $carea"
carea= echo "3.14 * $r * $r" | bc
;;
2)
echo -n "Enter Length of Rectangle: "
read l
echo -n "Enter Breath of Rectangle: "
read b
rarea=`expr $l \* $b`
echo "\nArea of Rectagle is: $rarea"
;;
3)
echo -n "Enter Length of Square: "
read l
sarea=`expr $l \* $l`
echo "\nArea of Square is: $sarea"
;;
4)
echo -n "Enter base of a triangle : "
read b
echo -n "Enter height of a triangle : "
read h
area=$(echo "scale=2;(1/2) * $b * $h"|bc)
echo "\nArea of a triangle is: $area"
;;
*)exit
;;
esac
OUTPUT SCREENS