mirror of
https://github.com/techarkit/shell-scripting-tutorial.git
synced 2025-07-25 01:28:51 +00:00
Create continue.sh
This commit is contained in:
31
continue.sh
Normal file
31
continue.sh
Normal 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 #
|
Reference in New Issue
Block a user