From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-users-return-23722-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 681073b7 for ; Thu, 25 Oct 2018 20:21:40 +0000 (UTC) Received: (qmail 4617 invoked by alias); 25 Oct 2018 20:21:28 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23722 Received: (qmail 19916 invoked by uid 1010); 25 Oct 2018 20:21:28 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f51.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.167.51):SA:0(-1.9/5.0):. Processed in 2.869392 secs); 25 Oct 2018 20:21:28 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GnlPvV1j/URwRCjGwa7XlQwVXMQUiEhDmUJnaLHmTbg=; b=X1uWjfjoSmmK15vdk+yBTyf/lLyq+RsdfqkgwY3l2DXShr34ScEwDCPZ2zChuofx2r aiFTP/fElZ+B7yhVHPrCJ9xFgmQw/S3nTVs4yKw9Al+zdRlSLpeKhPw0M67LDdeusjjG UDm45zaH0OlCxodEYwx5xp1r73hj+kOsT4baUL4tfAHuJ3FVCwyED3zbUmq4IN5Cz+cb SmH1gqK1MdkT1QdzYHfxV/oB3cRhZ1375YrA2GlEjxwmEdN+OR28xQcfmeGniFc9YWy+ cq25Fkdh7o/tqcGmObnmIsJzOHlbIXZGBC7bgQ2ByZjMcAYv7EgXvd7Qc1rovKF+fBCZ Soug== X-Gm-Message-State: AGRZ1gJQjOYBaYgqEpPIwjXCUOA0Pisy9VXoKin3L2x01w8QmQRgz03S iSgnpmwaeullTYihRDPCfhq3EK8vgOF31l4aXGiIgg== X-Google-Smtp-Source: AJdET5c7Zbs8ZfZYkRUWTFNjJ/KJZFHBOPnO3rS7SYUJ7Hcb8+Tjl3qzaWyMeGhdF8QixwXnbTkOOYj6Uy+ioXkcS7s= X-Received: by 2002:a19:6d0e:: with SMTP id i14-v6mr421345lfc.57.1540498881648; Thu, 25 Oct 2018 13:21:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 25 Oct 2018 13:21:08 -0700 Message-ID: Subject: Re: Filtering array on index To: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 25, 2018 at 4:30 AM Jesper Nyg=C3=A5rds wrote: > > I have an array which is the result of using zparseopts on a specificatio= n > that makes it possible to specify several filters with a -v flag. The > resulting array might look like the following: > > myarr=3D(-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=3D() % 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?