HXASCDMP(1)

NAME
hxascdmp - hexadecimal ASCII dump

SYNOPSIS
hxascdmp [-b=BPL] [-h] [-H] [-N] [-o=OFF] [-V] [FILE+]

DESCRIPTION

This utility reads one or more FILE names and dumps them in hexadecimal and ASCII to stdout. If no FILE is given then stdin is read instead; reading continues (or stalls) until an EOF is received.

The default format is to start each line with the hexadecimal address (offset from the start of file) followed by 16 hexadecimal bytes separated by a single space (apart from the 8th and 9th bytes which are separated by two spaces). If the -H is not given, there is then a string of 16 ASCII characters corresponding to the hexadecimal bytes earlier in the line; only bytes in the range 0x20 to 0x7e are printed in ASCII, other bytes values are printed as '.' . If the -H is not given, each FILE name that appears on the command line is printed on a separate line prior to that file's hexadecimal ASCII dump.

If the -N option is given then no address is printed out and each line starts with the next hexadecimal byte.

This utility is pretty close to the 'hexdump -C' variant of BSD's hexdump(1) command.

OPTIONS

-b=BPL
    where BPL specifies the number of bytes per line. The default value is 16. 16 bytes per line is just enough to allow the address, 16 bytes in hexadecimal followed by 16 bytes as ASCII to fit on a standard 80 column wide terminal.

-h  output the usage message then exit.

-H  output hexadecimal only (i.e. don't place an ASCII representation at the end of each line).

-N  no address; so each line starts with the next hexadecimal byte.

-o=OFF
    where OFF specifies the byte offset from the beginning of the pipe or the beginning of each file that the output starts. If the address is being printed out then it starts at OFF. The default is an OFF of 0 .

-V, --version
    print the version string and then exit.

NOTES
In Windows the given file (or files) are set to binary mode.

EXIT STATUS
The exit status of hxascdmp is 0 when it is successful. If any of the given FILE names cannot be opened then the exit status is 1.

EXAMPLES
First we manufacture a short file with a mix of data in it: mostly ASCII with some control characters and 0xaa (which the echo command only accepts in octal (0252):

   $ echo -e "three blind mice, 252" > 3bm.txt

Now we use this utility to see exactly what is in the file. To avoid problems with line wrapping, the bytes per line option is set to 8:

   $ hxascdmp -b=8 3bm.txt
ASCII hex dump of file: 3bm.txt
 00 74 68 72 65 65 20 62 6c three bl
 08 69 6e 64 20 6d 69 63 65 ind mice
 10 2c 09 0d aa 0a ,....

Using the same file, use this utility to output only hexadecimal formatted 16 bytes per line.

   $ hxascdmp -H 3bm.txt
hex dump of file: 3bm.txt
 00 74 68 72 65 65 20 62 6c 69 6e 64 20 6d 69 63 65
 10 2c 09 0d aa 0a

For comparison the hexdump utility gives similar output:

   $ hexdump -C 3bm.txt
00000000 74 68 72 65 65 20 62 6c 69 6e 64 20 6d 69 63 65 |three blind mice|
00000010 2c 09 0d aa 0a |,....|
00000015

AUTHORS
Written by Douglas Gilbert.

REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>.

COPYRIGHT
Copyright © 2004-2019 Douglas Gilbert
This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO
hexdump(1)