From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13930 invoked from network); 16 Nov 2008 21:52:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 Nov 2008 21:52:08 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 69731 invoked from network); 16 Nov 2008 21:52:04 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Nov 2008 21:52:04 -0000 Received: (qmail 5532 invoked by alias); 16 Nov 2008 21:51:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26050 Received: (qmail 5523 invoked from network); 16 Nov 2008 21:51:59 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 16 Nov 2008 21:51:59 -0000 Received: from vms173001pub.verizon.net (vms173001pub.verizon.net [206.46.173.1]) by bifrost.dotsrc.org (Postfix) with ESMTP id AE1DE80524C4 for ; Sun, 16 Nov 2008 22:51:54 +0100 (CET) Received: from torch.brasslantern.com ([96.238.220.215]) by vms173001.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KAG00IK14PU2XD1@vms173001.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 16 Nov 2008 15:51:31 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id mAGLpT5N005713 for ; Sun, 16 Nov 2008 13:51:29 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id mAGLpT9P005712 for zsh-workers@sunsite.dk; Sun, 16 Nov 2008 13:51:29 -0800 Date: Sun, 16 Nov 2008 13:51:27 -0800 From: Bart Schaefer Subject: Re: parse error in process substitution In-reply-to: <200811162118.mAGLIgK5003632@pws-pc.ntlworld.com> To: "Zsh Hackers' List" Message-id: <081116135129.ZM5711@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <200811162118.mAGLIgK5003632@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: parse error in process substitution" (Nov 16, 9:18pm) X-Virus-Scanned: ClamAV 0.92.1/8636/Sat Nov 15 06:05:47 2008 on bifrost X-Virus-Status: Clean On Nov 16, 9:18pm, Peter Stephenson wrote: } } I think they're more specialised than I previously assumed. The one I } was particularly aiming at was } } % var="" } % print ${var##<([a-z]##|)>} } Ah, and hmm. So: schaefer[504] echo (<(echo|cat)|>(echo|cat)) zsh: bad pattern: (/proc/self/fd/11|/proc/self/fd/13) schaefer[505] setopt nonomatch nocshnullglob schaefer[506] echo ${:-(<(echo|cat)|>(echo|cat))} (<(echo|cat)|>(echo|cat)) schaefer[507] echo ${~:-(<(echo|cat)|>(echo|cat))} zsh: bad pattern: (<(echo|cat)|/proc/self/fd/12) zsh: command not found: echocat Something still seems a bit odd there. Where did "echocat" come from? Also there's this -- first, zsh-4.2.0: schaefer<501> echo $(<(echo cat)) zsh: no such file or directory: (echo cat) Now 4.3.9-dev-0 latest CVS: schaefer[509] echo $(<(echo cat)) zsh: permission denied: /proc/self/fd/10 I wonder if the $(< ....) form should also be special-cased? } I've allowed <(...) and >(...) to be expanded when sub = 0, but not when } sub = 1, which is what happened before except only if the expansions } were complete arguments, so I need to find a better description. } "When parsing a string" is close but perhaps doesn't quite express it. That also leaves unanswered the question of exactly what constitutes "a string" ... is the shell grammar really completely documented enough to make that discernible? } > One last item ... perhaps you can explain what's going on here: } > } > schaefer[518] cat <<(echo foo)what? } > foo } > schaefer[519] } > } > I'm not sure exactly what I expected, but that wasn't it. } } I haven't changed any of the parsing for redirections: they are handled } separately. So it looks like this is now inconsistent and needs fixing. It used to produce a parse error. I guess I was expecting that it would now produce either a "no such file" or a "no match" error because "/proc/self/fd/11what?" doesn't exist. } Again, it's not clear why you would ever do that. True, but the shell shouldn't silently discard typographical errors unless somehow instructed to do so. --