I want the sed equivalent of this line of vim::s/,/,^M/gThe goal: Take a line that contains a massive json block, and break it up into individual lines.An example of what I want to work with ishttp://www.cartoonnetwork.com/video/teen-titans-go/episodes/index.html (look for function getFullEpisodes()).What I tried:519  sed -e 's/,/,\n/g' < /tmp/url > /tmp/line-url-- did not work, just put n at the proper place.521  sed -e 's/,/,\\n/g' < /tmp/url > /tmp/line-url-- did not work, put a backslash followed by n at the proper place.The full script of vim commands that I want to turn into a shell script::s/,/,^M/g:1,$!grep seo:g,^.*/vid,s,,http://www.cartoonnetwork.com/vid:g/},{.*/s///:$s,}];,,:wn
I want to use sed to insert newlines (one line turns into hundreds)
sed;newlines
It seems your version of sed does not understand \n on the RHS of s///.You could always do this on a bash command line:sed -e 's/,/,\/g' < /tmp/url > /tmp/line-urlOn a csh command line, you would need to double the backslashes. Note that the trailing backslashes should not be followed by anything other than a hard newline.