From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21733 invoked by alias); 30 May 2014 14:45:32 -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: X-Seq: 18864 Received: (qmail 10615 invoked from network); 30 May 2014 14:45:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=mesmtp; bh= mTKTtbFZLaVX2t+MWTYduzPMTAQ=; b=Xn9DRrvEzacEbPDyfCDC6XxPxdfiYsAY +nh0UGkqjwQJo4WmXQYxF+SXzFIHsEjP+3bCvZiSCLgSuczOahzX0HE614CB157q wQlOQnLUsIy2BxvTescRRjssi40GIJATaVp0TBacouztldMw6R4Z/tAa6148DxFu oEeHB1p3cfM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=mTKTtbFZLaVX2t+MWTYduzPMTAQ=; b=aAhj2uVg6SkBuo3iWUWXhWf0iDih CGtE+OcpLsRGChctSoqFnoJJ99/yFaXJS0yWSoqmTDNt60bs+e9i0DSCTiCVXjUz tyT5P/6TOXCnd4NiIVJTpskvGpjg9nJUqdwuLZxOuoZ6XrreAheeFQDbTZCfqGP5 S1frIfH/OOry/Ag= X-Sasl-enc: 9ZzPzv8CIChULEmeHYdPSxlwx4hyZeEpczHKy6MTPPtp 1401461113 Date: Fri, 30 May 2014 14:45:09 +0000 From: Daniel Shahaf To: Bart Schaefer Cc: zsh-users@zsh.org Subject: Re: globbing in conditional expressions Message-ID: <20140530144509.GC1868@tarsus.local2> References: <20140508122045.3c68c3fa@pwslap01u.europe.root.pri> <140508083418.ZM14713@torch.brasslantern.com> <20140508201936.GB53652@isis.sigpipe.cz> <140513084117.ZM22925@torch.brasslantern.com> <20140514041908.GF2471@tarsus.local2> <140514001819.ZM23478@torch.brasslantern.com> <20140515092901.GC2174@tarsus.local2> <140515075003.ZM28035@torch.brasslantern.com> <20140526235216.GC1920@tarsus.local2> <140529205956.ZM17410@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <140529205956.ZM17410@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) Bart Schaefer wrote on Thu, May 29, 2014 at 20:59:56 -0700: > On May 26, 11:52pm, Daniel Shahaf wrote: > } > } > } Bart Schaefer wrote on Thu, May 15, 2014 at 07:50:03 -0700: > } > adding a globbing flag (#X) [where I'm using X as a placeholder rather > } > than a suggestion for the actual flag] which means that the glob returns > } > only the first matching file it stumbles upon. > } > > } > In fact if you had that flag you wouldn't need -m as a condition op, it > } > would suffice to do [ ! -z pat(NX) ]. > } > } That turned out to be much less code to implement. It's attached, if > } anyone finds it useful. > > I like this one. Is there a mnemonic for your choice of (Y) ? No. That said, if it's to be commonly used with (N), then (NY) does serve as a memorable syntax.