[...] honestly, I can't imagine how bash
could be a bottleneck for anything in 2024 (if you have such
scenarios, please share).
The original message began with the assertion that the OP had run
across a bug in dash, and gave two URLs, with no description of the bug
or the impact it was having on their life.
I read one of the URLs, and the bug is rather obscure. It involves a
second script embedded inside a here document inside the first script,
with the second script being passed to an interpreter process on stdin.
I'm not surprised that nobody knew about the bug for many years.
Greg Wooledge (12024-06-21):
The original message began with the assertion that the OP had run
across a bug in dash, and gave two URLs, with no description of the bug
or the impact it was having on their life.
I read one of the URLs, and the bug is rather obscure. It involves a second script embedded inside a here document inside the first script,
with the second script being passed to an interpreter process on stdin.
I'm not surprised that nobody knew about the bug for many years.
The purported bug boils down to this: if you pipe to a non-interactive
shell a command and data for that command, then the non-interactive
shell might read more than just the command as part of its input
buffering and leave less or nothing as data to the command itself.
It is indeed a bug, since the standard says:
When the shell is using standard input and it invokes a command that
also uses standard input, the shell shall ensure that the standard
input file pointer points directly after the command it has read when
the command begins execution.
But I consider this clause is misguided, it should apply only when the
input is a tty. Relying on it is a terrible idea.
On Fri, Jun 21, 2024 at 4:57 AM Greg Wooledge <greg@wooledge.org> wrote:
That's why I find it frustrating when someone claims that this bug is
so severe that Debian has to *change their policy* without even describing how this bug is affecting them in real life.
I did not feel like the OP was saying the bug was that bad and the
policy needed to change, but as a starting point to ask why it is
still the policy after 27 years.
When the shell is using standard input and it invokes a command that
also uses standard input, the shell shall ensure that the standard
input file pointer points directly after the command it has read when
the command begins execution.
But I consider this clause is misguided, it should apply only when the
input is a tty.
Relying on it is a terrible idea.
And if it's not a tty, you get some kind of Undefined Behavior?
I don't think I'd like that because I don't think the benefit would be worth the UB troubles.
When the shell is using standard input and it invokes a command that
. History. It seems to me that the csh history mechanism is
But he changed it soon after: https://www.in-ulm.de/~mascheck/various/ash/#44bsdalpha
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (3 / 13) |
Uptime: | 35:37:17 |
Calls: | 10,392 |
Calls today: | 3 |
Files: | 14,064 |
Messages: | 6,417,151 |