How to replace a path with another path in sed?

前端 未结 7 1640
广开言路
广开言路 2020-12-01 07:30

I have a csh script (although I can change languages if it has any relevance) where I have to:

sed s/AAA/BBB/ file

The problem is that AAA

7条回答
  •  一个人的身影
    2020-12-01 07:59

    In my case the below method works.

    sed -i 's/playstation/PS4/' input.txt
    

    Can be also be written as

    sed -i 's+playstation+PS4+' input.txt
    
    • sed : is stream editor

    • -i : Allows to edit the source file

    • +: Is delimiter.

    I hope the above information works for you

提交回复
热议问题