bash - Double quotes and variables in Sed - Unknown expression? -


right, in bash script have following line:

sed -i 's/$/,"123456","789101112","0001",'"$thedate"',"ddx"/' /tmp/tmp02.csv 

however, whenever run error

sed: -e expression #1, char 42: unknown option `s' 

i think it's variable bit, it won't seem escape double quotes.. appreciated!

i think have slashes in thedate, being confused regex delimiters sed. try changing substitution delimiter, example !:

sed -i 's!$!,"123456","789101112","0001",'"$thedate"',"ddx"!' /tmp/tmp02.csv 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -