Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- confirm_n() {
- MSG="$@"
- while [ : ]; do
- echo -n $MSG
- echo -n " [y/N] "
- read reply
- if [ "$reply" = "y" -o "$reply" = "Y" ]; then
- CONFIRMED=1
- break
- else
- if [ "$reply" = "n" -o "$reply" = "N" -o "$reply" = "" ]; then
- CONFIRMED=0
- break
- fi
- fi
- done
- }
- confirm_n "################################SOME MESSAGE"
- if [ "$CONFIRMED" = "1" ]; then
- #######################################SOME ACTION
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement