BSD 4_3_Net_2 release
[unix-history] / usr / src / usr.bin / hexdump / hexdump.1
index 32da2a3..c7ad06e 100644 (file)
@@ -1,13 +1,37 @@
 .\" Copyright (c) 1989, 1990 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" Copyright (c) 1989, 1990 The Regents of the University of California.
 .\" All rights reserved.
 .\"
-.\" %sccs.include.redist.man%
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.\"     @(#)hexdump.1  5.11 (Berkeley) %G%
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
 .\"
 .\"
-.Vx
-.Vx
-.Dd 
+.\"    @(#)hexdump.1   5.12 (Berkeley) 7/27/91
+.\"
+.Dd July 27, 1991
 .Dt HEXDUMP 1
 .Os
 .Sh NAME
 .Dt HEXDUMP 1
 .Os
 .Sh NAME
@@ -19,7 +43,9 @@
 .Op Fl e Ar format_string
 .Op Fl f Ar format_file
 .Op Fl n Ar length
 .Op Fl e Ar format_string
 .Op Fl f Ar format_file
 .Op Fl n Ar length
+.Bk -words
 .Op Fl s Ar skip
 .Op Fl s Ar skip
+.Ek
 .Ar file  ...
 .Sh DESCRIPTION
 The hexdump utility is a filter which displays the specified files, or
 .Ar file  ...
 .Sh DESCRIPTION
 The hexdump utility is a filter which displays the specified files, or
@@ -27,51 +53,39 @@ the standard input, if no files are specified, in a user specified
 format.
 .Pp
 The options are as follows:
 format.
 .Pp
 The options are as follows:
-.Tw Fl
-.Tp Fl b
+.Bl -tag -width Fl
+.It Fl b
 .Em One-byte octal display .
 Display the input offset in hexadecimal, followed by sixteen
 space-separated, three column, zero-filled, bytes of input data,
 in octal, per line.
 .Em One-byte octal display .
 Display the input offset in hexadecimal, followed by sixteen
 space-separated, three column, zero-filled, bytes of input data,
 in octal, per line.
-.Tp Fl c
+.It Fl c
 .Em One-byte character display .
 Display the input offset in hexadecimal, followed by sixteen
 space-separated, three column, space-filled, characters of input
 data per line.
 .Em One-byte character display .
 Display the input offset in hexadecimal, followed by sixteen
 space-separated, three column, space-filled, characters of input
 data per line.
-.Tp Fl d
+.It Fl d
 .Em Two-byte decimal display.
 Display the input offset in hexadecimal, followed by eight
 space-separated, five column, zero-filled, two-byte units
 of input data, in unsigned decimal, per line.
 .Em Two-byte decimal display.
 Display the input offset in hexadecimal, followed by eight
 space-separated, five column, zero-filled, two-byte units
 of input data, in unsigned decimal, per line.
-.Tc Fl e
-.Ws
-.Ar format_string
-.Cx
+.It Fl e Ar format_string 
 Specify a format string to be used for displaying data.
 Specify a format string to be used for displaying data.
-.Tc Fl f
-.Ws
-.Ar format_file
-.Cx
+.It Fl f Ar format_file 
 Specify a file that contains one or more newline separated format strings.
 Empty lines and lines whose first non-blank character is a hash mark
 Specify a file that contains one or more newline separated format strings.
 Empty lines and lines whose first non-blank character is a hash mark
-.Pf \&( Cm \&# )
+.Pf ( Cm \&# )
 are ignored.
 are ignored.
-.Tc Fl n
-.Ws
-.Ar length
-.Cx
+.It Fl n Ar length 
 Interpret only
 .Ar length
 bytes of input.
 Interpret only
 .Ar length
 bytes of input.
-.Tp Fl o
+.It Fl o
 .Em Two-byte octal display.
 Display the input offset in hexadecimal, followed by eight
 space-separated, six column, zero-filled, two byte quantities of
 input data, in octal, per line.
 .Em Two-byte octal display.
 Display the input offset in hexadecimal, followed by eight
 space-separated, six column, zero-filled, two byte quantities of
 input data, in octal, per line.
-.Tc Fl s
-.Ws
-.Ar offset
-.Cx
+.It Fl s Ar offset 
 Skip
 .Ar offset
 bytes from the beginning of the input.
 Skip
 .Ar offset
 bytes from the beginning of the input.
@@ -101,7 +115,7 @@ causes it to be interpreted as a multiple of
 or
 .Li 1048576 ,
 respectively.
 or
 .Li 1048576 ,
 respectively.
-.Tp Fl v
+.It Fl v
 The
 .Fl v
 option causes hexdump to display all input data.
 The
 .Fl v
 option causes hexdump to display all input data.
@@ -111,12 +125,12 @@ option, any number of groups of output lines, which would be
 identical to the immediately preceding group of output lines (except
 for the input offsets), are replaced with a line comprised of a
 single asterisk.
 identical to the immediately preceding group of output lines (except
 for the input offsets), are replaced with a line comprised of a
 single asterisk.
-.Tp Fl x
+.It Fl x
 .Em Two-byte hexadecimal display.
 Display the input offset in hexadecimal, followed by eight, space
 separated, four column, zero-filled, two-byte quantities of input
 data, in hexadecimal, per line.
 .Em Two-byte hexadecimal display.
 Display the input offset in hexadecimal, followed by eight, space
 separated, four column, zero-filled, two-byte quantities of input
 data, in hexadecimal, per line.
-.Tp
+.El
 .Pp
 For each input file,
 .Nm hexdump
 .Pp
 For each input file,
 .Nm hexdump
@@ -151,42 +165,39 @@ It is interpreted as a fprintf-style format string (see
 .Xr fprintf 3 ) ,
 with the
 following exceptions:
 .Xr fprintf 3 ) ,
 with the
 following exceptions:
-.Df I
-.Bu
+.Bl -bullet -offset indent
+.It
 An asterisk (*) may not be used as a field width or precision.
 An asterisk (*) may not be used as a field width or precision.
-.Bu
+.It
 A byte count or field precision
 .Em is
 required for each ``s'' conversion
 character (unlike the
 .Xr fprintf 3
 default which prints the entire string if the precision is unspecified).
 A byte count or field precision
 .Em is
 required for each ``s'' conversion
 character (unlike the
 .Xr fprintf 3
 default which prints the entire string if the precision is unspecified).
-.Bu
+.It
 The conversion characters ``h'', ``n'', and ``p'' are not
 supported.
 The conversion characters ``h'', ``n'', and ``p'' are not
 supported.
-.Bu
+.It
 The single character escape sequences
 described in the C standard are supported:
 The single character escape sequences
 described in the C standard are supported:
-.Ds I
-.Cw <alert_character>
-.Cl NUL        \e0
-.Cl <alert character>  \ea
-.Cl <backspace>        \eb
-.Cl <form-feed>        \ef
-.Cl <newline>  \en
-.Cl <carriage return>  \er
-.Cl <tab>      \et
-.Cl <vertical tab>     \ev
-.Cw
-.De
-.Tp
-.De
+.Bd -ragged -offset indent -compact
+.Bl -column <alert_character>
+.It NUL        \e0
+.It <alert character>  \ea
+.It <backspace>        \eb
+.It <form-feed>        \ef
+.It <newline>  \en
+.It <carriage return>  \er
+.It <tab>      \et
+.It <vertical tab>     \ev
+.El
+.Ed
+.El
 .Pp
 Hexdump also supports the the following additional conversion strings:
 .Pp
 Hexdump also supports the the following additional conversion strings:
-.Tw Fl
-.Tc Cm \&_a
-.Op Cm dox
-.Cx
+.Bl -tag -width Fl
+.It Cm \&_a Ns Op Cm dox 
 Display the input offset, cumulative across input files, of the
 next byte to be displayed.
 The appended characters
 Display the input offset, cumulative across input files, of the
 next byte to be displayed.
 The appended characters
@@ -196,54 +207,52 @@ and
 .Cm x
 specify the display base
 as decimal, octal or hexadecimal respectively.
 .Cm x
 specify the display base
 as decimal, octal or hexadecimal respectively.
-.Tc Cm \&_A
-.Op Cm dox
-.Cx
+.It Cm \&_A Ns Op Cm dox 
 Identical to the
 .Cm \&_a
 conversion string except that it is only performed
 once, when all of the input data has been processed.
 Identical to the
 .Cm \&_a
 conversion string except that it is only performed
 once, when all of the input data has been processed.
-.Tp Cm \&_c
+.It Cm \&_c
 Output characters in the default character set.
 Nonprinting characters are displayed in three character, zero-padded
 octal, except for those representable by standard escape notation
 (see above),
 which are displayed as two character strings.
 Output characters in the default character set.
 Nonprinting characters are displayed in three character, zero-padded
 octal, except for those representable by standard escape notation
 (see above),
 which are displayed as two character strings.
-.Tp Cm _p
+.It Cm _p
 Output characters in the default character set.
 Nonprinting characters are displayed as a single
 .Dq Cm \&. .
 Output characters in the default character set.
 Nonprinting characters are displayed as a single
 .Dq Cm \&. .
-.Tp Cm _u
+.It Cm _u
 Output US ASCII characters, with the exception that control characters are
 displayed using the following, lower-case, names.
 Characters greater than 0xff, hexadecimal, are displayed as hexadecimal
 strings.
 Output US ASCII characters, with the exception that control characters are
 displayed using the following, lower-case, names.
 Characters greater than 0xff, hexadecimal, are displayed as hexadecimal
 strings.
-.Cw \&000_nul \&001_soh \&002_stx \&003_etx \&004_eot
-.Cl \&000\ nul\t001\ soh\t002\ stx\t003\ etx\t004\ eot\t005\ enq
-.Cl \&006\ ack\t007\ bel\t008\ bs\t009\ ht\t00A\ lf\t00B\ vt
-.Cl \&00C\ ff\t00D\ cr\t00E\ so\t00F\ si\t010\ dle\t011\ dc1
-.Cl \&012\ dc2\t013\ dc3\t014\ dc4\t015\ nak\t016\ syn\t017\ etb
-.Cl \&018\ can\t019\ em\t01A\ sub\t01B\ esc\t01C\ fs\t01D\ gs
-.Cl \&01E\ rs\t01F\ us\t0FF\ del
-.Cw
-.Tp
+.Bl -column \&000_nu \&001_so \&002_st \&003_et \&004_eo
+.It \&000\ nul\t001\ soh\t002\ stx\t003\ etx\t004\ eot\t005\ enq
+.It \&006\ ack\t007\ bel\t008\ bs\t009\ ht\t00A\ lf\t00B\ vt
+.It \&00C\ ff\t00D\ cr\t00E\ so\t00F\ si\t010\ dle\t011\ dc1
+.It \&012\ dc2\t013\ dc3\t014\ dc4\t015\ nak\t016\ syn\t017\ etb
+.It \&018\ can\t019\ em\t01A\ sub\t01B\ esc\t01C\ fs\t01D\ gs
+.It \&01E\ rs\t01F\ us\t0FF\ del
+.El
+.El
 .Pp
 The default and supported byte counts for the conversion characters
 are as follows:
 .Pp
 The default and supported byte counts for the conversion characters
 are as follows:
-.Df I
-.Tw  %c,_%c,_%c,_%c,_%c,_%c
-.Tp Li \&%_c , %_p , %_u , \&%c
+.Bl -tag -width  "Xc,_Xc,_Xc,_Xc,_Xc,_Xc" -offset indent
+.It Li \&%_c , \&%_p , \&%_u , \&%c
 One byte counts only.
 One byte counts only.
-.Tc Li \&%d , \&%i , \&%o ,
-.Li \&\ %u , \&%X , \&%x
-.Cx
+.It Xo
+.Li \&%d , \&%i , \&%o ,
+.Li \&%u , \&%X , \&%x 
+.Xc
 Four byte default, one and two byte counts supported.
 Four byte default, one and two byte counts supported.
-.Tc Li \&%E , \&%e , \&%f ,
-.Li \&\ %G , \&%g
-.Cx
+.It Xo
+.Li \&%E , \&%e , \&%f ,
+.Li \&%G , \&%g 
+.Xc
 Eight byte default, four byte counts supported.
 Eight byte default, four byte counts supported.
-.Tp
-.De
+.El
 .Pp
 The amount of data interpreted by each format string is the sum of the
 data required by each format unit, which is the iteration count times the
 .Pp
 The amount of data interpreted by each format string is the sum of the
 data required by each format unit, which is the iteration count times the
@@ -300,22 +309,22 @@ option.
 exits 0 on success and >0 if an error occurred.
 .Sh EXAMPLES
 Display the input in perusal format:
 exits 0 on success and >0 if an error occurred.
 .Sh EXAMPLES
 Display the input in perusal format:
-.Pp
-.Ds I
+.Bd -literal -offset indent
 "%06.6_ao "  12/1 "%3_u "
 "\et\et" "%_p "
 "\en"
 "%06.6_ao "  12/1 "%3_u "
 "\et\et" "%_p "
 "\en"
-.De
+.Ed
 .Pp
 Implement the \-x option:
 .Pp
 Implement the \-x option:
-.Pp
-.Ds I
+.Bd -literal -offset indent
 "%07.7_Ax\en"
 "%07.7_ax  " 8/2 "%04x " "\en"
 "%07.7_Ax\en"
 "%07.7_ax  " 8/2 "%04x " "\en"
-.De
+.Ed
 .Sh SEE ALSO
 .Xr adb 1
 .Sh STANDARDS
 The
 .Nm hexdump
 .Sh SEE ALSO
 .Xr adb 1
 .Sh STANDARDS
 The
 .Nm hexdump
-utility is expected to be POSIX 1003.2 compatible.
+utility is expected to be
+.St -p1003.2
+compatible.