Quote:
Originally Posted by michaelk
What was wrong with the code from post #12?
Typical response from a menu is when you press a wrong key an error message and the same menu items would be displayed again. You might want to use * case option if a b or c was not pressed.
|
ahh, OK, I see now. Nothing wrong with previous, it works fine, but that little bit of screen movement if i hit a key while reaching for my coffee or donut, then i have to scroll back, etc. so this is just cosmetic, i have an option to show the menu if i need it, I didn't want it popping up every time i pressed a key, so this works ok, no extra screen stuff going on.. never occurred to me I could just remove the mymenu :P oh well, I don't mind looking like an idiot as long as I'm learning something... thanks
Code:
#!/bin/bash
while [ 1 ]
do
read -sn1 PRESSED
case $PRESSED in
a) echo "you typed a";;
b) echo "you typed b";;
c) echo "you typed c";;
m) echo "i have a menu option";;
*)
beep
;;
esac
done