replacing nulls in a file with sed.

Monty Mullig monty at delphi.uchicago.edu
Wed Jul 25 08:48:11 AEST 1990


sorry to ask what i'm sure is a simple question, but i can't find
this information in the documentation and experimentation has led
nowhere.

i have a file that comes with null characters randomly placed in it.
i'd like to replace those nulls with spaces, but i can't seem to get
sed to do this.  the command:

sed 's/\(^@\)/ /g' < infile > outfile

removes the nulls, but doesn't replace them with spaces.
in emacs, the null characters show up as ^@ characters and
global search and replace works (using the control-q to enter
^@ as a true control character, rather than a carat and an
at sign).

thanks in advance,

--monty mullig
  university of chicago
  biological sciences division
  monty at delphi.bsd.uchicago.edu
  312 702-9130



More information about the Comp.unix.wizards mailing list