Aaron,
I had the same results as you did. I am also at V5R3. We installed a
cume back in June that I believe put us up to date in regards to PTF's.
I tried:
sed 's/i/\\n/g' /home/grizzly/file1.txt > /home/grizzly/file2.txt
and the results were as follows:
Th\ns \ns a test to see \nf a new l\nne w\nll be created for each t\nme
the letter \n \ns found.
This replaced i with \n but it doesn't seem to insert a new line.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Aaron Bartell
Sent: Monday, November 19, 2007 3:09 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: Using sed to replace all instances with a hex value
I think I may have not relayed my problem well enough. My problem is
that
the new line (i.e. \n) isn't working - or any excaped character for that
matter.
For example, given the following content in /home/aaron/file1.txt:
-----------------------------------------------
This is a test to see if a new line will be created for each time the
letter
i is found.
-----------------------------------------------
Now I run the following sed statement:
sed 's/i/\n/g' /home/aaron/file1.txt > /home/aaron/file2.txt
file2.txt now contains:
-----------------------------------------------
Thns ns a test to see nf a new lnne wnll be created for each tnme the
letter
n ns found.
-----------------------------------------------
Note how it simply replaced all letter 'i' instances with 'n' instead of
creating a new line like it should have. Can somebody else run the same
on
their system to see if I may need to load some PTF's? Note that I
looked
for PTF's at Fix Central, but found none for sed.
I am at V5R3.
Thanks,
Aaron Bartell
http://mowyourlawn.com
As an Amazon Associate we earn from qualifying purchases.