hex(1) hexadecimal dump tool (with Japanese support)

SYNOPSIS

hex [ options... ] [ file ]
hex -r [ file ]

DESCRIPTION

hex will show the contents of file (or standard input) in hexadecimal and/or character. At this time, this will show in Japanese text as if it seems to be.

OPTIONS

You can specify option in environment variable HEX_OPTIONS

OPTIONS - how to show `non printable character'

see EXAMPLE below

`Non printable character' here is that control codes and/or codes that is 8bits and out of range of kanji or kana character codes.

-c, --color (default if output is tty)
show `non printable character' with colors. Terminal with color support, such as kterm , MS-DOS Prompt in Windows95 and so on) show all of J with color by EXAMPLE options.

Blue and light bule is used by default, using escape sequence such as ^[[34m These colors can be changed by -cs1, -cs2 option described below.

-b, --bold
show `non printable character' in bold. EXAMPLE will show all J in bold. It will be showen in bold even if you see via less

When output is tty, escape sequence ^[[1m is used, and otherwise (such pipe), it will output like A^HA for bold A.

This program does not refer termcap/terminfo , so some terminal can not show in bold. In Windows95, it looks brighter.

-d, --dot (default if output is not tty)
show `non printable character' as `.' as if `J' substituted in `.' in EXAMPLE case.
-t, --text
show `non printable character' in normal text. Same as EXAMPLE No use.
-u, --underline
show `non printable character' with underline. In EXAMPLE case, all J has underline. You can see with underline even if you see via less or more

When output to tty, escape sequence ^[[4m is used, otherwise (such as pipe), it will output like _^HA for A with underline. You can't see underline in Windows95.

EXAMPLE
0x00000000: a4 cf a4 e8 a4 f3 0a 0a - 0a 0a 0a 0a 0a 0a 0a 0a HAYONNJJJJJJJJJJ
(actually, "HAYONN" shows in Hiragana characters).

OPTION - output code

To check what is specified by default, hex -h
-e, -oe, --oeuc
output using *euc-japan*
-s, -os, --osjis
output using *sjis*
-j, -oj, --ojis
output using *iso-2022-jp*

OPTION - input code

To check what is specified by default, hex -h
-E, -ie, --ieuc
Assume *euc-japan* or *iso-2022-jp* for input.
-S, -is, --isjis
Assume *sjis* or *iso-2022-jp* for input
-U, -iu, --iunknown
Assume unknown input code. Japanese handling won't be done by this option.

OPTION - other

-cs1 cs, --colorstring1 cs
specify code 1 of color. This color is used for control codes and/or codes that is 8bits and out of range of kanji or kana character codes.

For example, if you specified -cs1 43;31 (`;' will be handled by shell, so you should escape it as -cs1 '43;31' ), output red character with yellow background.

-cs2 cs, --colorstring2 cs
specify code 2 for color. This color is used for half of kanji character, part of EUC halfwidth kana and/or escape sequence of iso-2022.
-dsiso, --disablesiso, +siso
Usually, character between ^N/^O is treated as halfwidth kana, but disabled with this option.
-siso, --enablesiso
Oppose to above (default)
-r, --restore
% hex < hoe | hex -r > hoge
is same as
% cat < hoe > hoge
-h, --help
show usage.

PAGER

If you use pager such as less for output of hex, you can't see color however, you can see color by doing like the followings:
% hex -c `which hex` | less -r
% hex -c `which hex` | lv -C
If you use command prompt on WindowsNT, try
% hex -u `which hex` | less
less will show with colors for underline, so it looks like with color option. (disabled hex color option)

COPYRIGHT

Copyright (C) 1996-1998, TAGA Nayuta <[email protected]>

This program is free software.

THERE IS NO WARRANTY FOR THE PROGRAM.

The latest version can be found at http://www.is.s.u-tokyo.ac.jp/~nayuta/

AUTHOR

TAGA Nayuta ([email protected])

This manual page was translated by Fumitoshi UKAI <[email protected]>, for the Debian GNU/Linux system (but may be used by others).

BUGS

This program doesn't refer termcap/terminfo so some terminal can't show bold.

No autodetection of Japanese encodings.

Wrong efficiency for output. (color sequence with each characters. For *iso-2022-jp* output, ^[(J for each characters.)

Space of halfwidth kana ( 0x8e 0xa0 in *euc-japan* , 0xa0 in *sjis* , 0x20 in *iso-2022-jp* ) will output as normal space character ( 0x20 )

You can't see color in some part on Windows95. (bug of Windows95 ?)

No support supplimental characters in *iso-2022-jp*.