capture F4 function key in bourne shell script, while

From: Brehl, Blake (Blake.Brehl@anritsu.com)
Date: Fri May 28 2004 - 17:44:53 EDT


Hi Admins,
 
I have the following script which is executed from a ksh clients .profile:
 
(grep exec .profile = "exec the_below_script")
 
#!/bin/sh
stty intr '^-'
echo " **************************
echo " * A) Run program A *
echo " * B) Run Program B *
echo " **************************
echo " * 9) Exit
END1=0
while test $END1 = 0
do
     END1=1
     echo "Please Enter Choice: \c"
     read INPUT1
     case $INPUT1 in
                                  a|A) /apps/scripts/programA
                                  b|B) /apps/scripts/programB
             9|EXIT|exit|E|e|Q|q) END1=1;;
                               *) END1=0;;
  esac
done
stty intr '^c'
exit 0
 
I would like to add the F4 function key entry to the exit condition:
 
9|EXIT|exit|E|e|Q|q) END1=1;;

When in the while statement, hitting function key F4 returns to the screen
"^[OS", example:
 
Please Enter Choice: ^[OS
 
Is there a way to capture the F4 function key to exit the shell?
 
Best Regards,
 
Blake Brehl
Sys Admin/DBA
Anritsu Company United States
Morgan Hill, CA
 

 



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:59 EDT