Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: is a key of pointed key set ? (where is the + )
- X-seq: zsh-users 10941
- From: Andrey Borzenkov <arvidjaar@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: is a key of pointed key set ? (where is the + )
- Date: Mon, 6 Nov 2006 11:20:09 +0300
- Cc: Marc Chantreux <marc.chantreux@xxxxxxxxxxxxxxxxxx>
- In-reply-to: <20061106080431.GA17141@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20061106080431.GA17141@xxxxxxxxxxxxxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 06 November 2006 11:04, Marc Chantreux wrote:
> Hi all,
>
> See this code:
>
> pnt=h
> typeset -A h
> h=( k1 value )
>
> so :
>
> echo ${${(P)pnt}[k1]}
> prints value
>
> but how to know if the key itself is set ?
{pts/0}% typeset -A h
{pts/0}% h=(k v)
{pts/0}% print -- ${(k)h[k]+set}
set
{pts/0}% print -- ${(k)h[k1]-unset}
unset
- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFTvA9R6LMutpd94wRAlZNAJwLesklZ5N2tuHvm/tKfvw2wtgqUgCfYBkm
Z33cKWv8KRvmBY0ZQ7FBbWE=
=5lhJ
-----END PGP SIGNATURE-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author