Re: why not promote the plague ? (brace|rc|alternative|modern) syntax

Peter Stephenson <[email protected]>
Newsgroups gmane.comp.shells.zsh.user
Message-ID <[email protected]>
> On 16/12/2024 16:03 GMT Marc Chantreux <[email protected]> wrote:
> 
>  
> hello,
> 
> On Mon, Dec 16, 2024 at 05:15:33AM -0500, Lawrence Velázquez wrote:
> > > To me this is weird because it means punctuations are not treated
> > > the same way: \n ; | && || should be treated equally
> 
> > I don't know what you mean by this.
> 
> Maybe because I'm not clear for myself.

They are hierarchical.  The shell command language specification
says the following, see e.g.
https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/V3_chap02.html

This along the lines of how the zsh manual is written.

2.9.3 Lists

An AND-OR list is a sequence of one or more pipelines separated by the operators "&&" and "||" .

A list is a sequence of one or more AND-OR lists separated by the operators ';' and '&'.

The operators "&&" and "||" shall have equal precedence and shall be evaluated with left associativity. For example, both of the following commands write solely bar to standard output:

false && echo foo || echo bar
true || echo foo && echo bar

A ';' separator or a ';' or <newline> terminator shall cause the preceding AND-OR list to be executed sequentially; an '&' separator or terminator shall cause asynchronous execution of the preceding AND-OR list.

The term "compound-list" is derived from the grammar in Shell Grammar; it is equivalent to a sequence of lists, separated by <newline> characters, that can be preceded or followed by an arbitrary number of <newline> characters.

pws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.