Mar 23, 2004 #1 lmb5kids Programmer Dec 18, 2003 36 US I have a shell script that I would like the user to be able to press the escape key to exit, how would I go about reading the escape key in a script ? Thanks for any help.
I have a shell script that I would like the user to be able to press the escape key to exit, how would I go about reading the escape key in a script ? Thanks for any help.
Mar 23, 2004 #2 PHV MIS Nov 8, 2002 53,708 FR You can try put the following lines at the beginning of your scripts: savetty=`stty -g` stty intr '^[' trap 'stty $savetty; exit 0' 0 1 2 3 15 Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 Upvote 0 Downvote
You can try put the following lines at the beginning of your scripts: savetty=`stty -g` stty intr '^[' trap 'stty $savetty; exit 0' 0 1 2 3 15 Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884