1ASCII(1) ASCII(1)
2
3
4
6 ascii - report character aliases
7
9 ascii [-dxohv] [-t] [char-alias...]
10
11
13 Called with no options, ascii behaves like `ascii -h'. Options are as
14 follows:
15
16
17 Script-friendly mode, emits only ISO/decimal/hex/octal/binary encodings
18 of the character.
19
20
21 Parse multiple characters. Convenient way of parsing strings.
22
23
24 Ascii table in decimal.
25
26
27 Ascii table in hex.
28
29
30 Ascii table in octal.
31
32
33 Show summary of options and a simple ASCII table.
34
35
36 Show version of program.
37
38
40 Characters in the ASCII set can have many aliases, depending on con‐
41 text. A character's possible names include:
42
43
44 * Its bit pattern (binary representation).
45
46
47 * Its hex, decimal and octal representations.
48
49
50 * Its teletype mnemonic and caret-notation form (for control
51 chars).
52
53
54 * Its backlash-escape form in C (for some control chars).
55
56
57 * Its printed form (for printables).
58
59
60 * Its full ISO official name in English.
61
62
63 * Its ISO/ECMA code table reference.
64
65
66 * Its name as an HTML/SGML entity.
67
68
69 * Slang and other names in wide use for it among hackers.
70
71
72 This utility accepts command-line strings and tries to interpret them
73 as one of the above. When it finds a value, it prints all of the names
74 of the character. The constructs in the following list can be used to
75 specify character values. If an argument could be interpreted in two or
76 more ways, names for all the different characters it might be are
77 dumped.
78
79
80 character
81 Any character not described by one of the following conventions
82 represents the character itself.
83
84
85 ^character
86 A caret followed by a character.
87
88
89 \character
90 A backslash followed by certain special characters (abfnrtv).
91
92
93 mnemonic
94 An ASCII teletype mnemonic.
95
96
97 hexadecimal
98 A hexadecimal (hex) sequence consists of one or two case-insen‐
99 sitive hex digit characters (01234567890abcdef). To ensure hex
100 interpretation use hexh, 0xhex, xhex or \xhex.
101
102
103 decimal
104 A decimal sequence consists of one, two or three decimal digit
105 characters (0123456789). To ensure decimal interpretation use
106 \0ddecimal, ddecimal, or \ddecimal.
107
108
109 octal An octal sequence consists of one, two or three octal digit
110 characters (01234567). To ensure octal interpretation use \oc‐
111 tal, 0ooctal, ooctal, or \ooctal.
112
113
114 bit pattern
115 A bit pattern (binary) sequence consists of one to eight binary
116 digit characters (01). To ensure bit interpretation use 0bbit
117 pattern, bbit pattern or \bbit pattern.
118
119
120 ISO/ECMA code
121 A ISO/ECMA code sequence consists of one or two decimal digit
122 characters, a slash, and one or two decimal digit characters.
123
124
125 name An official ASCII or slang name.
126
127
128 The slang names recognized and printed out are from a rather comprehen‐
129 sive list that first appeared on USENET in early 1990 and has been con‐
130 tinuously updated since. Mnemonics recognized and printed include the
131 official ASCII set, some official ISO names (where those differ) and a
132 few common-use alternatives (such as NL for LF). HTML/SGML entity names
133 are also printed when applicable. All comparisons are case-insensitive,
134 and dashes are mapped to spaces. Any unrecognized arguments or out of
135 range values are silently ignored. Note that the -s option will not
136 recognize 'long' names, as it cannot differentiate them from other
137 parts of the string.
138
139
140 For correct results, be careful to stringize or quote shell metacharac‐
141 ters in arguments (especially backslash).
142
143
144 This utility is particularly handy for interpreting cc(1)'s ugly octal
145 `invalid-character' messages, or when coding anything to do with serial
146 communications. As a side effect it serves as a handy base-converter
147 for random 8-bit values.
148
149
151 Eric S. Raymond <esr@snark.thyrsus.com>; November 1990 (home page at
152 http://www.catb.org/~esr/: http://www.catb.org/~esr/). Reproduce, use,
153 and modify as you like as long as you don't remove this authorship no‐
154 tice. Ioannis E. Tambouras <ioannis@debian.org> added command options
155 and minor enhancements. Brian J. Ginsbach <ginsbach@sgi.com> fixed sev‐
156 eral bugs and expanded the man page. David N. Welton <davidw@efn.org>
157 added the -s option. Matej Vela corrected the ISO names. Dave Capella
158 contributed the idea of listing HTML/SGML entities.
159
160
161
162
163 ASCII(1)