LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Signals (http://www.linuxquestions.org/questions/programming-9/signals-269629/)

Speek 12-23-2004 12:41 PM

Signals
 
I use the following signals/interrupts in my Bash script:
Ctrl-C = SIGINT
Ctrl-\ = SIGQUIT
Ctrl-Z = SIGTSTP

Are there more signals with accompanying key combinations? I need one more to trap. I thought of Ctrl-D but that seems not to be a signal.

jim mcnamara 12-23-2004 02:55 PM

These 'keystrokes' are not necessarily standard.

stty determines what your signal if any your process receives from keystroke combinations.

Try:
Code:

stty
and look at the output.

Speek 12-24-2004 04:58 AM

Thanks Jim. I tried 'stty' but it didn't show much. But 'stty -a' shows these:

intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;

In combination with 'man 7 signal' I tried to find an additional key combination that sends a signal that can be trapped, but still no luck. How about those "user-defined signals", SIGUSR1 and SIGUSR2, that are mentioned in man 7 signal? How to define these? Can they be send to the running script with a key combination?


All times are GMT -5. The time now is 05:54 AM.