How do I replace : characters with newline?

后端 未结 4 1130
野的像风
野的像风 2020-12-22 08:05

I looked at a very similar question but was unable to resolve the issue Replace comma with newline in sed

I am trying to convert : characters in a strin

4条回答
  •  暖寄归人
    2020-12-22 08:24

    echo 'this:is:a:test' | tr : \\n
    

    Any POSIX-compliant tr will support the \n escape sequence. You need to take care to quote or escape the escape sequence, however (double backslash above).

    The -e argument to echo has no effect on your argument to echo.

提交回复
热议问题