Skip to content

Instantly share code, notes, and snippets.

@dave-burke
Created November 25, 2019 13:20
Show Gist options
  • Save dave-burke/e53c66bfdad44b600dacc7e816216bbf to your computer and use it in GitHub Desktop.
Save dave-burke/e53c66bfdad44b600dacc7e816216bbf to your computer and use it in GitHub Desktop.
An example of how to make sure the user is *really* sure before you do something.
#!/bin/bash
read -p "Are you sure? " sure
while [[ "${sure}" != "yes" && "${sure}" != "no" ]]; do
read -p "Please type 'yes' or 'no' " sure
done
echo "${sure}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment