Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: $jobstates (Re: zsh: Strange feature with 'jobs' commmand)
- X-seq: zsh-users 5014
- From: Sven Wischnowsky <wischnow@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: $jobstates (Re: zsh: Strange feature with 'jobs' commmand)
- Date: Thu, 30 May 2002 14:48:36 +0200
- In-reply-to: <20020530123310.GA5771@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020530135450.A16761@xxxxxxxxxxxxxxxxxxxxxx> <20020530123310.GA5771@xxxxxxxxxxxxxxxxx>
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@xxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author