From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-users@sunsite.dk
Subject: Re: $jobstates (Re: zsh: Strange feature with 'jobs' commmand)
Date: Thu, 30 May 2002 14:48:36 +0200 [thread overview]
Message-ID: <15606.8100.523967.430265@wischnow.berkom.de> (raw)
In-Reply-To: <20020530123310.GA5771@picard.franken.de>
Thomas Köhler wrote:
> ...
>
> What I don't understand from "man zshparam":
>
> k If used in a subscript on an associative array,
> this flag causes the keys to be interpreted as pat
> terns, and returns the value for the first key
> found where exp is matched by the key. This flag
> does not work on the left side of an assignment to
> an associative array element. If used on another
> type of parameter, this behaves like `r'.
>
> K On an associative array this is like `k' but
> returns all values where exp is matched by the
> keys. On other types of parameters this has the
> same effect as `R'.
>
> 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
Bye
Sven
--
Sven Wischnowsky wischnow@berkom.de
next prev parent reply other threads:[~2002-05-30 12:48 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 [this message]
2002-05-30 13:25 ` Thomas Köhler
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=15606.8100.523967.430265@wischnow.berkom.de \
--to=wischnow@berkom.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).