User Tools

Site Tools


sed_notes

This is an old revision of the document!


backup with timestamp

sed "-i_asof_`date +%Y%m%d_%M%S`" -e 's/foo/bar/g' main.txt

will backup to something like main.txt_asof_20210128_2231

replace double quote with single quote

sed "s/\"/'/g"

Ref:- https://stackoverflow.com/questions/16154007/replace-all-double-quotes-with-single-quotes

Sample run:

% sed "s/\"/'/g"
a
a
"
'
'
'
sed_notes.1611861775.txt.gz · Last modified: 2021/01/28 19:22 by raju