Codebase list ascii / fresh-snapshots/main ascii.xml
fresh-snapshots/main

Tree @fresh-snapshots/main (Download .tar.gz)

ascii.xml @fresh-snapshots/mainraw · history · blame

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC 
   "-//OASIS//DTD DocBook XML V4.1.2//EN"
   "docbook/docbookx.dtd">
<refentry id='ascii.1'>
<refmeta>
<refentrytitle>ascii</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class='date'>Aug 24 1994</refmiscinfo>
<refmiscinfo class='productname'>ascii</refmiscinfo>
<refmiscinfo class='source'>ascii</refmiscinfo>
<refmiscinfo class='manual'>Development Tools</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>ascii</refname>
<refpurpose>report character aliases</refpurpose>
</refnamediv>
<refsynopsisdiv id='synopsis'>

<cmdsynopsis>
  <!-- ascii  [ \-abdxohv ]   [ \-t ]   [ char\-alias ...  ]  -->
  <command>ascii</command>  <arg choice='opt'>-dxohv </arg>
  <arg choice='opt'>-t </arg>
  <arg choice='opt' rep='repeat'><replaceable>char-alias</replaceable></arg>
</cmdsynopsis>

</refsynopsisdiv>

<refsect1 id='options'><title>OPTIONS</title>
<para>Called with no options, <command>ascii</command> behaves like
`ascii -h'.  Options are as follows:</para>
<variablelist remap='TP'>
<varlistentry>
<term>-t</term>
<listitem>
<para>Script-friendly mode, emits only ISO/decimal/hex/octal/binary
encodings of the character.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-s</term>
<listitem>
<para>Parse multiple characters.  Convenient way of parsing strings.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-a</term>
<listitem>
<para>Print in vertical aspect (4 columns by 16 rows) rather than
16x4. This option combines only with -d -o -x -b and must precede them.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-d</term>
<listitem>
<para>Ascii table in decimal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-x</term>
<listitem>
<para>Ascii table in hex.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-o</term>
<listitem>
<para>Ascii table in octal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-b</term>
<listitem>
<para>Ascii table in binary.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-h, -?</term>
<listitem>
<para>Show summary of options and a simple ASCII table.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-v</term>
<listitem>
<para>Show version of program.</para>
</listitem>
</varlistentry>
</variablelist>

</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>Characters in the ASCII set can have many aliases, depending on
context. A character's possible names include:</para>

<itemizedlist>
<listitem>
<para>Its bit pattern (binary representation).</para>
</listitem>
<listitem>
<para>Its hex, decimal and octal representations.</para>
</listitem>
<listitem>
<para>Its teletype mnemonic and caret-notation form (for control chars).</para>
</listitem>
<listitem>
<para>Its backlash-escape form in C (for some control chars).</para>
</listitem>
<listitem>
<para>Its printed form (for printables).</para>
</listitem>
<listitem>
<para>Its full ISO official name in English.</para>
</listitem>
<listitem>
<para>Its ISO/ECMA code table reference.</para>
</listitem>
<listitem>
<para>Its name as an HTML/SGML entity.</para>
</listitem>
<listitem>
<para>Slang and other names in wide use for it among hackers.</para>
</listitem>
</itemizedlist>

<para>This utility accepts command-line strings and tries to interpret them as
one of the above.
When it finds a value, it prints <emphasis>all</emphasis> of the names
of the character.
The constructs in the following list can be used to 
specify character values.
If an argument could be interpreted in two or more
ways, names for all the different characters it might be are dumped.</para>
<variablelist>
<varlistentry>
<term><emphasis>character</emphasis></term>
<listitem>
<para>Any character not described by one of the following conventions
represents the character itself.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">^</emphasis><emphasis>character</emphasis></term>
<listitem>
<para>A caret followed by a character.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">\</emphasis><emphasis>[abfnrtv0]</emphasis></term>
<listitem>
<para>A backslash followed by certain special characters (abfnrtv).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>mnemonic</emphasis></term>
<listitem>
<para>An ASCII teletype mnemonic.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='I'>hexadecimal</emphasis></term>
<listitem>
<para>A hexadecimal (hex) sequence consists of one or two case-insensitive hex digit
characters (01234567890abcdef).
To ensure hex interpretation use
<emphasis>hex</emphasis><emphasis role="bold">h</emphasis><emphasis>,</emphasis>
<emphasis role="bold">0x</emphasis><emphasis>hex,</emphasis>
<emphasis role="bold">x</emphasis><emphasis>hex</emphasis>
or
<emphasis role="bold">\x</emphasis><emphasis>hex.</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>decimal</emphasis></term>
<listitem>
<para>A decimal sequence consists of one, two or three decimal digit
characters (0123456789).
To ensure decimal interpretation use
<emphasis role="bold">\0d</emphasis><emphasis>decimal,</emphasis>
<emphasis role="bold">d</emphasis><emphasis>decimal,</emphasis>
or
<emphasis role="bold">\d</emphasis><emphasis>decimal.</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>octal</emphasis></term>
<listitem>
<para>An octal sequence consists of one, two or three octal digit
characters (01234567).
To ensure octal interpretation use
<emphasis role="bold">\</emphasis><emphasis>&lt;octal&gt;,</emphasis>
<emphasis role="bold">0o</emphasis><emphasis>&lt;octal&gt;,</emphasis>
<emphasis role="bold">o</emphasis><emphasis>&lt;octal&gt;,</emphasis>
or
<emphasis role="bold">\o</emphasis><emphasis>&lt;octal&gt;.</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>bit pattern</emphasis></term>
<listitem>
<para>A bit pattern (binary) sequence consists of one to eight binary digit
characters (01).
To ensure bit interpretation use
<emphasis role="bold">0b</emphasis><emphasis>&lt;bit pattern&gt;,</emphasis>
<emphasis role="bold">b</emphasis><emphasis>&lt;bit pattern&gt;</emphasis>
or
<emphasis role="bold">\b</emphasis><emphasis>&lt;bit pattern&gt;.</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>ISO</emphasis>/<emphasis>ECMA code</emphasis></term>
<listitem>
<para>An ISO/ECMA code sequence consists of one or two decimal digit characters,
a slash, and one or two decimal digit characters.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>name</emphasis></term>
<listitem>
<para>An official ASCII or (unofficial) slang name.</para>
</listitem>
</varlistentry>
</variablelist>

<para>The slang names recognized and printed out are from a rather
comprehensive list that first appeared on USENET in early 1990 and has
been continuously updated since.  Mnemonics recognized and printed
include the official ASCII set, some official ISO names (where those
differ) and a few common-use alternatives (such as NL for LF).
HTML/SGML entity names are also printed when applicable.  All
comparisons are case-insensitive, and dashes are mapped to spaces.
Any unrecognized arguments or out of range values are silently
ignored.  Note that the <option>-s</option> option will not recognize
'long' names, as it cannot differentiate them from other parts of the
string.</para>

<para>For correct results, be careful to stringize or quote shell
metacharacters in arguments (especially backslash).</para>

<para>This utility is particularly handy for interpreting cc(1)'s ugly
octal `invalid-character' messages, or when coding anything to do with
serial communications.  As a side effect it serves as a handy
base-converter for random 8-bit values.</para>
</refsect1>

<refsect1 id='author'><title>AUTHOR</title>

<para>Eric S. Raymond <email>esr@thyrsus.com</email>; November
1990 (home page at <ulink
url='http://www.catb.org/~esr/'>http://www.catb.org/~esr/</ulink>).
Reproduce, use, and modify as you like as long as you don't remove
this authorship notice.  Ioannis E. Tambouras
&lt;ioannis@debian.org&gt; added command options and minor
enhancements.  Brian J. Ginsbach &lt;ginsbach@sgi.com&gt; fixed
several bugs and expanded the man page.  David N. Welton
&lt;davidw@efn.org&gt; added the <option>-s</option> option.  Matej
Vela corrected the ISO names.  Dave Capella contributed the idea of
listing HTML/SGML entities.</para>
</refsect1>
</refentry>