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

Reply via email to