| Summary: | /bin/sh does not support 'command1 & && command2' syntax, which is REQUIRED by POSIX | ||
|---|---|---|---|
| Product: | Base System | Reporter: | never |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.7-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
never
2002-10-16 15:20:01 UTC
<<On Wed, 16 Oct 2002 17:16:54 +0300 (EEST), Alexandr Kovalenko <never@nevermind.kiev.ua> said: > /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 ; 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. -GAWollman State Changed From-To: open->closed The Standard is quite clear and does not support submitter's desired interpretation of the shell grammar. 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/ |