Create continue.sh

This commit is contained in:
Ankam Ravi Kumar
2018-06-16 17:45:10 +05:30
committed by GitHub
parent 070be29155
commit 996198023b

31
continue.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/bash
#Purpose: While loop Continue Statement
#Version:1.0
#Website: https://arkit.co.in
#Created Date: Tue May 22 22:03:02 IST 2018
#Modified Date:
#Author: Ankam Ravi Kumar
# START #
opt=y
while [ $opt = y -o $opt = Y ]
do
echo -e "Please enter the number: \c"
read -r num
if [ $num -le 50 ]; then
sq=`expr $num \* $num`
echo "Square of provided number $num: $sq"
else
echo "Number not in the given Range"
fi
echo -e "Do you want to continue [y/n]: \c"
read -r wish
if [ $wish = y -o $wish = Y ]; then
continue
else
echo "Thank You for Exiting.."
exit
fi
done
# END #