sed: 1: “…”: Invalid command code f

后端 未结 1 804
北恋
北恋 2020-12-28 13:56
grep -l \\\'texttofind\\\' * | xargs sed -i \'s/toreplace/replacewith/g\'

Im getting this error when I run the above command in the terminal.

相关标签:
1条回答
  • 2020-12-28 14:06

    I figured out what was wrong. I needed to add '' after the -i and before the 's/../../':

    grep -l \'texttofind\' * | xargs sed -i '' 's/toreplace/replacewith/g'
    
    0 讨论(0)
提交回复
热议问题