From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4289 invoked from network); 9 Jul 2003 04:43:03 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 9 Jul 2003 04:43:03 -0000 Received: (qmail 11334 invoked by alias); 9 Jul 2003 04:42:49 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6391 Received: (qmail 11319 invoked from network); 9 Jul 2003 04:42:49 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 9 Jul 2003 04:42:49 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.64.233.9] by sunsite.dk (MessageWall 1.0.8) with SMTP; 9 Jul 2003 4:42:46 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h694gie21536 for zsh-users@sunsite.dk; Tue, 8 Jul 2003 21:42:44 -0700 From: Bart Schaefer Message-Id: <1030709044244.ZM21535@candle.brasslantern.com> Date: Wed, 9 Jul 2003 04:42:44 +0000 In-Reply-To: <545d6gkyk8e.fsf@icd.teradyne.com> Comments: In reply to Vin Shelton "Another expansion (substitution?) question" (Jul 8, 1:57pm) References: <545d6gkyk8e.fsf@icd.teradyne.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh users Subject: Re: Another expansion (substitution?) question MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 8, 1:57pm, Vin Shelton wrote: } Subject: Another expansion (substitution?) question } } print -l ${(ou)${^$(all_dirs)}/$=~^*(N/:t)} } zsh: bad pattern: emacs* o*(N There are three problems here. One, you can't use an expansion that does not have braces (in this case "$=~^*") nested inside an expansion that does have braces. So you'd at least have to write (the following is not a working substitution): ${(ou)${^$(all_dirs)}/${=~^*}(N/:t)} However, problem two, globbing is not applied inside a nested expansion so your "(N/:t)" qualifiers are useless; and problem three, a slash in a brace-expansion is (as you found) a pattern substitution operator, as is two slashes, which is why doubling it didn't work; and three slashes in a row is probably being interpreted as substituting the empty string for all occurrences of the empty string. } x=( ${^$(all_dirs)}/$=~^*(N/:t) ) } print -l ${(ou)x} The only way to reduce that to a one-liner is to use another subshell like so: print -l ${(ouf)"$(print -l ${^$(all_dirs)}/$=~^*(N/:t))"} This is probably not worth the expense of the extra fork and I/O. Stick with the two-liner using the temporary.