2025年6月4日(水) 0:57 Koichi Murase <myoga.mur...@gmail.com>:
> [...]. If it was
> implemented after Ref. [1], « '<(echo hello)' () { echo hello; } »
> should have been supported but not « <(echo hello) () { echo hello;
> }.».

I realized that « '<(echo hello)' () { ...; } » is actually supported
in Bash 5.3, but the behavior is not what was expected by Ref. [1]
(and it's not what I expect either). It creates a function named «
'<(echo hello)' » instead of a function named « <(echo hello) ».

  $ bash-devel -c $'\'<(echo hello)\' () { echo yes; }; "<(echo hello)"'
  bash-devel: line 1: <(echo hello): command not found
  $ bash-devel -c $'\'<(echo hello)\' () { echo yes; }; "\'<(echo hello)\'"'
  yes

I expect « '<(echo hello)' () { ...; } » creates a function named «
<(echo hello) ».

>   $ bash-devel -c '<(echo hello) () { echo hello; }; declare -F'
>  declare -f <(echo hello)

By the way, I think the output of `declare -F' should be quoted when
necessary because the argument of `declare' is a normal context where
shell expansions happen.

--
Koichi

Reply via email to