kk=y
while [ "$kk" != "y" ]
do
echo "Enter value of x"
read x
echo "Enter value of y"
read y
echo "Enter your choice"
echo "1 Add"
echo "2 Sub"
echo "3 Multi"
echo "4 div"
echo "5 i dont know"
read case
case $case in
1) expr $x + $y ;;
2) expr $x - $y ;;
3) expr $x * $y ;;
4) expr $x % $y ;;
5) exit
esac
echo "enter option"
read option
echo "do you want to continue"
read kk
done
/*Output
linux-mj2y:~> sh arith.sh
Enter value of x
3
Enter value of y
5
Enter your choice
1 Add
2 Sub
3 Multi
4 div
5 i dont know
1
8
enter option
y
do you want to continue
n
Enter value of x
3
Enter value of y
3
Enter your choice
1 Add
2 Sub
3 Multi
4 div
5 i dont know
4
0
enter option
kk
do you want to continue
y
*/
0 comments :