How do I use a new-line replacement in a BSD sed?

后端 未结 4 973
栀梦
栀梦 2020-11-29 07:20

Greetings, how do I perform the following in BSD sed?

sed \'s/ /\\n/g\'

From the man-page it states that \\n will be treated literally with

4条回答
  •  生来不讨喜
    2020-11-29 08:12

    In a shell, you can do:

        sed 's/ /\
    /g'
    

    hitting the enter key after the backslash to insert a newline.

提交回复
热议问题