Use sed to replace all backslashes with forward slashes

后端 未结 9 990
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 04:09

I want to be able to use sed to take an input such as:

C:\\Windows\\Folder\\File.txt

to

C:/Windows/Folder/File.txt
<         


        
9条回答
  •  猫巷女王i
    2020-11-27 04:54

    Just use:

    sed 's.\\./.g'
    

    There's no reason to use / as the separator in sed. But if you really wanted to:

    sed 's/\\/\//g'
    

提交回复
热议问题