Mercurial > hg > Members > kono > nitros9-code
comparison docs/nitros9guide/chap2.chapter @ 1011:cc153d1671f7
Updated for new manuals
author | boisy |
---|---|
date | Tue, 04 Mar 2003 15:11:34 +0000 |
parents | 525b12e17d60 |
children | d9ed9d44b70c |
comparison
equal
deleted
inserted
replaced
1010:1027549ee381 | 1011:cc153d1671f7 |
---|---|
7 The "shell" is a the part of OS-9 that accepts commands from your | 7 The "shell" is a the part of OS-9 that accepts commands from your |
8 keyboard. It was designed to provide a convenient, flexible, and | 8 keyboard. It was designed to provide a convenient, flexible, and |
9 easy-to-use interface between you and the powerful functions of the | 9 easy-to-use interface between you and the powerful functions of the |
10 operating system. The shell is automatically entered after OS-9 is | 10 operating system. The shell is automatically entered after OS-9 is |
11 started up. You can tell when the shell is waiting for input | 11 started up. You can tell when the shell is waiting for input |
12 because it displays the "OS9:" prompt. This prompt indicates that | 12 because it displays the shell prompt. This prompt indicates that |
13 the shell is active and awaiting a command from your keyboard. It | 13 the shell is active and awaiting a command from your keyboard. It |
14 makes no difference whether you use upper-case letters, lower-case | 14 makes no difference whether you use upper-case letters, lower-case |
15 letters, or a combination of both because OS-9 matches letters of | 15 letters, or a combination of both because OS-9 matches letters of |
16 either case. | 16 either case. |
17 </para> | 17 </para> |
22 | 22 |
23 <itemizedlist> | 23 <itemizedlist> |
24 <listitem><para>The name of a machine language program on disk</para></listitem> | 24 <listitem><para>The name of a machine language program on disk</para></listitem> |
25 <listitem><para>The name of a machine language program already in memory</para></listitem> | 25 <listitem><para>The name of a machine language program already in memory</para></listitem> |
26 <listitem><para>The name of an executable program compiled by a high-level | 26 <listitem><para>The name of an executable program compiled by a high-level |
27 language such as Basic09, Pascal, Cobol, etc. (See 4.8)</para></listitem> | 27 language such as Basic09, Pascal, Cobol, etc.</para></listitem> |
28 <listitem><para>The name of a procedure file (See 4.6)</para></listitem> | 28 <listitem><para>The name of a procedure file</para></listitem> |
29 </itemizedlist> | 29 </itemizedlist> |
30 <para> | 30 <para> |
31 If you're a beginner, you will almost always use the first case, | 31 If you're a beginner, you will almost always use the first case, |
32 which causes the program to be automatically loaded from the CMDS | 32 which causes the program to be automatically loaded from the CMDS |
33 directory and run. | 33 directory and run. |
37 program having the name specified in the following sequence: | 37 program having the name specified in the following sequence: |
38 </para> | 38 </para> |
39 | 39 |
40 <orderedlist numeration="arabic"> | 40 <orderedlist numeration="arabic"> |
41 | 41 |
42 <listitem><para>- If the program named is already in memory, it is run.</para></listitem> | 42 <listitem><para> If the program named is already in memory, it is run.</para></listitem> |
43 | 43 |
44 <listitem><para>- The "execution directory", usually "CMDS", is searched. | 44 <listitem><para> The "execution directory", usually "CMDS", is searched. |
45 If a file having the name given is found, it is loaded and | 45 If a file having the name given is found, it is loaded and |
46 run (See 5.4.1).</para></listitem> | 46 run.</para></listitem> |
47 | 47 |
48 <listitem><para>- The user's "data directory" is searched. If a file having | 48 <listitem><para> The user's "data directory" is searched. If a file having |
49 the name given is found, it is processed as a "procedure | 49 the name given is found, it is processed as a "procedure |
50 file" which means that the file is assumed to contain one | 50 file" which means that the file is assumed to contain one |
51 or more command lines which are processed by the shell in | 51 or more command lines which are processed by the shell in |
52 the same manner as if they had manually typed in one by one.</para></listitem> | 52 the same manner as if they had manually typed in one by one.</para></listitem> |
53 | 53 |
54 </orderedlist> | 54 </orderedlist> |
55 <para> | 55 <para> |
56 Mention is made above of the "data directory" and the "execution | 56 Mention is made above of the "data directory" and the "execution |
57 directory". At all times each user is associated with two file | 57 directory". At all times each user is associated with two file |
58 directories. A more detailed explanation of directories is presented | 58 directories. A more detailed explanation of directories is presented |
59 in section 3.3. The execution directory (usually CMDS) includes | 59 later. The execution directory (usually CMDS) includes |
60 files which are executable programs. | 60 files which are executable programs. |
61 </para> | 61 </para> |
62 <para> | 62 <para> |
63 The name given in the command line may be optionally followed by | 63 The name given in the command line may be optionally followed by |
64 one or more "parameters" which are passed to the program called by | 64 one or more "parameters" which are passed to the program called by |
66 </para> | 66 </para> |
67 <para> | 67 <para> |
68 For example, in the command line: | 68 For example, in the command line: |
69 </para> | 69 </para> |
70 <screen> | 70 <screen> |
71 LIST FILE1 | 71 list file1 |
72 </screen> | 72 </screen> |
73 <para> | 73 <para> |
74 the program name is LIST, and the parameter passed to it is FILE1. | 74 the program name is LIST, and the parameter passed to it is FILE1. |
75 </para> | 75 </para> |
76 <para> | 76 <para> |
77 A command line may also include one or more "modifiers" which are | 77 A command line may also include one or more "modifiers" which are |
78 specifications used by the shell to alter the program's standard | 78 specifications used by the shell to alter the program's standard |
79 input/output files or memory assignments (See 4.2). | 79 input/output files or memory assignments. |
80 | 80 |
81 | 81 |
82 </para> | 82 </para> |
83 <section> | 83 <section> |
84 <title>Sending Output to the Printer</title> | 84 <title>Sending Output to the Printer</title> |
85 <para> | 85 <para> |
86 Normally, most commands and programs display output on the Color | 86 Normally, most commands and programs display output on the &make video display. The output of these programs can |
87 Computer video display. The output of these programs can | |
88 alternatively be printed by specifying output redirection on the | 87 alternatively be printed by specifying output redirection on the |
89 command line. This is done by including the following modifier to | 88 command line. This is done by including the following modifier to |
90 at the end of any command line: | 89 at the end of any command line: |
91 </para> | 90 </para> |
92 <screen> | 91 <screen> |
93 >/P | 92 >/p |
94 </screen> | 93 </screen> |
95 <para> | 94 <para> |
96 The ">" character tells the shell to redirect output (See 4.3.2) to | 95 The ">" character tells the shell to redirect output (See 4.3.2) to |
97 the printer using the &make; Computer's parallel port, which has the device | 96 the printer using the &make;'s printer port, which has the device |
98 name "/P" (See 3.2). For example, to redirect the output of the | 97 name "/P" (See 3.2). For example, to redirect the output of the |
99 "dir" command to the printer, enter: | 98 "dir" command to the printer, enter: |
100 </para> | 99 </para> |
101 <screen> | 100 <screen> |
102 DIR >/P | 101 dir >/p |
103 </screen> | 102 </screen> |
104 <para> | 103 <para> |
105 The "xmode" command can be used to set the printer port's | 104 The "xmode" command can be used to set the printer port's |
106 operating mode such as auto line feed, etc. For example, to examine | 105 operating mode such as auto line feed, etc. For example, to examine |
107 the printer's current settings, type: | 106 the printer's current settings, type: |
108 </para> | 107 </para> |
109 <screen> | 108 <screen> |
110 xmode /P | 109 xmode /p |
111 </screen> | 110 </screen> |
112 <para> | 111 <para> |
113 To change any of these type XMODE followed by the new value. | 112 To change any of these type XMODE followed by the new value. |
114 For example, to set the printer port for automatic line feeds at the | 113 For example, to set the printer port for automatic line feeds at the |
115 end of every line, enter: | 114 end of every line, enter: |
116 </para> | 115 </para> |
117 <screen> | 116 <screen> |
118 xmode /P lf; | 117 xmode /p lf; |
119 </screen> | 118 </screen> |
120 </section> | 119 </section> |
121 </section> | 120 </section> |
122 | 121 |
123 <section> | 122 <section> |
139 desired file is given as a parameter in the command line. For | 138 desired file is given as a parameter in the command line. For |
140 example, to list the file called startup (the system initialization | 139 example, to list the file called startup (the system initialization |
141 procedure file), you enter the command line: | 140 procedure file), you enter the command line: |
142 </para> | 141 </para> |
143 <screen> | 142 <screen> |
144 LIST STARTUP | 143 list startup |
145 </screen> | 144 </screen> |
146 <para> | 145 <para> |
147 Some commands have two parameters. For example, the COPY command is | 146 Some commands have two parameters. For example, the COPY command is |
148 used to make an exact copy of a file. It requires two parameters: | 147 used to make an exact copy of a file. It requires two parameters: |
149 The name of the file to be copied and the name of the file which is | 148 The name of the file to be copied and the name of the file which is |
150 to be the copy, for example: | 149 to be the copy, for example: |
151 </para> | 150 </para> |
152 <screen> | 151 <screen> |
153 COPY STARTUP NEWSTARTUP | 152 copy startup newstartup |
154 </screen> | 153 </screen> |
155 <para> | 154 <para> |
156 Other commands have parameters which select options. For example: | 155 Other commands have parameters which select options. For example: |
157 </para> | 156 </para> |
158 <screen> | 157 <screen> |
159 DIR | 158 dir |
160 </screen> | 159 </screen> |
161 <para> | 160 <para> |
162 shows the names of the files in the user's data directory. Normally | 161 shows the names of the files in the user's data directory. Normally |
163 it simply lists the file names only, but if the "E" | 162 it simply lists the file names only, but if the "-e" |
164 (for <emphasis>e</emphasis>ntire) | 163 (for <emphasis>e</emphasis>ntire) |
165 option is given, it will also give complete statistics for each file | 164 option is given, it will also give complete statistics for each file |
166 such as the date and time created, size, security codes, etc. To do | 165 such as the date and time created, size, security codes, etc. To do |
167 so enter: | 166 so enter: |
168 </para> | 167 </para> |
169 <screen> | 168 <screen> |
170 DIR E | 169 dir -e |
171 </screen> | 170 </screen> |
172 <para> | 171 <para> |
173 The DIR command also can accept a file name as a parameter which | 172 The DIR command also can accept a file name as a parameter which |
174 specifies a directory file other than the (default) data directory. | 173 specifies a directory file other than the (default) data directory. |
175 For example, to list file names in the directory sys , type: | 174 For example, to list file names in the directory sys , type: |
176 </para> | 175 </para> |
177 <screen> | 176 <screen> |
178 DIR SYS | 177 dir sys |
179 </screen> | 178 </screen> |
180 <para> | 179 <para> |
181 It is also possible to specify both a directory name parameter and | 180 It is also possible to specify both a directory name parameter and |
182 the e option, such as: | 181 the e option, such as: |
183 </para> | 182 </para> |
184 <screen> | 183 <screen> |
185 DIR SYS E | 184 dir sys -e |
186 </screen> | 185 </screen> |
187 <para> | 186 <para> |
188 giving file names and complete statistics (See example in 3.8.1). | 187 giving file names and complete statistics. |
189 </para> | 188 </para> |
190 </section> | 189 </section> |
191 | 190 |
192 <section> | 191 <section> |
193 <title>Some Common Command Formats</title> | 192 <title>Some Common Command Formats</title> |
194 <para> | 193 <para> |
195 This section is a summary of some commands commonly used by new | 194 This section is a summary of some commands commonly used by new |
196 or casual OS-9 users, and some common formats. Each command is | 195 or casual OS-9 users, and some common formats. Each command is |
197 followed by an example. Refer to the individual command | 196 followed by an example. Refer to the individual command |
198 descriptions in Section 8 for more detailed information and | 197 descriptions later int his book for more detailed information and |
199 additional examples. Parameters or options shown in brackets are | 198 additional examples. Parameters or options shown in brackets are |
200 optional. Whenever a command references a directory file name, the | 199 optional. Whenever a command references a directory file name, the |
201 file <emphasis>must</emphasis> be a directory file. | 200 file <emphasis>must</emphasis> be a directory file. |
202 | 201 |
203 <screen> | 202 <screen> |
213 <screen> | 212 <screen> |
214 DEL filename del oldstuff | 213 DEL filename del oldstuff |
215 </screen> | 214 </screen> |
216 Deletes (destroys) the file specified. | 215 Deletes (destroys) the file specified. |
217 <screen> | 216 <screen> |
218 DIR [filename] [e] [x] dir myfiles e | 217 DIR [filename] [-e] [-x] dir myfiles -e |
219 </screen> | 218 </screen> |
220 List names of files contained in a directory. If the "x" option is | 219 List names of files contained in a directory. If the "x" option is |
221 used the files in the current <emphasis>execution</emphasis> | 220 used the files in the current <emphasis>execution</emphasis> |
222 directory are listed, | 221 directory are listed, |
223 othervise, if no directory name is given, the current | 222 othervise, if no directory name is given, the current |
259 </para> | 258 </para> |
260 | 259 |
261 <section> | 260 <section> |
262 <title>Video Display Functions</title> | 261 <title>Video Display Functions</title> |
263 <para> | 262 <para> |
264 The &make; Computer uses reverse video (green letters in a black box) to | 263 The &make; uses reverse video (green letters in a black box) to |
265 represent lower-case letters. Normally they are not used, so you | 264 represent lower-case letters. Normally they are not used, so you |
266 have to turn them on if you want to use them with the command: | 265 have to turn them on if you want to use them with the command: |
267 </para> | 266 </para> |
268 <screen> | 267 <screen> |
269 TMODE -UPC | 268 tmode -upc |
270 </screen> | 269 </screen> |
271 <para> | 270 <para> |
272 The screen pause feature stops programs after 16 lines have been | 271 The screen pause feature stops programs after 16 lines have been |
273 displayed. Output will continue if you hit any key. Normally this | 272 displayed. Output will continue if you hit any key. Normally this |
274 feature is on. It can be turned on or off with the TMODE command as | 273 feature is on. It can be turned on or off with the TMODE command as |
275 follows: | 274 follows: |
276 </para> | 275 </para> |
277 <screen> | 276 <screen> |
278 TMODE -PAUSE turns pause mode off | 277 tmode -pause turns pause mode off |
279 TMODE PAUSE turns pause mode on | 278 tmode pause turns pause mode on |
280 </screen> | 279 </screen> |
281 <para> | 280 <para> |
282 The display system also has a complete set of commands to emulate | 281 The display system also has a complete set of commands to emulate |
283 commercial data terminals, plus a complete set of graphics commands. | 282 commercial data terminals, plus a complete set of graphics commands. |
284 These are described in detail in Appendix D. | 283 These are described in detail in Appendix D. |
288 <section> | 287 <section> |
289 <title>Keyboard Shift and Control Functions</title> | 288 <title>Keyboard Shift and Control Functions</title> |
290 <para> | 289 <para> |
291 Two keys are used in combination with other keys to change their | 290 Two keys are used in combination with other keys to change their |
292 meaning. The SHIFT KEY selects between upper case and lower case | 291 meaning. The SHIFT KEY selects between upper case and lower case |
293 letters or punctuation, and the CLEAR key can be used to generate | 292 letters or punctuation, and the &ctrlkey key can be used to generate |
294 control characters . | 293 control characters. |
295 </para> | 294 </para> |
296 <para> | 295 <para> |
297 The keyboard has a shift lock function similar to a typewriter's, | 296 The keyboard has a shift lock function similar to a typewriter's, |
298 which is normally "locked". The keyboard's shift lock may be | 297 which is normally "locked". The keyboard's shift lock may be |
299 reversed by depressing the control key (CLEAR) and 0 keys | 298 reversed by depressing the control key and 0 keys |
300 simultaneously. The shift lock only affects the letter (A-Z) keys. | 299 simultaneously. The shift lock only affects the letter (A-Z) keys. |
301 When the keyboard is locked, these keys generate upper case letters, | 300 When the keyboard is locked, these keys generate upper case letters, |
302 and lower case only if the SHIFT key is depressed. When the | 301 and lower case only if the SHIFT key is depressed. When the |
303 keyboard is unlocked, the reverse is true, e.g., lower case letters | 302 keyboard is unlocked, the reverse is true, e.g., lower case letters |
304 are generated unless the SHIFT key is depressed at the same time as | 303 are generated unless the SHIFT key is depressed at the same time as |
309 <section> | 308 <section> |
310 <title>Control Key Functions</title> | 309 <title>Control Key Functions</title> |
311 <para> | 310 <para> |
312 There are a number of useful control functions that can be | 311 There are a number of useful control functions that can be |
313 generated from the keyboard. Many of these functions use "control | 312 generated from the keyboard. Many of these functions use "control |
314 keys" which are generated by simultaneously depressing the CLEAR key | 313 keys" which are generated by simultaneously depressing the &ctrlkey key |
315 plus some other key. For example, to generate the character for | 314 plus some other key. For example, to generate the character for |
316 CONTROL D press the CLEAR and D keys at the same time. | 315 CONTROL D press the &ctrlkey and D keys at the same time. |
317 </para> | 316 </para> |
318 <variablelist> | 317 <variablelist> |
319 <varlistentry> | 318 <varlistentry> |
320 <term>CONTROL A</term> | 319 <term>CONTROL A</term> |
321 <listitem> | 320 <listitem> |