是的,所以在Bash脚本中我有以下几行:
sed -i 's/$/,"123456","789101112","0001",'"$THEDATE"',"DDX"/' /tmp/tmp02.csv
但是,每当我运行它时,我总是会收到错误
sed: -e expression #1, char 42: unknown option to `s'
我认为这是变量位,但是我这样做它似乎不会逃脱双引号..任何帮助都非常感谢!
答案 0 :(得分:4)
我认为你在THEDATE
中有斜线,它被sed混淆为正则表达式分隔符。尝试更改替换分隔符,例如使用!
:
sed -i 's!$!,"123456","789101112","0001",'"$THEDATE"',"DDX"!' /tmp/tmp02.csv