Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: SUGGESTION: kill -l could show numbers, too



On Thu, 18 Nov 2004, Peter Stephenson wrote:

> kill-l() {
>   for i in {1..$#signals}; do
>     print $((i-1))\) SIG$signals[$i]
>   done | pr -t5
> }

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 "$@"
      ;;
    esac
  }



Messages sorted by: Reverse Date, Date, Thread, Author