public inbox for dash@vger.kernel.org
 help / color / mirror / Atom feed
* stdin should be consumed line by line
@ 2021-10-22 11:11 Tycho Kirchner
  2024-06-30  5:11 ` Max Nikulin
  0 siblings, 1 reply; 2+ messages in thread
From: Tycho Kirchner @ 2021-10-22 11:11 UTC (permalink / raw)
  To: dash

Dear DASH developers,
I think stdin should be consumed line by line in order to make passing 
to other commands possible. Please consider the following difference 
between the stdin "consumption" between bash and dash

$ stdintest(){ printf 'echo one\ndash -c "while read -r row; do echo got 
row \$row; done" \necho two\n'; }
$ stdintest | dash
one
two
$ stdintest | bash
one
got row echo two
$


I think bash behaves "correct" here.

Thanks and kind regards
Tycho Kirchner

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: stdin should be consumed line by line
  2021-10-22 11:11 stdin should be consumed line by line Tycho Kirchner
@ 2024-06-30  5:11 ` Max Nikulin
  0 siblings, 0 replies; 2+ messages in thread
From: Max Nikulin @ 2024-06-30  5:11 UTC (permalink / raw)
  To: dash

On 22/10/2021 18:11, Tycho Kirchner wrote:
> I think stdin should be consumed line by line in order to make passing 
> to other commands possible. Please consider the following difference 
> between the stdin "consumption" between bash and dash
> 
> $ stdintest(){ printf 'echo one\ndash -c "while read -r row; do echo got 
> row \$row; done" \necho two\n'; }
> $ stdintest | dash
> one
> two
> $ stdintest | bash
> one
> got row echo two
> $
> 
> I think bash behaves "correct" here.

When I noticed the issue, I found this message with no response, but not 
other threads. I believe, the following links may be useful for those 
who will get this report in search engine results. It is a bug in dash 
and latest released version does not contains its fix.

<https://lore.kernel.org/dash/20221213221732.6mvv22u7ktdozrbx@tarta.nabijaczleweli.xyz/t/>
[PATCH] input: preadfd: read standard input byte-wise
Tue, 13 Dec 2022 23:17:32 +0100

<https://lore.kernel.org/dash/cover.1717291846.git.herbert@gondor.apana.org.au/t/#u>
[v3 PATCH 0/3] Improve performance when reading stdin.
Sun, 02 Jun 2024 09:31:30 +0800

<https://bugs.debian.org/862907>
dash: Incorrectly slurps script from stdin (POSIX compliance issue)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-30  5:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-22 11:11 stdin should be consumed line by line Tycho Kirchner
2024-06-30  5:11 ` Max Nikulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox