Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SUGGESTION: kill -l could show numbers, too (+CLD vs CHLD)
- X-seq: zsh-workers 20564
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: SUGGESTION: kill -l could show numbers, too (+CLD vs CHLD)
- Date: Thu, 18 Nov 2004 16:39:01 +0000
- In-reply-to: <20310.1100793917@xxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20041118145208.GD13232@xxxxxxxx> <20310.1100793917@xxxxxxx>
On Thu, Nov 18, 2004 at 04:05:17PM +0000, Peter Stephenson wrote:
> Christian =?iso-8859-1?Q?H=F6ltje?= wrote:
> > I have a suggestion for the kill builtin:
> >
> > It would be nice if when you did '-l' to show the list of signal
> > that it show the signal number.
>
> Not quite as convenient, but try this function:
>
> kill-l() {
> for i in {1..$#signals}; do
> print $((i-1))\) SIG$signals[$i]
> done | pr -t5
> }
[...]
Or, to avoid "pr":
kill-l () {
local -a s
for i in {1..$#signals}
do
s[i]="$((i-1))) SIG$signals[$i]"
done
print -C5 $s
}
BTW, I noted some discrepancies on the result of kill -l between
various shells and /bin/kill on that Linux-i386:
bash bin csh dash ksh pdksh zsh
ABRT ABRT ABRT ABRT IOT ABRT ABRT
STKFLT STKFLT 16 SIG16 STKFLT STKFLT
CHLD CHLD CHLD CHLD CHLD CHLD CLD
IO POLL POLL IO POLL IO POLL
SYS SYS SYS SYS SYS UNUSED SYS
Why SIGCLD and not SIGCHLD for zsh?
SUSv3 (POSIX) seems to require SIGCHLD
http://www.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html
http://www.opengroup.org/onlinepubs/009695399/utilities/trap.html
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author