From owner-freebsd-current Mon Jan 27 09:49:55 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id JAA16320 for current-outgoing; Mon, 27 Jan 1997 09:49:55 -0800 (PST) Received: from odin.INS.CWRU.Edu (odin.INS.CWRU.Edu [129.22.8.102]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA16313 for ; Mon, 27 Jan 1997 09:49:51 -0800 (PST) Received: (chet@localhost) by odin.INS.CWRU.Edu (8.7.6+cwru/CWRU-2.3-ins) id MAA01508; Mon, 27 Jan 1997 12:49:03 -0500 (EST) (from chet) Date: Mon, 27 Jan 1997 12:46:39 -0500 From: Chet Ramey To: wollman@lcs.mit.edu Subject: Re: ash & POSIX 1003.2 q's Cc: vax@linkdead.paranoia.com, tech-userlevel@netbsd.org, freebsd-current@FreeBSD.ORG, chet@odin.INS.CWRU.Edu Reply-To: chet@po.CWRU.Edu In-Reply-To: Message from wollman@lcs.mit.edu of Mon, 27 Jan 1997 11:58:38 -0500 (id <9701271658.AA27187@halloran-eldar.lcs.mit.edu>) Message-ID: <9701271746.AA01284.SM@odin.INS.CWRU.Edu> Read-Receipt-To: chet@po.CWRU.Edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Of course, the POSIX folk have actually come up with a grammar for > their version of the Bourne shell, but I would be surprised if anybody > knew whether it actually described the input language of the > original. (Actually, I am quite certain that it doesn't, since the > original Bourne shell didn't have shell functions. But the point > still stands even stipulating this.) It doesn't. Bash uses a yacc grammar and implements the POSIX.2 shell grammar almost exactly. I've gotten dozens of bug reports with the problem summarized in this FAQ: ---------- 35) Why does bash report syntax errors when my C News scripts use a redirection before a subshell command? The actual command in question is something like < file ( command ) According to the grammar given in the POSIX.2 standard, this construct is, in fact, a syntax error. Redirections may only precede `simple commands'. A subshell construct such as the above is one of the shell's `compound commands'. A redirection may only follow a compound command. ---------- The Bourne shell accepts this construct. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, Case Western Reserve University Internet: chet@po.CWRU.Edu