zsh-users
 help / color / mirror / code / Atom feed
From: "Thomas Köhler" <jean-luc@picard.franken.de>
To: zsh-users@sunsite.dk
Subject: Re: $jobstates (Re: zsh: Strange feature with 'jobs' commmand)
Date: Thu, 30 May 2002 15:25:15 +0200	[thread overview]
Message-ID: <20020530132514.GA6724@picard.franken.de> (raw)
In-Reply-To: <15606.8100.523967.430265@wischnow.berkom.de>

[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]

Sven Wischnowsky wrote [020530 14:49]:
> Thomas Köhler wrote:
> 
> > ...
> > What I don't understand from "man zshparam":
[...]
> > Why doesn't
> >    ~> echo $jobstates[(K)*]
> > return anything when [...]
> 
> You want (i):
> 
>   % echo $jobstates[(i)*]
>   1 2 ...
> 
> With k and K the *keys* stored in the assoc (as opposed to the *exp*
> given in the subscript) are used as patterns:
> 
>   % typeset -A type
>   % type=('[a-zA-Z]' alpha '[0-9]' digit '[^a-zA-Z0-9]' other)
>   % echo $type[(k)x] $type[(k)4] $type[(k).]
>   alpha digit other

Aaaaahh, silly me. Now I understand :-)

Now, for the original problem... Uhm. Tricky. any better ideas?

jless() {
   typeset -x -A tmpstates
   for i in $jobstates[(I)*] 
   do
      tmpstates[$i]=$jobstates[$i]
   done
   for i in $tmpstates[(I)*]
   do
      echo "[$i]\t$tmpstates[$i]"
   done  | sort -n |  less
   unset tmpstates
}

Ciao,
Thomas

-- 
 Thomas Köhler Email:   jean-luc@picard.franken.de     | LCARS - Linux
     <><        WWW:     http://jeanluc-picard.de      | for Computers
                IRC:             jeanluc               | on All Real
               PGP public key available from Homepage! | Starships

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

      reply	other threads:[~2002-05-30 13:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-30 11:54 zsh: Strange feature with 'jobs' commmand Björn Johannesson
2002-05-30 12:16 ` Oliver Kiddle
2002-05-30 12:37   ` Borsenkow Andrej
2002-05-30 15:36     ` Phil Pennock
2002-05-30 12:33 ` $jobstates (Re: zsh: Strange feature with 'jobs' commmand) Thomas Köhler
2002-05-30 12:48   ` Sven Wischnowsky
2002-05-30 13:25     ` Thomas Köhler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020530132514.GA6724@picard.franken.de \
    --to=jean-luc@picard.franken.de \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).