From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9330 invoked by alias); 15 May 2014 04:55:53 -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: 18811 Received: (qmail 24767 invoked from network); 15 May 2014 04:55:47 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140514215557.ZM26660@torch.brasslantern.com> Date: Wed, 14 May 2014 21:55:57 -0700 In-reply-to: <140514001819.ZM23478@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: globbing in conditional expressions" (May 14, 12:18am) References: <20140507124101.GA53652@isis.sigpipe.cz> <20140507154407.660eb500@pwslap01u.europe.root.pri> <20140508105522.GE2052@tarsus.local2> <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> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: globbing in conditional expressions MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On May 14, 12:18am, Bart Schaefer wrote: } Subject: Re: globbing in conditional expressions } } On May 14, 4:19am, Daniel Shahaf wrote: } } } } I've taken a shot at making those changes, see attached. } } The strspn(..., "abcdefghkmnoprstuwxzLONGS") probably should NOT have } the "m" added to them, because those are intended to be identifying } operators that are defined by POSIX "test". Upon testing, the strspn in par_cond_double() needs to have the "m". It can be left out of strspn() in par_cond_2(). } to use [ -m ... ] anyway because the glob pattern would expand before } the call to the test builtin. Playing with this, I find that you can quote the pattern [ -m 'pat' ]. However, quoting the pattern in [[ -m 'pat' ]] does not have the expected effect -- a glob is performed even though the pattern was quoted, so there's no way to make ? * [ ] match literally. Perhaps not a show-stopper. } check path searches like **/zero* and whether glob flags work right? I tried this and it appears glob patterns confuse things: torch% ls b* zsh: no matches found: b* torch% [[ -m b ]] && print OK torch% [[ -m b(/) ]] && print OK OK So, still a few issues to iron out.