Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SUGGESTION: kill -l could show numbers, too
- X-seq: zsh-workers 20565
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: SUGGESTION: kill -l could show numbers, too
- Date: Thu, 18 Nov 2004 16:50:08 +0000
- In-reply-to: <Pine.LNX.4.61.0411180825470.12726@xxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20041118145208.GD13232@xxxxxxxx> <20310.1100793917@xxxxxxx> <Pine.LNX.4.61.0411180825470.12726@xxxxxxxxxxxxxxxxxx>
On Thu, Nov 18, 2004 at 08:33:04AM -0800, Bart Schaefer wrote:
[...]
> Which can be rewritten as a wrapper, and without the pipe to "pr":
>
> kill() {
> case $1 in
> (-l)
> integer i=0
> print -c ${(e)signals//*/\$((i++))\) SIG\$signals[\$i]}
> ;;
> (*)
> command kill "$@"
[...]
Rather:
builtin kill "$@"
And you need to check the number of arguments (for kill -l TERM
for instance)
kill() {
if (( $# == 1 )) && [[ $1 = "-l" ]]; then
integer i=0
print -rc ${(e)signals//*/\$((i++))\) SIG\$signals[\$i]}
else
builtin kill "$@"
fi
}
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author