Skip to content

Instantly share code, notes, and snippets.

@var-bin
Last active March 9, 2017 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save var-bin/a4bb05d66249c5eb67597d759217d820 to your computer and use it in GitHub Desktop.
Save var-bin/a4bb05d66249c5eb67597d759217d820 to your computer and use it in GitHub Desktop.
while in bash, example. Repository https://github.com/var-bin/terminalForCoder__WSD
#!/bin/bash
# while.sh
again="yes"
while [ "$again" = "yes" ]
do
echo "Please enter a name:"
read name # !!!
echo "The name you entered is ${name}"
echo "Do you wish to continue? (yes/no)"
read again # !!!
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment