Skip to content

Instantly share code, notes, and snippets.

@shoyan
Created September 5, 2013 04:02
Show Gist options
  • Save shoyan/6445951 to your computer and use it in GitHub Desktop.
Save shoyan/6445951 to your computer and use it in GitHub Desktop.
yesかnoを訪ねて、yesの場合は処理をする
#!/bin/sh
while true; do
read -p "Do you wish to install this program? [y/n]" yn
case $yn in
[Yy] ) echo "Install!"; break;;
[Nn] ) exit;;
* ) echo "Please answer y or n.";;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment