Add prompt line on the script #163
benzpollard
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Put this after usage()
####Improvements############
get_input () {
while true; do
read -p "Do you want to proceed? [y/n]" yn
case $yn in
[Yy]* ) return 0;;
[Nn]* ) return 1;;
* ) echo "Please answer y or n";;
esac
done
}
####Improvements############
Next is.... Put this on the line where you want the script to stop and prompt you to continue or not
if get_input; then
echo "Continue...";
else
echo "Discontinue the process...";
exit 1
fi
Beta Was this translation helpful? Give feedback.
All reactions