Replace comma with newline in sed on MacOS?

后端 未结 13 2026
借酒劲吻你
借酒劲吻你 2020-11-27 09:27

I have a file of id\'s that are comma separated. I\'m trying to replace the commas with a new line. I\'ve tried:

sed \'s/,/\\n/g\' file

b

13条回答
  •  一生所求
    2020-11-27 10:24

    $ echo $PATH | sed -e $'s/:/\\\n/g' 
    /usr/local/sbin
    /Library/Oracle/instantclient_11_2/sdk
    /usr/local/bin
    

    ...

    Works for me on Mojave

提交回复
热议问题