Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对,所以在 Bash 脚本中,我有以下行:
sed -i 's/$/,"123456","789101112","0001",'"$THEDATE"',"DDX"/' /tmp/tmp02.csv
但是,每当我运行它时,我总是会收到错误
sed: -e expression #1, char 42: unknown option to `s'
我认为这是变量位,但是无论我这样做,它似乎都不会逃脱双引号..任何帮助都非常感谢!
我认为你有斜线THEDATE,它们被 sed 混淆为正则表达式分隔符。尝试更改替换分隔符,例如!:
THEDATE
!
sed -i 's!$!,"123456","789101112","0001",'"$THEDATE"',"DDX"!' /tmp/tmp02.csv