Use sed to replace all backslashes with forward slashes

后端 未结 9 989
伪装坚强ぢ
伪装坚强ぢ 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条回答
  •  盖世英雄少女心
    2020-11-27 04:40

    I had to use [\\] or [/] to be able to make this work, FYI.

    awk '!/[\\]/' file > temp && mv temp file

    and

    awk '!/[/]/' file > temp && mv temp file

    I was using awk to remove backlashes and forward slashes from a list.

提交回复
热议问题