Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: array contains "foo"
- X-seq: zsh-users 8635
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: array contains "foo"
- Date: Sat, 26 Mar 2005 23:14:16 +0000
- In-reply-to: <200503270132.55621.arvidjaar@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <pdy98830621028bbe6b7bc50d64@[192.168.1.2]> <200503270132.55621.arvidjaar@xxxxxxxxxx>
On Mar 27, 1:32am, Andrey Borzenkov wrote:
}
} {pts/1}% x=(foo bar)
} {pts/1}% echo ${${x[(r)foo]}:+yes}
} yes
} {pts/1}% echo ${${x[(r)xyz]}:-no}
} no
This is my favorite:
setopt extendedglob
x=(foo bar)
echo ${${${x[(r)foo]}/?##/yes}:-no}
echo ${${${x[(r)xyz]}/?##/yes}:-no}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author