How do I insert a newline in the replacement part of sed?
This code isn\'t working:
sed \"s/\\(1234\\)/\\n\\1/g\" input.txt > output.txt >
sed \"s/\\(1234\\)/\\n\\1/g\" input.txt > output.txt
Try this:
$ echo test1234foo123bar1234 | sed "s/\(1234\)/\n\1/g" test 1234foo123bar 1234
From Sed Gnu doc
g Apply the replacement to all matches to the regexp, not just the first.