4.2. How do I represent control-codes or nonprintable characters?
Several versions of sed support the notation \xHH, where "HH" are
two hex digits, 00-FF: ssed, GNU sed v3.02.80 and above, GNU sed
v1.03, sed16 and sed15 (HHsed). Try to use one of those versions.
Sed is not intended to process binary or object code, and files
which contain nulls (0x00) will usually generate errors in most
versions of sed. The latest versions of GNU sed and ssed are an
exception; they permit nulls in the input files and also in
regexes.
On Unix platforms, the 'echo' command may allow insertion of octal
or hex values, e.g., `echo "\0nnn"` or `echo -n "\0nnn"`. The echo
command may also support syntax like '\\b' or '\\t' for backspace
or tab characters. Check the man pages to see what syntax your
version of echo supports. Some versions support the following:
# replace 0x1A (32 octal) with ASCII letters
sed 's/'`echo "\032"`'/Ctrl-Z/g'
# note the 3 backslashes in the command below
sed "s/.`echo \\\b`//g"