On Sun, May 12, 2024 at 03:55:21AM +0200, Quốc Trị Đỗ wrote:
> I found a bug when i tried with syntax <(cmd). this is an example
> cat <(wc -l) < bk
What is "wc -l" supposed to read from? It counts lines of standard input,
until EOF is reached. But its standard input is a terminal. And you're
running it as a background process.
I would *expect* this command to fail with an error message of some
kind, because a background process shouldn't be allowed to read
input from a terminal.
> How to fix it? It doesn't last that long. After a while, it will show "wc:
> stdin: read: Input/output error". Or we can ctrl C.
Sounds appropriate.
What's the "bug in bash" supposed to be? What did you think this command
would do?