Skip to content

Instantly share code, notes, and snippets.

@edouard-lopez
Created November 17, 2014 13:27
Show Gist options
  • Save edouard-lopez/6e5024ccd0e4af5ba236 to your computer and use it in GitHub Desktop.
Save edouard-lopez/6e5024ccd0e4af5ba236 to your computer and use it in GitHub Desktop.
ask user for confirmation
#!/bin/bash
while true; do
read -p "$(printf "\tEditing…\t%s? [y/N]\n" )" yn;
case $yn in
[Yy]* )
echo "action_si_valide"
break;;
'') ;&
[Nn]*)
echo "action_si_mauvaise_réponse"
exit;;
* )
echo "autre_cas"
esac;
done;
echo "vu_si_action_valide"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment