Skip to content

Tip #6: Signalnummern und -namen

Bei Christian Schneider fand ich einen schönen Einzeiler zur Anzeige der Signalnummern und deren Namen:

integer i=0
print -c ${(e)signals//*/\$((i++))\) SIG\$signals[\$i]}

Wem diese Nummern und Signale nichts sagen, kann es in der Zusammenfassung nachlesen.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

Lalufu on :

Riecht fuer mich wie “Komplizierte Loesungen fuer einfache Probleme”. “kill -l” tut es vermutlich auch (zumindestens auf nicht-antiken Linuxen und BSDs)

Jens Kubieziel on :

Mit kill -l bekommst du nur eine simple Liste:
kubijens@paradise:~/ > kill -l
HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH POLL PWR SYS
Der obige Ausschnitt bietet einfach mehr Komfort:
kubijens@paradise:~/ > print -c ${(e)signals//*/\$((i++))\) SIG\$signals[\$i]}
0) SIGEXIT 7) SIGBUS 14) SIGALRM 21) SIGTTIN 28) SIGWINCH
1) SIGHUP 8-) SIGFPE 15) SIGTERM 22) SIGTTOU 29) SIGPOLL
2) SIGINT 9) SIGKILL 16) SIGSTKFLT 23) SIGURG 30) SIGPWR
3) SIGQUIT 10) SIGUSR1 17) SIGCHLD 24) SIGXCPU 31) SIGSYS
4) SIGILL 11) SIGSEGV 18) SIGCONT 25) SIGXFSZ 32) SIGZERR
5) SIGTRAP 12) SIGUSR2 19) SIGSTOP 26) SIGVTALRM 33) SIGDEBUG
6) SIGABRT 13) SIGPIPE 20) SIGTSTP 27) SIGPROF

Lalufu on :

Das haengt dann wohl recht massiv vom verwendeten “kill” ab. Linux und BSD (solange nicht antik, siehe oben) produzieren eine Namen/Nummern-Liste. Ein recht betagtes Tru64 hier spuckt allerdings auch nur Namen aus. Dafuer hat es auch keine zsh :-)

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
BBCode format allowed
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Form options
cronjob