【发布时间】:2020-12-01 06:10:24
【问题描述】:
在子 shell 中生成的新值的赋值确实可以在没有尾随注释的情况下工作:
newname=$(echo "$newname" | sed 's@TD.'"$oldnewTD"'@TD.r'"$ftd1"'@')
但如果添加尾随注释,变量newname 保持不变:
newname=$(echo "$newname" | sed 's@TD.'"$oldnewTD"'@TD.r'"$ftd1"'@')# let us not change NonEqRead to NonEq
为什么?
Bash 版本 5.0.3。
【问题讨论】:
标签: bash comments variable-assignment syntax-highlighting silent