[Toybox] Endless bash questions...

Rob Landley rob at landley.net
Sat Jun 4 15:08:01 PDT 2022


Why does this work:

$ [[ $(cat) == "a b" ]] <<< "a b" > potato && rm potato && echo yes
yes

But this is an error?

$ [[ $(cat) == "a b" ]] <(echo a b) > potato && rm potato && echo yes
bash: syntax error near unexpected token `<(echo a b)'

It actually seems to exclude <(subcommands) from all trailing blocks?

$ if true; then cat; fi <(echo hello)
bash: syntax error near unexpected token `<(echo hello)'

Maybe it's related to restartability?

$ a() { cat; } <<< potatosalad
$ a
potatosalad
$ a
potatosalad
$ a() { cat; } <(echo hello)
bash: syntax error near unexpected token `<(echo hello)'

Curious,

Rob



More information about the Toybox mailing list