Replace text using sed

后端 未结 3 533
再見小時候
再見小時候 2021-01-24 17:43

i am having trouble replacing the modified date in my script via sed.

I am getting the last modified date like this:

olddate=`grep -m1 \"Built \" script.         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-24 18:27

    You can use separators other than slashes, for instance ";"

    sed -i "" "s;$olddate;$newdate;g" script.sh
    

提交回复
热议问题