Source Code For Hexsed

First you must download the source tarball.

Download Current Version

Copy or move the tarball to a directory of your choosing then:

tar -xzf hexsed-1.0.tar.gz
cd hexsed-1.0/
./configure
make
sudo make install
make clean

The program operates on strings of bytes in a file and writes to stdout. Every byte in the string must be specified using 2 hex characters, 00, 0A, FF etc.

There are only 2 commands, s - substitute and d - delete. The only legal separator is '/'.

The program operates on all lines in the source file and no line number specification is possible.

The program also provides options to generate the hex values of various other representations as follows:

  • -a any single ASCII character
  • -e \c where c is any normal escape char
  • -i decimal value in range 0-255
  • -o octal value in range 0-377

Examples

hexsed /E280A80A/0A/s tmpfil > x # remove <U+2028> before the line end.

mv x tmpfil # copy output back to source.

hexsed /E280A8/20/s tmpfil > x # replace <U+2028> with a space.

mv x tmpfil

Home

Home page

Free Software

Software index

Go to the top of the page