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

前端 未结 1 905
挽巷
挽巷 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</></g'
    

    Output:

    this\n is ><
    
    0 讨论(0)
提交回复
热议问题