Mercurial > hg > Members > kono > nitros9-code
annotate docs/nitros9guide/chap2.chapter @ 1093:4dae346c4969
Added crossreferences and lowercased synopsises
author | roug |
---|---|
date | Mon, 07 Apr 2003 21:01:46 +0000 |
parents | f5d45fbe3a76 |
children | 958740284209 |
rev | line source |
---|---|
144 | 1 <chapter> |
2 <title>Basic Interactive Functions</title> | |
3 | |
1093 | 4 <section id="sec2.0"> |
144 | 5 <title>Running Commands and Basic Shell Operation</title> |
6 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
7 The <command>shell</command> is a the part of OS-9 that accepts commands from your |
144 | 8 keyboard. It was designed to provide a convenient, flexible, and |
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 | |
11 started up. You can tell when the shell is waiting for input | |
1011 | 12 because it displays the shell prompt. This prompt indicates that |
144 | 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 | |
15 letters, or a combination of both because OS-9 matches letters of | |
16 either case. | |
17 </para> | |
18 <para> | |
19 The command line always begins with a name of a program which can | |
20 be: | |
21 </para> | |
22 | |
23 <itemizedlist> | |
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> | |
26 <listitem><para>The name of an executable program compiled by a high-level | |
1011 | 27 language such as Basic09, Pascal, Cobol, etc.</para></listitem> |
28 <listitem><para>The name of a procedure file</para></listitem> | |
144 | 29 </itemizedlist> |
30 <para> | |
31 If you're a beginner, you will almost always use the first case, | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
32 which causes the program to be automatically loaded from the |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
33 <filename class="directory">CMDS</filename> directory and run. |
144 | 34 </para> |
35 <para> | |
36 When processing the command line, the shell searches for a | |
37 program having the name specified in the following sequence: | |
38 </para> | |
39 | |
40 <orderedlist numeration="arabic"> | |
41 | |
1011 | 42 <listitem><para> If the program named is already in memory, it is run.</para></listitem> |
144 | 43 |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
44 <listitem><para> The "execution directory", usually <filename class="directory">CMDS</filename>, is searched. |
144 | 45 If a file having the name given is found, it is loaded and |
1011 | 46 run.</para></listitem> |
144 | 47 |
1011 | 48 <listitem><para> The user's "data directory" is searched. If a file having |
144 | 49 the name given is found, it is processed as a "procedure |
50 file" which means that the file is assumed to contain one | |
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> | |
53 | |
54 </orderedlist> | |
55 <para> | |
56 Mention is made above of the "data directory" and the "execution | |
57 directory". At all times each user is associated with two file | |
58 directories. A more detailed explanation of directories is presented | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
59 later. The execution directory (usually <filename class="directory">CMDS</filename>) includes |
144 | 60 files which are executable programs. |
61 </para> | |
62 <para> | |
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 | |
65 the shell. | |
66 </para> | |
67 <para> | |
68 For example, in the command line: | |
69 </para> | |
70 <screen> | |
1011 | 71 list file1 |
144 | 72 </screen> |
73 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
74 the program name is <command>list</command>, and the parameter passed to it is FILE1. |
144 | 75 </para> |
76 <para> | |
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 | |
1011 | 79 input/output files or memory assignments. |
144 | 80 |
81 | |
82 </para> | |
1093 | 83 <section id="sec2.0.1"> |
144 | 84 <title>Sending Output to the Printer</title> |
85 <para> | |
1014
d9ed9d44b70c
Some character entities had missing semicolons. It's &CPU;
roug
parents:
1011
diff
changeset
|
86 Normally, most commands and programs display output on the &make; video display. The output of these programs can |
144 | 87 alternatively be printed by specifying output redirection on the |
88 command line. This is done by including the following modifier to | |
89 at the end of any command line: | |
90 </para> | |
91 <screen> | |
1011 | 92 >/p |
144 | 93 </screen> |
94 <para> | |
1093 | 95 The ">" character tells the shell to redirect output (See <xref linkend="sec4.3.2"/>) to |
1011 | 96 the printer using the &make;'s printer port, which has the device |
1093 | 97 name "/P" (See <xref linkend="sec3.2"/>). For example, to redirect the output of the |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
98 <command>dir</command> command to the printer, enter: |
144 | 99 </para> |
100 <screen> | |
1011 | 101 dir >/p |
144 | 102 </screen> |
103 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
104 The <command>xmode</command> command can be used to set the printer port's |
144 | 105 operating mode such as auto line feed, etc. For example, to examine |
106 the printer's current settings, type: | |
107 </para> | |
108 <screen> | |
1011 | 109 xmode /p |
144 | 110 </screen> |
111 <para> | |
112 To change any of these type XMODE followed by the new value. | |
113 For example, to set the printer port for automatic line feeds at the | |
114 end of every line, enter: | |
115 </para> | |
116 <screen> | |
1011 | 117 xmode /p lf; |
144 | 118 </screen> |
119 </section> | |
120 </section> | |
121 | |
1093 | 122 <section id="sec2.1"> |
144 | 123 <title>Shell Command Line Parameters</title> |
124 <para> | |
125 Parameters are generally used to either specify file name(s) or | |
126 to select options to be used by the program specified in the command | |
127 line given to the shell. Parameters are separated from the command | |
128 name and from each other by space characters (hence parameters and | |
129 options cannot themselves include spaces). Each command program | |
130 supplied with OS-9 has an individual description in the last section | |
131 of this manual which describe the correct usage of the parameters of | |
132 each command. | |
133 </para> | |
134 <para> | |
135 For example, the LIST program is used to display the contents of | |
136 a text file on your display. It is necessary to tell to the LIST | |
137 program which file it is to be displayed, therefore, the name of the | |
138 desired file is given as a parameter in the command line. For | |
139 example, to list the file called startup (the system initialization | |
140 procedure file), you enter the command line: | |
141 </para> | |
142 <screen> | |
1011 | 143 list startup |
144 | 144 </screen> |
145 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
146 Some commands have two parameters. For example, the <command>copy</command> command is |
144 | 147 used to make an exact copy of a file. It requires two parameters: |
148 The name of the file to be copied and the name of the file which is | |
149 to be the copy, for example: | |
150 </para> | |
151 <screen> | |
1011 | 152 copy startup newstartup |
144 | 153 </screen> |
154 <para> | |
155 Other commands have parameters which select options. For example: | |
156 </para> | |
157 <screen> | |
1011 | 158 dir |
144 | 159 </screen> |
160 <para> | |
161 shows the names of the files in the user's data directory. Normally | |
1011 | 162 it simply lists the file names only, but if the "-e" |
144 | 163 (for <emphasis>e</emphasis>ntire) |
164 option is given, it will also give complete statistics for each file | |
165 such as the date and time created, size, security codes, etc. To do | |
166 so enter: | |
167 </para> | |
168 <screen> | |
1011 | 169 dir -e |
144 | 170 </screen> |
171 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
172 The <command>dir</command> command also can accept a file name as a parameter which |
144 | 173 specifies a directory file other than the (default) data directory. |
174 For example, to list file names in the directory sys , type: | |
175 </para> | |
176 <screen> | |
1011 | 177 dir sys |
144 | 178 </screen> |
179 <para> | |
180 It is also possible to specify both a directory name parameter and | |
181 the e option, such as: | |
182 </para> | |
183 <screen> | |
1011 | 184 dir sys -e |
144 | 185 </screen> |
186 <para> | |
1011 | 187 giving file names and complete statistics. |
144 | 188 </para> |
189 </section> | |
190 | |
1093 | 191 <section id="sec2.3"> |
144 | 192 <title>Some Common Command Formats</title> |
193 <para> | |
194 This section is a summary of some commands commonly used by new | |
195 or casual OS-9 users, and some common formats. Each command is | |
196 followed by an example. Refer to the individual command | |
1011 | 197 descriptions later int his book for more detailed information and |
144 | 198 additional examples. Parameters or options shown in brackets are |
199 optional. Whenever a command references a directory file name, the | |
200 file <emphasis>must</emphasis> be a directory file. | |
201 | |
202 <screen> | |
203 CHD filename chd DATA.DIR | |
204 </screen> | |
205 Changes the current <emphasis>data</emphasis> working directory to | |
206 the <emphasis>directory</emphasis> file specified. | |
207 <screen> | |
208 COPY filename1 filename2 copy oldfile newfile | |
209 </screen> | |
210 Creates filename2 as a new file, then copies all data from | |
211 "filename1" to it. "filename1" is not affected. | |
212 <screen> | |
213 DEL filename del oldstuff | |
214 </screen> | |
215 Deletes (destroys) the file specified. | |
216 <screen> | |
1011 | 217 DIR [filename] [-e] [-x] dir myfiles -e |
144 | 218 </screen> |
1017 | 219 List names of files contained in a directory. If the "-x" option is |
144 | 220 used the files in the current <emphasis>execution</emphasis> |
221 directory are listed, | |
222 othervise, if no directory name is given, the current | |
223 <emphasis>data</emphasis> directory will be listed. | |
1017 | 224 The "-e" option selects the long format |
144 | 225 which shows detailed information about each file. |
226 <screen> | |
227 FREE devicename free /d1 | |
228 </screen> | |
229 Shows how much free space remains on the disk whose name is given. | |
230 <screen> | |
231 LIST filename list script | |
232 </screen> | |
233 Displays the (text) contents of the file on the terminal. | |
234 <screen> | |
235 MAKDIR filename makdir NEWFILES | |
236 </screen> | |
237 Creates a new directory file using the name given. Often followed | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
238 by a <command>chd</command> command to make it the new working data directory. |
144 | 239 <screen> |
240 RENAME filename1 filename2 rename zip zap | |
241 </screen> | |
242 Changes the name of filename1 to filename2. | |
243 </para> | |
244 </section> | |
245 | |
1093 | 246 <section id="sec2.4"> |
144 | 247 <title>Using the Keyboard and Video Display</title> |
248 <para> | |
148
525b12e17d60
Made the word "Dragon" an entity, thereby making it replacable with "Color"
roug
parents:
144
diff
changeset
|
249 OS-9 has many features to expand the capability of the &make; |
144 | 250 keyboard and video display. The video display has screen pause, |
251 upper/lower case, and graphics functions. The keyboard can generate | |
252 all ASCII characters and has a type-ahead feature that permits you | |
253 to enter data before requested by a program (except if the disk is | |
1093 | 254 running because interrupts are temporarily disabled). |
255 <xref linkend="video-display"/> of | |
144 | 256 this manual is a list of the characters and codes that can be |
257 generated from the keyboard. The keyboard/video display can be used | |
258 as a file known by the name "/TERM". | |
259 </para> | |
260 | |
261 <section> | |
262 <title>Video Display Functions</title> | |
263 <para> | |
1011 | 264 The &make; uses reverse video (green letters in a black box) to |
144 | 265 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: | |
267 </para> | |
268 <screen> | |
1011 | 269 tmode -upc |
144 | 270 </screen> |
271 <para> | |
272 The screen pause feature stops programs after 16 lines have been | |
273 displayed. Output will continue if you hit any key. Normally this | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
274 feature is on. It can be turned on or off with the <command>tmode</command> command as |
144 | 275 follows: |
276 </para> | |
277 <screen> | |
1011 | 278 tmode -pause turns pause mode off |
279 tmode pause turns pause mode on | |
144 | 280 </screen> |
281 <para> | |
282 The display system also has a complete set of commands to emulate | |
283 commercial data terminals, plus a complete set of graphics commands. | |
1093 | 284 These are described in detail in <xref linkend="key-definitions"/>. |
144 | 285 </para> |
286 </section> | |
287 | |
288 <section> | |
289 <title>Keyboard Shift and Control Functions</title> | |
290 <para> | |
291 Two keys are used in combination with other keys to change their | |
292 meaning. The SHIFT KEY selects between upper case and lower case | |
1014
d9ed9d44b70c
Some character entities had missing semicolons. It's &CPU;
roug
parents:
1011
diff
changeset
|
293 letters or punctuation, and the &ctrlkey; key can be used to generate |
1011 | 294 control characters. |
144 | 295 </para> |
296 <para> | |
297 The keyboard has a shift lock function similar to a typewriter's, | |
298 which is normally "locked". The keyboard's shift lock may be | |
1092 | 299 reversed by depressing the control key and <keycap>0</keycap> keys |
144 | 300 simultaneously. The shift lock only affects the letter (A-Z) keys. |
301 When the keyboard is locked, these keys generate upper case letters, | |
302 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 | |
304 are generated unless the SHIFT key is depressed at the same time as | |
305 a letter key. | |
306 </para> | |
307 </section> | |
308 | |
1093 | 309 <section id="sec2.4.3"> |
144 | 310 <title>Control Key Functions</title> |
311 <para> | |
312 There are a number of useful control functions that can be | |
313 generated from the keyboard. Many of these functions use "control | |
1014
d9ed9d44b70c
Some character entities had missing semicolons. It's &CPU;
roug
parents:
1011
diff
changeset
|
314 keys" which are generated by simultaneously depressing the &ctrlkey; key |
144 | 315 plus some other key. For example, to generate the character for |
1092 | 316 <keycap>CONTROL</keycap> <keycap>D</keycap> press the &ctrlkey; and <keycap>D</keycap> keys at the same time. |
144 | 317 </para> |
318 <variablelist> | |
319 <varlistentry> | |
1092 | 320 <term><keycombo action="simul"> |
321 <keycap>CONTROL</keycap> <keycap>A</keycap></keycombo></term> | |
144 | 322 <listitem> |
323 <para> | |
324 Repeat previous input line. The last line entered will be redisplayed but | |
325 <emphasis>not</emphasis> processed, with the cursor positioned at the end of | |
326 the line. You may hit return to enter the line, or edit the line by | |
327 backspacing, typing over characters to correct them, and entering | |
328 control A again to redisplay the edited line. | |
329 </para> | |
330 </listitem> | |
331 </varlistentry> | |
332 <varlistentry> | |
1092 | 333 <term><keycombo action="simul"> |
334 <keycap>CONTROL</keycap> <keycap>D</keycap></keycombo></term> | |
144 | 335 <listitem> |
336 <para> | |
337 Redisplay present input on next line. | |
338 </para> | |
339 </listitem> | |
340 </varlistentry> | |
341 <varlistentry> | |
1092 | 342 <term><keycombo action="simul"> |
343 <keycap>CONTROL</keycap> <keycap>W</keycap></keycombo></term> | |
144 | 344 <listitem> |
345 <para> | |
346 Display Wait - This will temporarily halt output to the display so | |
347 the screen can be read before the data scrolls off. Output is | |
348 resumed when any other key is hit. | |
349 </para> | |
350 </listitem> | |
351 </varlistentry> | |
352 <varlistentry> | |
1092 | 353 <term><keycombo action="simul"> |
354 <keycap>CONTROL</keycap> <keycap>0</keycap></keycombo></term> | |
144 | 355 <listitem> |
356 <para> | |
357 Shift lock. Reverses present shift lock state. | |
358 </para> | |
359 </listitem> | |
360 </varlistentry> | |
361 <varlistentry> | |
1092 | 362 <term><keycap>BREAK</keycap> (or <keycombo action="simul"> |
363 <keycap>CONTROL</keycap> <keycap>E</keycap></keycombo>)</term> | |
144 | 364 <listitem> |
365 <para> | |
366 Program abort - Stops the current running program | |
367 </para> | |
368 </listitem> | |
369 </varlistentry> | |
370 <varlistentry> | |
1092 | 371 <term><keycombo action="simul"> |
372 <keycap>SHIFT</keycap> <keycap>BREAK</keycap></keycombo> (or <keycombo action="simul"> | |
373 <keycap>CONTROL</keycap> <keycap>C</keycap></keycombo>)</term> | |
144 | 374 <listitem> |
375 <para> | |
376 Interrupt - Reactivates Shell while keeping program running as | |
377 background task. | |
378 </para> | |
379 </listitem> | |
380 </varlistentry> | |
381 <varlistentry> | |
1092 | 382 <term><keycombo action="simul"> |
383 <keycap>CONTROL</keycap> <keycap>BREAK</keycap></keycombo> (<keycap>ESCAPE</keycap>)</term> | |
144 | 384 <listitem> |
385 <para> | |
386 End-of-File - This key is used to send an end-of-file to programs | |
387 that read input from the terminal in place of a disk or tape file. | |
388 It must be the first character on the line in order for it to be | |
389 recognized. | |
390 </para> | |
391 </listitem> | |
392 </varlistentry> | |
393 <varlistentry> | |
1092 | 394 <term><keycap>LEFT ARROW</keycap> (OR <keycombo action="simul"> |
395 <keycap>CONTROL</keycap> <keycap>H</keycap></keycombo>)</term> | |
144 | 396 <listitem> |
397 <para> | |
398 Backspace - erase previous character | |
399 </para> | |
400 </listitem> | |
401 </varlistentry> | |
402 <varlistentry> | |
1092 | 403 <term><keycombo action="simul"> |
404 <keycap>SHIFT</keycap> <keycap>LEFT ARROW</keycap></keycombo> (or <keycombo action="simul"> | |
405 <keycap>CONTROL</keycap> <keycap>X</keycap></keycombo>)</term> | |
144 | 406 <listitem> |
407 <para> | |
408 Line Delete - erases the entire current line. | |
409 </para> | |
410 </listitem> | |
411 </varlistentry> | |
412 </variablelist> | |
413 </section> | |
414 </section> | |
415 | |
416 </chapter> |