How to remove \r character with sed

后端 未结 2 893
轻奢々
轻奢々 2021-01-18 05:05

Very simply I have a file that has \\r\\n at every line break.

aaaa\\r\\nbbbb\\r\\ncccc

I would like to remove the \\r character while leav

2条回答
  •  無奈伤痛
    2021-01-18 05:53

    In case you are using the terminal on a mac, use this instead to be able to recognize \r

    sed "s/$(printf '\r')\$//" orig.txt > modified.txt

提交回复
热议问题