FarmerLi
4/28/2018 - 6:03 AM

Shell read user's input of Y/N.

Shell read user's input of Y/N.

#!/bin/bash

read -n1 -p "Do you want to continue [Y/N]? " answer
case $answer in
Y | y)
    echo
    echo "fine, continue on...";;
N | n)
    echo
    echo "OK, see you..."
    exit;;
esac