Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9961980

Browse files
author
Ankam Ravi Kumar
authored
Create continue.sh
1 parent 070be29 commit 9961980

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

continue.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
#Purpose: While loop Continue Statement
3+
#Version:1.0
4+
#Website: https://arkit.co.in
5+
#Created Date: Tue May 22 22:03:02 IST 2018
6+
#Modified Date:
7+
#Author: Ankam Ravi Kumar
8+
# START #
9+
opt=y
10+
while [ $opt = y -o $opt = Y ]
11+
do
12+
echo -e "Please enter the number: \c"
13+
read -r num
14+
if [ $num -le 50 ]; then
15+
sq=`expr $num \* $num`
16+
echo "Square of provided number $num: $sq"
17+
else
18+
echo "Number not in the given Range"
19+
fi
20+
21+
echo -e "Do you want to continue [y/n]: \c"
22+
read -r wish
23+
if [ $wish = y -o $wish = Y ]; then
24+
continue
25+
else
26+
echo "Thank You for Exiting.."
27+
exit
28+
fi
29+
done
30+
31+
# END #

0 commit comments

Comments
 (0)