Skip to content

Instantly share code, notes, and snippets.

@dasDaniel
Created August 19, 2019 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dasDaniel/89e487d9990f01c65fb45d2788d50c57 to your computer and use it in GitHub Desktop.
Save dasDaniel/89e487d9990f01c65fb45d2788d50c57 to your computer and use it in GitHub Desktop.
prompt for yes
#!/bin/bash
echo -n "Continue (y/n)? "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
echo Yes
install_thing
else
echo No
exit
fi
#!/bin/bash
echo -n "Must be yes or Yes (yes)? "
read answer
if [ "$answer" != "${answer#[Yy]es}" ] ;then
echo Yes
install_thing
else
echo No
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment