I'm trying to write a sed script that will replace certain control
characters and high order ascii chars with a printable character. I'm using
cygwin on a win2000 machine, from the windows command (cmd.exe) line.
I have a couple of questions:
1. This command line
sed "s/[[:cntrl:]]/X/g" b2.bin
and this command line
sed "s/[\x00-\x19\x7F]/X/g" b2.bin
do not produce the same results. Why is this?
2. The byte size of the output was 12 bytes bigger than b2.bin's original
size of 851, for both expressions. Why is this? I'm replacing a single
character with a single character (I think).
3. What would the correct regular expression/command line be? I want to
replace all characters 0x7F and up with an 'X'.