Date: Wed, 2 Sep 2026 09:50:56 -0400
From: Chet Ramey <[email protected]>
Message-ID: <[email protected]>
| True, but the bash behavior what we're discussing here.
Yes, I know - though I'm not sure why (I mean, this is a bash list,
obviously, so why bash is clear) - but why this needs discussing I
don't follow. As I said earlier, these kinds of extensions are
fine to make (converting a syntax error into something useful) if
the something useful can be found, or if there are other reasons.
The history lesson, on how it all came about is interesting, but really
changes nothing, nor is it all that important.
| Once you say a pipeline consists of zero or more commands separated by `|'
But why on earth would anyone want to say that? A pipeline is (always has
been) a simple command, or a pipeline followed by a | and then a simple command.
Then, to add the ! (which wasn't original Bourne shell), the "pipeline" there
was renamed to be a pipe_sequence, and a pipeline became either a pipe_sequence
or a Bang followed by a pipe seeuance. No annoying corner cases, and no
good reason I can imagine for changing any of that.
| and optionally preceded by `!', you have to specify the corner cases with
| zero commands.
Sure, if the above was done, but as soon as you allow a pipeline that is
either just nothing, or a bare '!', then you're allowing such things essentially
everywhere in the shell grammar, so noise like this would also need to be
accepted
&& ! || || ! | ! && && && !
I have no idea how that gets interpreted - I could work it out, but it is
all meaningless, useless nonsense, so why bother? Not having empty commands
is a feature of the shell grammar, I see no reason to alter it in general.
kre