Created
January 23, 2014 11:10
-
-
Save ksred/8576872 to your computer and use it in GitHub Desktop.
Basic example to show usage of infinite while loop and string based if statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
echo “Are you ready to begin? (y/n)” | |
read READY | |
while : | |
do | |
if [ “$READY” == “n” ] | |
then | |
echo “Are you ready now?” | |
read READY | |
else | |
echo “Then let's begin!” | |
break #breaks out of the infinite while loop | |
fi #end if statement | |
done #end while loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment