Skip to content

Instantly share code, notes, and snippets.

@foru17
Created March 26, 2014 10:05
Show Gist options
  • Save foru17/9780104 to your computer and use it in GitHub Desktop.
Save foru17/9780104 to your computer and use it in GitHub Desktop.
SHELL脚本yN选择
while true; do
read -p "Do you wish to install this program?" yn
case $yn in
[Yy]* ) make install; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
echo "Do you wish to install this program?"
select yn in "Yes" "No"; do
case $yn in
Yes ) make install; break;;
No ) exit;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment