Skip to content

Instantly share code, notes, and snippets.

@asvid
Created May 3, 2020 11:34
Show Gist options
  • Select an option

  • Save asvid/4975699f4f7694ebfb9d8fa612283b11 to your computer and use it in GitHub Desktop.

Select an option

Save asvid/4975699f4f7694ebfb9d8fa612283b11 to your computer and use it in GitHub Desktop.
while true; do
echo -e "${CYAN}Are you sure? ${GREEN}(yes/no)${NC}\n"
read -p "" -r yn
case $yn in
[Yy]* ) echo -e "${GREEN}Great, let's do this!${NC}\n"; break;;
[Nn]* ) echo -e "${RED}No problem, canceling${NC}\n";exit;;
* ) echo -e "Please answer ${GREEN}yes${NC} or ${RED}no${NC}.";;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment