Hello,
I am trying to port over some code from Linux (ubuntu 7.4) to Solaris 9 and 10. One of the commands uses \r and \n to work but the command isn't working as expected from Linux.
Linux Code (What I expect to happen):
$cat file.txt
abc def ghi
jkl
mno
pqr
$cat file.txt | sed 's# #\n#g'
abc
def
ghi
jkl
mno
pqr
$cat file.txt | sed 's#\n# #g'
abc def ghi jkl mno pqr
Solaris 9 and 10 (What happens)
$cat file.txt
abc def ghi
jkl
mno
pqr
$cat file.txt | sed 's# #\n#g'
abcndefnghi
jkl
mno
pqr
$cat file.txt | sed 's#\n# #g'
abc def ghi jkl mno pqr
So, it's recognizing that \ is an escape character but it's not substituting in the NEWLINE character.
What am I doing wrong?
How could I implement this correctly?
Thank you very much for your help,
BRISKbaby