sed not giving me correct substitute operation for newline with Mac – differences between GNU sed and BSD / OSX sed [duplicate]
With BSD/macOS sed, to use a newline in the replacement string of an s function call, you must use an \-escaped actual newline – escape sequence \n is not supported there (unlike in the regex part of the call). Either: simply insert an actual newline: sed -i ” ‘s/\\n/\ /g’ test1.txt Or: use an ANSI … Read more