LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-23-2004, 12:41 PM   #1
Speek
Member
 
Registered: Sep 2003
Distribution: Slackware
Posts: 103

Rep: Reputation: 31
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.
 
Old 12-23-2004, 02:55 PM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
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.
 
Old 12-24-2004, 04:58 AM   #3
Speek
Member
 
Registered: Sep 2003
Distribution: Slackware
Posts: 103

Original Poster
Rep: Reputation: 31
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
catching signals alaios Programming 3 11-16-2007 05:05 AM
!!! about signals !!! b2na Programming 4 02-04-2005 12:34 AM
!! about signals !!! b2na General 1 01-03-2005 04:37 PM
Catch signals C++ moyacuba Programming 2 03-18-2004 12:28 PM
trap signals AMMullan Programming 3 10-19-2003 04:31 PM


All times are GMT -5. The time now is 01:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration