bash-3.2$ echo astr | sed 'hah' | sed 's/s/z/'
sed: 1: "hah": extra characters at the end of h command
bash-3.2$ echo ${PIPESTATUS[*]}
0 1 0
bash-3.2$ echo astr | sed 'hah' | sed 's/s/z/'
sed: 1: "hah": extra characters at the end of h command
bash-3.2$ PIPERET=("${PIPESTATUS[*]}")
bash-3.2$ echo ${PIPERET[*]}
0 1 0
bash-3.2$
这表明
[*]
运作良好。但是这个教程提到应该使用[@]
。这两种方式都是有效的吗?