Search and replace with sed when dots and underscores are present

前端 未结 5 1074
-上瘾入骨i
-上瘾入骨i 2020-12-03 04:51

How do I replace foo. with foo_ with sed simply running

sed \'s/foo./foo_/g\' file.php

doesn\'t work. Thanks!

5条回答
  •  囚心锁ツ
    2020-12-03 04:55

    For myself, sed 's/foo\./foo_/g' is working. But you can also try:

    sed -e 's/foo\./foo_/g'
    

    and

    sed -e "s/foo\\./foo_/g"
    

    and

    sed 's/foo[.]/foo_/g'
    

提交回复
热议问题