sed -i 's/$/'/g'
sed -i "s/$/'/g"
How to escape both $
and '
by 1 command?
sed -i 's/$/'/g'
sed -i "s/$/'/g"
How to escape both $
and '
by 1 command?
This might work for you (GNU sed):
sed 's/$/'''/' file
Adds a single quote to the end of a line.
sed 's/$/'''/' file
Replaces a $
by a single quote.
sed 's/$$/'''/' file
Replaces a $
at the end of line by a single quote.
N.B. Surrounding sed commands by double quotes is fine for some interpolation but may return unexpected results.