File: ascii.1

package info (click to toggle)
ascii 3.11-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 120 kB
  • sloc: ansic: 304; xml: 263; makefile: 36; sh: 17
file content (209 lines) | stat: -rw-r--r-- 6,177 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
'\" t
.\"     Title: ascii
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 03/16/2011
.\"    Manual: Development Tools
.\"    Source: ascii
.\"  Language: English
.\"
.TH "ASCII" "1" "03/16/2011" "ascii" "Development Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ascii \- report character aliases
.SH "SYNOPSIS"
.HP \w'\fBascii\fR\ 'u
\fBascii\fR [\-dxohv] [\-t] [\fIchar\-alias\fR...]
.SH "OPTIONS"
.PP
Called with no options,
\fBascii\fR
behaves like `ascii \-h\*(Aq\&. Options are as follows:
.PP
\-t
.RS 4
Script\-friendly mode, emits only ISO/decimal/hex/octal/binary encodings of the character\&.
.RE
.PP
\-s
.RS 4
Parse multiple characters\&. Convenient way of parsing strings\&.
.RE
.PP
\-d
.RS 4
Ascii table in decimal\&.
.RE
.PP
\-x
.RS 4
Ascii table in hex\&.
.RE
.PP
\-o
.RS 4
Ascii table in octal\&.
.RE
.PP
\-h, \-?
.RS 4
Show summary of options and a simple ASCII table\&.
.RE
.PP
\-v
.RS 4
Show version of program\&.
.RE
.SH "DESCRIPTION"
.PP
Characters in the ASCII set can have many aliases, depending on context\&. A character\*(Aqs possible names include:
.PP
*
.RS 4
Its bit pattern (binary representation)\&.
.RE
.PP
*
.RS 4
Its hex, decimal and octal representations\&.
.RE
.PP
*
.RS 4
Its teletype mnemonic and caret\-notation form (for control chars)\&.
.RE
.PP
*
.RS 4
Its backlash\-escape form in C (for some control chars)\&.
.RE
.PP
*
.RS 4
Its printed form (for printables)\&.
.RE
.PP
*
.RS 4
Its full ISO official name in English\&.
.RE
.PP
*
.RS 4
Its ISO/ECMA code table reference\&.
.RE
.PP
*
.RS 4
Its name as an HTML/SGML entity\&.
.RE
.PP
*
.RS 4
Slang and other names in wide use for it among hackers\&.
.RE
.PP
This utility accepts command\-line strings and tries to interpret them as one of the above\&. When it finds a value, it prints
\fIall\fR
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\&.
.PP
\fIcharacter\fR
.RS 4
Any character not described by one of the following conventions represents the character itself\&.
.RE
.PP
\fB^\fR\fIcharacter\fR
.RS 4
A caret followed by a character\&.
.RE
.PP
\fB\e\fR\fIcharacter\fR
.RS 4
A backslash followed by certain special characters (abfnrtv)\&.
.RE
.PP
\fImnemonic\fR
.RS 4
An ASCII teletype mnemonic\&.
.RE
.PP
\fIhexadecimal\fR
.RS 4
A hexadecimal (hex) sequence consists of one or two case\-insensitive hex digit characters (01234567890abcdef)\&. To ensure hex interpretation use
\fIhex\fR\fBh\fR\fI,\fR
\fB0x\fR\fIhex,\fR
\fBx\fR\fIhex\fR
or
\fB\ex\fR\fIhex\&.\fR
.RE
.PP
\fIdecimal\fR
.RS 4
A decimal sequence consists of one, two or three decimal digit characters (0123456789)\&. To ensure decimal interpretation use
\fB\e0d\fR\fIdecimal,\fR
\fBd\fR\fIdecimal,\fR
or
\fB\ed\fR\fIdecimal\&.\fR
.RE
.PP
\fIoctal\fR
.RS 4
An octal sequence consists of one, two or three octal digit characters (01234567)\&. To ensure octal interpretation use
\fB\e\fR\fIoctal,\fR
\fB0o\fR\fIoctal,\fR
\fBo\fR\fIoctal,\fR
or
\fB\eo\fR\fIoctal\&.\fR
.RE
.PP
\fIbit pattern\fR
.RS 4
A bit pattern (binary) sequence consists of one to eight binary digit characters (01)\&. To ensure bit interpretation use
\fB0b\fR\fIbit pattern,\fR
\fBb\fR\fIbit pattern\fR
or
\fB\eb\fR\fIbit pattern\&.\fR
.RE
.PP
\fIISO\fR/\fIECMA code\fR
.RS 4
A ISO/ECMA code sequence consists of one or two decimal digit characters, a slash, and one or two decimal digit characters\&.
.RE
.PP
\fIname\fR
.RS 4
An official ASCII or slang name\&.
.RE
.PP
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
\fB\-s\fR
option will not recognize \*(Aqlong\*(Aq names, as it cannot differentiate them from other parts of the string\&.
.PP
For correct results, be careful to stringize or quote shell metacharacters in arguments (especially backslash)\&.
.PP
This utility is particularly handy for interpreting cc(1)\*(Aqs ugly octal `invalid\-character\*(Aq 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\&.
.SH "AUTHOR"
.PP
Eric S\&. Raymond
esr@snark\&.thyrsus\&.com; November 1990 (home page at
\m[blue]\fBhttp://www\&.catb\&.org/~esr/\fR\m[])\&. Reproduce, use, and modify as you like as long as you don\*(Aqt remove this authorship notice\&. Ioannis E\&. Tambouras <ioannis@debian\&.org> added command options and minor enhancements\&. Brian J\&. Ginsbach <ginsbach@sgi\&.com> fixed several bugs and expanded the man page\&. David N\&. Welton <davidw@efn\&.org> added the
\fB\-s\fR
option\&. Matej Vela corrected the ISO names\&. Dave Capella contributed the idea of listing HTML/SGML entities\&.