From owner-freebsd-bugs Wed Oct 16 9:30: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14EEE37B404 for ; Wed, 16 Oct 2002 09:30:06 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BEF8143E91 for ; Wed, 16 Oct 2002 09:30:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9GGU5x3054460 for ; Wed, 16 Oct 2002 09:30:05 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9GGU5SN054457; Wed, 16 Oct 2002 09:30:05 -0700 (PDT) Date: Wed, 16 Oct 2002 09:30:05 -0700 (PDT) Message-Id: <200210161630.g9GGU5SN054457@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Alexandr Kovalenko Subject: Re: bin/44142: /bin/sh does not support 'command1 & && command2' syntax, which is REQUIRED by POSIX Reply-To: Alexandr Kovalenko Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/44142; it has been noted by GNATS. From: Alexandr Kovalenko To: Garrett Wollman Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/44142: /bin/sh does not support 'command1 & && command2' syntax, which is REQUIRED by POSIX Date: Wed, 16 Oct 2002 19:26:12 +0300 Hello, Garrett Wollman! On Wed, Oct 16, 2002 at 11:55:42AM -0400, you wrote: > > /bin/sh does not support 'command1 & && command2' syntax, which is REQUIRED by POSIX: > > Your interpretation is erroneous. The grammar takes precedence over > the textual description of the syntax, and the grammar is quite clear: > > complete_command : list separator > | list > ; > list : list separator_op and_or > | and_or > ; > and_or : pipeline > | and_or AND_IF linebreak pipeline > | and_or OR_IF linebreak pipeline > ; As we can see from Grammar: pipeline : pipe_sequence | Bang pipe_sequence ; pipe_sequence : command | pipe_sequence '|' linebreak command ; So, we can parse 'command1 & && command2' in this way: 'command1 & && command2' : and_or(complete_command(list('command1') separator(' ')) separator_op('&') AND_IF pipeline('command2')) > The pseudo-syntax `command1 &' can only be resolved by the `list' > production in the grammar. The `&&' and `||' operators take > pipelines, and not lists, as operands. See XCU6 page 58. Yes. It is correct. Sorry for false alert. -- NEVE-RIPE Ukrainian FreeBSD User Group http://uafug.org.ua/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message