Answers for "yes/no"

0

yes/no

read -n 1 -p "Is this a good question (y/n)? " answer
Posted by: Guest on June-04-2021
0

yes/no

read -p "Is this a good question (y/n)? " answer
case ${answer:0:1} in
    y|Y )
        echo Yes
    ;;
    * )
        echo No
    ;;
esac
Posted by: Guest on June-04-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language