Keyboard keys having unintended effect on program
I have a script in which I have used a trap command to execute a cleanup function if the SIGnal is encountered. The script now fails to perform when specified keys like h, H, l, L, F, q are pressed. These are the keys to direct the program. But if even a shift key or others is pressed those keys are then ignored. Those keys are read with:
read -s -n 1
The trap command is:
trap cleanup 2 3 6 15 17 18 19 20 21 23 24 26
which covers: SIGINT=2, SIGQUIT=3, SIGABRT=6, SIGTERM=15, SIGCHLD= (17,18,20), SIGTSTP=(18,20,24), SIGSTOP=(17,19,23), & SIGTTIN=(21,26).
Is the problem in the read, SIG assignments, or elsewhere?
|