[plug] [PLUG] sed will not

Navarre navarre at omen.net.au
Wed Oct 28 23:28:42 WST 1998


Hello All

I wished to perform a simple operation using sed to search for the
string

GAWK(1)^I

as the output of cat -A gawk.txt will show.

What I wished to do was, search for the string GAWK(1) and the following
tab and replace it with a form feed character, the string Gawk(1) and
the tab character. 
I tried using sed 's/GAWK(1)\11/\14Gawk(1)\11/' gawk.txt
This did not match any lines in the file.

As a work around I tried 
sed 's/^GAWK(1)/ZGawk(1)/' gawk.txt > temp

Using grep I did not find any 'Z' characters in the original file, so
now the place were I wanted my form feed characters has a 'Z'. I then
used tr to replace the 'Z' with the formfeed and problem solved. The
syntax is.

tr 'Z' '\14' < temp > temp1

Is there an easier way to perform this magic in one step??

Also is there a form of hex dump program like the ones found in the
CP/M  world.

-- 

- Regards Navarre -
<navarre at omen.com.au>
---------------------



More information about the plug mailing list