On macOS, because is ;
command delimiter is not supported you could use newline
delimiter instead (extended explanation https://stackoverflow.com/a/79080850/3627387)
$ sed ':aN$!bas/\n/\\n/g' file
On macOS, because is ;
command delimiter is not supported you could use newline
delimiter instead (extended explanation https://stackoverflow.com/a/79080850/3627387)
$ sed ':aN$!bas/\n/\\n/g' file