bash:在进程替换中使用花括号全局化时重定向不明确

bash:在进程替换中使用花括号全局化时重定向不明确,bash,Bash,以下人为的示例起作用: $whileread-r行;不要重复$line;完成

以下人为的示例起作用:

$whileread-r行;不要重复$line;完成<这看起来像是BashV3中的一个bug(或者至少是奇怪之处),但它在v4中得到了修复。现在的情况是大括号扩展(
{package.json,package lock.json}
)正在应用于整个流程替换,而不仅仅是其中的一个参数。下面是一个简化的示例,我将使用它演示正在发生的事情:

$ cat < <(echo {a,b})
-bash: 0: ambiguous redirect

嗯,有趣!感谢您的详细介绍!=)
$ cat <(echo {a,b})    # This works, sort of... each arg winds up on a separate line
a
b
$ echo <(echo {a,b})    # echo shows *two* different process substitutions are being done
/dev/fd/63 /dev/fd/62
$ grep -H . <(echo {a,b})    # This prints where it gets each line, showing it gets one letter/line from each substitution
/dev/fd/63:a
/dev/fd/62:b
$ echo $BASH_VERSION 
4.4.19(1)-release
$ cat < <(echo {a,b})
a b
$ cat <(echo {a,b})
a b
$ echo <(echo {a,b})
/dev/fd/63