I want to pause input in a shell script, and prompt the user for choices. The standard Yes, No, or Cancel type question. How d
Yes
No
Cancel
yn() { if [[ 'y' == `read -s -n 1 -p "[y/n]: " Y; echo $Y` ]]; then eval $1; else eval $2; fi } yn 'echo yes' 'echo no' yn 'echo absent no function works too!'