How to substitute dates in Perl?

前端 未结 3 1079
甜味超标
甜味超标 2021-01-21 19:12
perl -pi.back -e \'s/2013/07/31-05:54:14/2014/07/31-00:00:00/g;\' /tmp/ranjan/replace.SEL

I\'m using the above one liner to replace the date from

3条回答
  •  旧时难觅i
    2021-01-21 19:24

    Use an alternative delimiter:

    s{find}{replace}g;
    

    or

    s#find#replace#g;
    

    Otherwise you'd have to escape all the /.

提交回复
热议问题