Yes No
This page was last updated on April 4, 2012.
- This script will ask you for one of two replies and will not continue until you give it one or the other.
-
#!/bin/bash JOB () { read -s -n1 -p "Do you wish to do that? (y/n)" keypress; if [ "$keypress" = "y" ]; then echo "You chose yes"; elif [ "$keypress" = "n" ]; then echo "You chose no"; else JOB; fi; }; JOB;
Obligatory Happy Ending
And they all lived happily ever after. The end.
