How to replace just one newline between > and < in unix

前端 未结 1 923
挽巷
挽巷 2021-01-29 09:10

Lets say i have a text:

\"this\\n is >\\n<\"

and i want to replace the newline with none which will result in:

\"this\\n          


        
1条回答
  •  梦如初夏
    2021-01-29 10:06

    Escape \ with \:

    echo "this\n is >\n<" | sed -e 's/>\\n

    Output:

    this\n is ><
    

    0 讨论(0)
提交回复
热议问题