Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 2002 09:30:05 -0700 (PDT)
From:      Alexandr Kovalenko <never@nevermind.kiev.ua>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/44142: /bin/sh does not support 'command1 & && command2' syntax, which is REQUIRED by POSIX
Message-ID:  <200210161630.g9GGU5SN054457@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/44142; it has been noted by GNATS.

From: Alexandr Kovalenko <never@nevermind.kiev.ua>
To: Garrett Wollman <wollman@lcs.mit.edu>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210161630.g9GGU5SN054457>