From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13625 invoked from network); 18 Aug 2003 15:58:33 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 18 Aug 2003 15:58:33 -0000 Received: (qmail 28194 invoked by alias); 18 Aug 2003 15:58:16 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6473 Received: (qmail 28185 invoked from network); 18 Aug 2003 15:58:16 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 18 Aug 2003 15:58:16 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.64.233.107] by sunsite.dk (MessageWall 1.0.8) with SMTP; 18 Aug 2003 15:58:15 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h7IFwDU12976 for zsh-users@sunsite.dk; Mon, 18 Aug 2003 08:58:13 -0700 From: Bart Schaefer Message-Id: <1030818155813.ZM12975@candle.brasslantern.com> Date: Mon, 18 Aug 2003 15:58:13 +0000 In-Reply-To: <20030818060257.GA15930@bebop.thehutt.org> Comments: In reply to Jerry A! "Re: Help w/compctl & ksh_glob" (Aug 18, 2:02am) References: <20030816065935.GA31520@bebop.thehutt.org> <1030816170739.ZM5619@candle.brasslantern.com> <20030818060257.GA15930@bebop.thehutt.org> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.dk Subject: Re: Help w/compctl & ksh_glob MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 18, 2:02am, Jerry A! wrote: } Subject: Re: Help w/compctl & ksh_glob } } : The documentation for 'compctl -g' may have part of the answer: } : } : [...] More than one pattern may be } : given separated by blanks. (Note that brace expansion is _not_ } : part of globbing. Use the syntax `(either|or)' to match } : alternatives.) } } Actually, {} globbing is valid ksh93 syntax. It's not valid ksh88 } syntax. But I've always pictured zsh's ksh emulation as ksh93 } emulation. It's valid syntax, but it's not _globbing_ syntax. The meaning of *.+(b{oo,ar,az}|quu|txt) is to expand the expression to the three words *.+(boo|quu|txt) *.+(bar|quu|txt) *.+(baz|quu|txt) Only _after_ that expansion has occured does globbing apply. You can see why that must be the case if you consider an expression *.+(b{oo,a/r,/az}|quu|txt) which probably results in two invalid glob patterns (it does in zsh, at least, because alternatives within (|) can't cross directories), but one pattern which still produces matches. If brace expansion were part of globbing, the entire expression would be invalid. In the case of 'compctl -g', globbing is applied directly to the string without first performing brace expansion, so you must use an additional layer of (|). } : However, the real problem is something to do with the SH_GLOB option, } } This got the wheel's turning. Turn's out that 'emulate ksh' turns on } 'SH_GLOB', which in turns disables (|) globbing. That's not precisely what's happening, because as I said the (|) pattern works as expected when it's used on the command line (or at least, it does for me); it fails only in the compctl arguments. I haven't been able to figure out why yet.