Hey there, so I'm writing a script that will automate the download and most of the install of Java JDK, Android SDK, Eclipse, and script adb to start at boot.
If you own an Android phone, this would mean that you could view and manipulate your phone from your Ubuntu computer.
So I've got most of the script done, but I'm having issues with the prompts.
So when the script gets to the point where it edits the .bashrc I'd like it to stop and ask the user if they want to do that. I found the script for a prompt that works
here and it looks like this
Code:
#1/bin/bash
yn() {
printf " Reply [y/n]: "
read yn
[[ "$yn" != y ]] && [[ "$yn" != n ]] && yn
}
# OTHER CODING
# Now you pose a question
# and then execute the yn function
printf "do you want to continue, "
yn
[[ "$yn = n ]] && exit
This is the unaltered code from the forum post, not yet customized to my needs.
What I want it to do it, if they say no, then the script continues, just skips the command that's tied to yes.
I also need to script it so that if they say no, it doen't give them the
Code:
echo "Congratulations, you're almost there!"
message.
Any help anyone can offer is appreciated