Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16041

process substitution bug or difference from bash 4.4

From Valentin Lab <valentin.lab@kalysto.org>
Newsgroups gnu.bash.bug
Subject process substitution bug or difference from bash 4.4
Date 2020-03-25 15:35 +0100
Message-ID <mailman.394.1585148422.3020.bug-bash@gnu.org> (permalink)
References <ab981b9c-60a5-46d0-b7e6-a6d88b80df50@kalysto.org>

Show all headers | View raw


Hi,

I have encountered an issue when running some bash code from 4.4 on a 
bash 5 ... I've managed to pinpoint the exact issue on my end.

Here are 2 functions that are quite similar, except the usage of "{ ; }" 
around the "cat":

## ----------------
ouch() {
     cat < <(echo bar)
     cat "$1"
}

ouch2() {
     { cat; } < <(echo bar)
     cat "$1"
}
##----------------


Runnning this will give the same output on bash 4.4 and 5:


$ ouch <(echo "foo")
foo
bar


And by replacing "ouch" by "ouch2", I have the same output in bash 4.4 .

But running it on bash 5 will fail:

$ ouch2 <(echo "foo")
bar
cat: /dev/fd/63: No such file or directory


Is that expected ? I'd be happy to know about the rationale behind this 
(and the change) if this is expected.

Many thanks,

Valentin Lab

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

process substitution bug or difference from bash 4.4 Valentin Lab <valentin.lab@kalysto.org> - 2020-03-25 15:35 +0100

csiph-web