Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Filtering array on index
- X-seq: zsh-users 23722
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- Subject: Re: Filtering array on index
- Date: Thu, 25 Oct 2018 13:21:08 -0700
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GnlPvV1j/URwRCjGwa7XlQwVXMQUiEhDmUJnaLHmTbg=; b=glrmtUMaa5X+c0f4aaqLsS11yp24lZmJuI0PFLt1oOoC2BmAuNxnLefmbV3K4niHPE /auu/fVrJfIiwpddhzngPittEpRBsUgq57qyGTG+Qu8es2pJ+M7EIt/4zzcoe04GGyGo uRHeRop8Pil2eAn3plb7Eau0O5whW7ijlXZ5C95lR2AwgQIl1BT+vJP2ScbuckEBVMOv 6lhpMsJJuDEEoU9iBA/+HVXYlbQvpx9HvHcMCE8uu4udYY8ValL760biqbQ0EwR+mjdV 2fdkJ3TPf/+5mgMeLB1kiQ+n9zGp0vJyET1f5Qx/RiA90yRUPesEJdSEdIo+s5+eoXCv 2ROg==
- In-reply-to: <CABZhJg80vQuMHGKABkzR1bdtt89Akpkfd8kWOV83N-qvqioaXw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABZhJg80vQuMHGKABkzR1bdtt89Akpkfd8kWOV83N-qvqioaXw@mail.gmail.com>
On Thu, Oct 25, 2018 at 4:30 AM Jesper Nygårds <jesper.nygards@xxxxxxxxx> wrote:
>
> I have an array which is the result of using zparseopts on a specification
> that makes it possible to specify several filters with a -v flag. The
> resulting array might look like the following:
>
> myarr=(-v filter1 -v filter2)
What's your spec that produces this array? Here's my stab at an equivalent:
% set -- -v -v one -v "two -v" -v three -v
% vees=()
% zparseopts -a vees v+::
% print -lr -- $vees
-v
-vone
-vtwo -v
-vthree
-v
% print -lr -- ${vees#-v}
one
two -v
three
What am I missing?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author