sed command with -i option failing on Mac, but works on Linux

前端 未结 12 2097
情歌与酒
情歌与酒 2020-11-22 05:04

I\'ve successfully used the following sed command to search/replace text in Linux:

sed -i \'s/old_link/new_link/g\' *

However,

12条回答
  •  长发绾君心
    2020-11-22 06:07

    Had the same problem in Mac and solved it with brew:

    brew install gnu-sed
    

    and use as

    gsed SED_COMMAND
    

    you can set as well set sed as alias to gsed (if you want):

    alias sed=gsed
    

提交回复
热议问题