Find and replace in file and overwrite file doesn't work, it empties the file

后端 未结 13 2363
深忆病人
深忆病人 2020-11-22 08:45

I would like to run a find and replace on an HTML file through the command line.

My command looks something like this:

sed -e s/STRING_TO_REPLACE/STR         


        
13条回答
  •  甜味超标
    2020-11-22 09:27

    use sed's -i option, e.g.

    sed -i bak -e s/STRING_TO_REPLACE/REPLACE_WITH/g index.html
    

提交回复
热议问题