.\" .\" DMS Tools and Utilities .\" Copyright (C) 2010 David M. Syzdek .\" .\" @SYZDEK_COPYRIGHT_HEADER_START@ .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are .\" met: .\" .\" * Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" * 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. .\" * Neither the name of David M. Syzdek nor the .\" names of its contributors may be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 DAVID M. SYZDEK 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. .\" .\" @SYZDEK_COPYRIGHT_HEADER_END@ .\" .\" doc/numconvert.1.in - man page for numconvert .\" .TH "NUMCONVERT" "1" "@RELEASE_MONTH@" "@PACKAGE_TARNAME@ @PACKAGE_VERSION@" "User Commands" .SH NAME numconvert \- displays values using multiple numeral systems .SH SYNOPSIS \fBnumconvert\fR [\fB-a\fR | \fB-b\fR | \fB-d\fR \fB | \fB-o\fR | \fB-x\fR] [\fB-ABDlOqRrSswX\fR] [\fB-f\fR \fIorder\fR] \fInumber1\fR [\fInumber2\fR [\fInumberN\fR]] .sp \fBnumconvert\fR [\fB--help\fR | \fB-h\fR] .sp \fBnumconvert\fR [\fB--version\fR | \fB-V\fR] .SH DESCRIPTION The \fBnumconvert\fR utility converts values between numeral systems. \fBnumconvert\fR uses prefiexes to determine the input notation of a value if an input notation option is not specified. Strings with the prefix \fI0x\fR are treated as hexadecimal input; \fI00\fR and \fI0b\fR as binary input; and \fI0\fR followed by a non-zero numeric character as octal input. If the input does not use a known prefix, the input will be treat as decimal if the input string contains only decimal numerals. If \fBnumconvert\fR is unable to determine the numeral system of the input, the input will be treated as an ASCII string. .SH OPTIONS .TP \fB-A\fR Display the values as an ASCII character .TP \fB-a\fR Process input as individual ASCII characters .TP \fB-B\fR Display the values as binary numerals. .TP \fB-b\fR Process input strings as binary numerals. .TP \fB-D\fR Display the values as decimal numerals. .TP \fB-d\fR Process input strings as decimal numerals. .TP \fB-f\fR \fIorder\fR Set order of output values if specifing multiple formats. Use '\fIa\fR' for ASCII; '\fIb\fR' for binary; '\fId\fR' for decimal; '\fIo\fR' for octal; and '\fIx\fR' for hexadecimal. The default order is '\fIabxod\fR'. .TP \fB\-h\fR, \fB--help\fR Displays usage information and exits. .TP \fB-l\fR Display values with padding for maximum values instead of assuming 32 bit values. .TP \fB-O\fR Display the values as octal numerals. .TP \fB-o\fR Process input strings as octal numerals. .TP \fB-q\fR Suppress column names in output. .TP \fB-R\fR Display binary numerals in little endian byte order. .TP \fB-r\fR Display binary numerals in little endian byte order and little endian bit order .TP \fB-S\fR Display the values as a string. .TP \fB-s\fR Process input strings as a ASCII string. .TP \fB-w\fR Do not print spaces when displaying numerals. .TP \fB\-V\fR, \fB--version\fR displays version number and exits. .TP \fB-X\fR Display the values as hexadecimal numerals. .TP \fB-x\fR Process input strings as hexadecimal numerals. .SH EXAMPLES The following example converts values to ASCII, binary, hexadecimal, and decimal: .sp .RS numconvert -A -B -X -D 0001000001 0102 67 .br TXT, Binary, Hex, Decimal .br \'A\', 00000000 00000000 00000000 01000001, 0x00000041, 65 .br \'B\', 00000000 00000000 00000000 01000010, 0x00000042, 66 .br \'C\', 00000000 00000000 00000000 01000011, 0x00000043, 67 .RE The following example inteprets the input as decimal and displays the values as binary, hexadecimal, and decimal: .RS numconvert -d -B -X -D 0001000001 0102 67 .br Binary, Hex, Decimal .br 00000000 00001111 01000010 01000001, 0x000F4241, 1000001 .br 00000000 00000000 00000000 01100110, 0x00000066, 102 .br 00000000 00000000 00000000 01000011, 0x00000043, 67 .RE The following example changes the order of the output: .RS numconvert -d -B -X -D -f \'dxb\' 0001000001 0102 67 .br Decimal, Hex, Binary .br 1000001, 0x000F4241, 00000000 00001111 01000010 01000001 .br 102, 0x00000066, 00000000 00000000 00000000 01100110 .br 67, 0x00000043, 00000000 00000000 00000000 01000011 .RE .SH "REPORTING BUGS" Report bugs to David M. Syzdek <@PACKAGE_BUGREPORT@>. .SH "SEE ALSO" .BR bitops (1), .BR bindump (1), .\" end of man page