Commit | Line | Data |
---|---|---|
a4ed1c04 BJ |
1 | .af PN i |
2 | .pn 5 | |
3 | .de IR | |
4 | \fI\\$1\^\fR\\$2 | |
5 | .. | |
6 | .de RI | |
7 | \fR\\$1\fI\\$2\^\fR\\$3 | |
8 | .. | |
9 | .TL | |
10 | INTRODUCTION TO VOLUME 1 | |
11 | .LP | |
12 | This volume gives descriptions of the publicly available | |
13 | features of the | |
14 | .UX \s-2/32V\s0 | |
15 | system, | |
16 | as extended to provide a virtual memory environment | |
17 | and other enhancements | |
18 | at U. C. Berkeley. | |
19 | It does not attempt to provide perspective or tutorial | |
20 | information upon the | |
21 | .UX | |
22 | operating system, | |
23 | its facilities, or its implementation. | |
24 | Various documents on those topics are contained in | |
25 | Volume 2. | |
26 | In particular, | |
27 | for an overview see `The | |
28 | .UX | |
29 | Time-Sharing System' | |
30 | by Ritchie and Thompson; for a tutorial see | |
31 | `\s8UNIX\s10 for Beginners' by Kernighan, | |
32 | and for an guide to the new features of this virtual version, see | |
33 | `Getting started with Berkeley Software for \s8UNIX\s10 on the \s8VAX\s10' | |
34 | in volume 2c. | |
35 | .LP | |
36 | Within the area it surveys, this volume attempts | |
37 | to be timely, complete and concise. | |
38 | Where the latter two objectives conflict, | |
39 | the obvious is often left unsaid in favor of brevity. | |
40 | It is intended that each program be described | |
41 | as it is, not as it should be. | |
42 | Inevitably, this means that | |
43 | various sections will soon be out of date. | |
44 | .LP | |
45 | The volume is divided into | |
46 | eight sections: | |
47 | .DS | |
48 | 1. Commands | |
49 | 2. System calls | |
50 | 3. Subroutines | |
51 | 4. Special files | |
52 | 5. File formats and conventions | |
53 | 6. Games | |
54 | 7. Macro packages and language conventions | |
55 | 8. Maintenance | |
56 | .DE | |
57 | Commands are programs intended to be invoked directly by | |
58 | the user, in contradistinction to subroutines, which are | |
59 | intended to be called by the user's programs. | |
60 | Commands generally reside in directory | |
61 | .I /bin | |
62 | (for | |
63 | .IR bin \|ary | |
64 | programs). | |
65 | Some programs also reside in | |
66 | .I | |
67 | /\|usr/\|bin, | |
68 | .R | |
69 | or in | |
70 | .I | |
71 | /\|usr/\|ucb, | |
72 | .R | |
73 | to save space in | |
74 | .I /bin. | |
75 | These directories are searched automatically by the command interpreters. | |
76 | .LP | |
77 | System calls are entries into the | |
78 | .UX | |
79 | supervisor. | |
80 | The system call interface is identical to a C language | |
81 | procedure call; the equivalent C procedures are described in Section 2. | |
82 | .LP | |
83 | An assortment | |
84 | of subroutines is available; | |
85 | they are described in section 3. | |
86 | The primary libraries in which they are kept are described in | |
87 | .IR intro (3). | |
88 | The functions are described in terms of C, but most will | |
89 | work with Fortran as well. | |
90 | .LP | |
91 | The special files section 4 discusses the characteristics of | |
92 | each system `file' that actually refers to an I/O device. | |
93 | The names in this | |
94 | section refer to the DEC device names for the | |
95 | hardware, | |
96 | instead of the names of | |
97 | the special files themselves. | |
98 | .LP | |
99 | The file formats and conventions section 5 documents the structure of particular | |
100 | kinds of files; for example, the form of the output of the loader and | |
101 | assembler is given. Excluded are files used by only one command, | |
102 | for example the assembler's intermediate files. | |
103 | .LP | |
104 | Games have been relegated to section 6 to keep them from contaminating | |
105 | the more staid information of section 1. | |
106 | .LP | |
107 | Section 7 is a miscellaneous collection of information necessary to | |
108 | writing in various specialized languages: | |
109 | character codes, | |
110 | macro packages for typesetting, | |
111 | etc. | |
112 | .LP | |
113 | The maintenance | |
114 | section 8 discusses procedures not intended | |
115 | for use by the ordinary user. | |
116 | These procedures often involve use of commands | |
117 | of section 1, where an attempt has been made to | |
118 | single out peculiarly maintenance-flavored commands | |
119 | by marking them 1M. | |
120 | .LP | |
121 | Each section consists of a number of independent | |
122 | entries of a page or so each. | |
123 | The name of the entry is in the upper corners of its pages, | |
124 | together with the section number, and sometimes a | |
125 | letter characteristic of a subcategory, e.g. graphics is 1G, | |
126 | and the math library is 3M. | |
127 | Entries within each section are | |
128 | alphabetized. | |
129 | The page numbers of each entry start at 1; | |
130 | it is infeasible to number consecutively the pages of | |
131 | a document like this that is republished in many variant forms. | |
132 | .LP | |
133 | All entries are based on a common format, | |
134 | not all of whose subsections will always appear. | |
135 | .RS | |
136 | .LP | |
137 | The | |
138 | .I name | |
139 | subsection lists the exact names of the commands and subroutines | |
140 | covered under the entry and gives | |
141 | a very short description of their purpose. | |
142 | .LP | |
143 | The | |
144 | .IR synopsis "" | |
145 | summarizes the use of the | |
146 | program being described. | |
147 | A few conventions are used, particularly in the | |
148 | Commands subsection: | |
149 | .LP | |
150 | .RS | |
151 | .B Boldface | |
152 | words are considered literals, and | |
153 | are typed just as they appear. | |
154 | .LP | |
155 | Square brackets [ ] around an argument | |
156 | indicate that the argument is optional. | |
157 | When an argument is given as `name', it always | |
158 | refers to a file name. | |
159 | .LP | |
160 | Ellipses `.\|.\|.' are used to show that the previous argument-prototype | |
161 | may be repeated. | |
162 | .LP | |
163 | A final convention is used by the commands themselves. | |
164 | An argument beginning with a minus sign `\-' | |
165 | is often taken to mean some sort of option-specifying argument | |
166 | even if it appears in a position where a file name | |
167 | could appear. Therefore, it is unwise to have files | |
168 | whose names begin with `\-'. | |
169 | .LP | |
170 | .RE | |
171 | The | |
172 | .IR description "" | |
173 | subsection discusses in detail the subject at hand. | |
174 | .LP | |
175 | The | |
176 | .IR files "" | |
177 | subsection gives the names of files which are | |
178 | built into the program. | |
179 | .LP | |
180 | A | |
181 | .I | |
182 | see also | |
183 | .R | |
184 | subsection gives pointers to related information. | |
185 | .LP | |
186 | A | |
187 | .I diagnostics | |
188 | subsection discusses | |
189 | the diagnostic indications which may be produced. | |
190 | Messages which are intended to be self-explanatory | |
191 | are not listed. | |
192 | .LP | |
193 | The | |
194 | .IR bugs "" | |
195 | subsection gives | |
196 | known bugs and sometimes deficiencies. | |
197 | Occasionally also the suggested fix is | |
198 | described. | |
199 | .LP | |
200 | In section 2 an | |
201 | .I assembler | |
202 | subsection carries the PDP-11 assembly-language system interface. | |
203 | .LP | |
204 | .RE | |
205 | At the beginning of the volume is a table of contents, | |
206 | organized by section and alphabetically within each section. | |
207 | There is also a permuted index derived from the table of contents. | |
208 | Within each index entry, the title | |
209 | of the writeup to which | |
210 | it refers is followed by the appropriate section number in parentheses. | |
211 | This fact is important because there is considerable | |
212 | name duplication among the sections, | |
213 | arising principally from commands which | |
214 | exist only to exercise a particular system call. | |
215 | .SH | |
216 | HOW TO GET STARTED | |
217 | .LP | |
218 | This section sketches the basic information | |
219 | you need to get started on | |
220 | .UX | |
221 | how to log in and log out, | |
222 | how to communicate through your terminal, | |
223 | and how to run a program. | |
224 | See `\c | |
225 | .UX | |
226 | for Beginners' | |
227 | in Volume 2 for a more complete introduction | |
228 | to the system. | |
229 | .LP | |
230 | .I | |
231 | Logging in.\ \ | |
232 | .R | |
233 | You must call | |
234 | .UX | |
235 | from an appropriate terminal. | |
236 | .UX | |
237 | terminals are typified by the TTY 43, | |
238 | the Decwriter II, the DASI 300S and 450, and most | |
239 | video terminals such as | |
240 | the ADM-3A, HP 2621, or Concept 100. | |
241 | You must also have a valid user name, | |
242 | which may be obtained, together with the telephone number, from the system administrators. | |
243 | The same telephone number | |
244 | serves terminals operating at all the standard speeds. | |
245 | After a data connection is established, | |
246 | the login procedure depends on what kind of terminal | |
247 | you are using. | |
248 | .I | |
249 | .I | |
250 | .R | |
251 | .R | |
252 | .LP | |
253 | .I | |
254 | 300-baud terminals:\ \ | |
255 | .R | |
256 | Such terminals include the GE Terminet 300, and | |
257 | most display terminals | |
258 | run with popular modems. | |
259 | These terminals generally have a speed | |
260 | switch which should be set at `300' (or `30' for | |
261 | 30 characters per second) | |
262 | and a half/full duplex switch which should be set at | |
263 | full-duplex. | |
264 | (This switch will often have to be changed | |
265 | since many other systems require half-duplex). | |
266 | When a connection is established, the system | |
267 | types `login:'; you type your | |
268 | user name, followed by the `return' key. | |
269 | If you have a password, the system asks for it | |
270 | and turns off the printer on the terminal | |
271 | so the password will not appear. | |
272 | After you have logged in, | |
273 | the `return', `new line', or `linefeed' keys | |
274 | will give exactly the same results. | |
275 | .LP | |
276 | .I | |
277 | 1200- and 150-baud terminals:\ \ | |
278 | .R | |
279 | If there is a half/full duplex switch, set it at full-duplex. | |
280 | When you have established a data connection, | |
281 | the system types out a few garbage characters | |
282 | (the `login:' message at the wrong speed). | |
283 | Depress the `break' (or `interrupt') | |
284 | key; this is a speed-independent signal | |
285 | to | |
286 | .UX | |
287 | that a different speed terminal | |
288 | is in use. | |
289 | The system then will type `login:,' this time at another | |
290 | speed. | |
291 | Continue depressing the break key | |
292 | until `login:' appears in clear, then | |
293 | respond with your user name. | |
294 | From the TTY 37 terminal, and any other which has the `newline' | |
295 | function (combined carriage return and linefeed), terminate each line you type with the | |
296 | `new line' key, | |
297 | otherwise use the `return' key. | |
298 | .LP | |
299 | .I | |
300 | Hard-wired terminals.\ \ | |
301 | .R | |
302 | Hard-wired terminals usually begin at the right | |
303 | speed, up to 9600 baud; otherwise the preceding instructions | |
304 | apply. | |
305 | .LP | |
306 | For all these terminals, it is important | |
307 | that you type your name in lower-case if possible; if you type | |
308 | upper-case letters, | |
309 | .UX | |
310 | will assume that your terminal cannot generate lower-case | |
311 | letters and will translate all subsequent upper-case | |
312 | letters to lower case. | |
313 | .LP | |
314 | The evidence that you have successfully | |
315 | logged in is that a shell program | |
316 | will type a prompt (`$' or `%') to you. | |
317 | (The shells are described below under | |
318 | `How to run a program.') | |
319 | .LP | |
320 | For more information, consult | |
321 | .IR tset (1), | |
322 | and | |
323 | .IR stty (1), | |
324 | which tell how to adjust terminal behavior, | |
325 | .IR getty (8), | |
326 | which discusses the login sequence in more | |
327 | detail, and | |
328 | .IR tty (4), | |
329 | which discusses terminal I/O. | |
330 | .LP | |
331 | .I | |
332 | Logging out.\ \ | |
333 | .R | |
334 | There are three ways to log out: | |
335 | .IP | |
336 | You can simply hang up the phone. | |
337 | .IP | |
338 | You can log out by typing an end-of-file indication | |
339 | (EOT character, control-d) to the Shell. | |
340 | The Shell will terminate and the `login: ' message | |
341 | will appear again. | |
342 | .IP | |
343 | You can also log in directly as another user | |
344 | by giving a | |
345 | .IR login (1) | |
346 | command. | |
347 | .LP | |
348 | .I | |
349 | How to communicate through your terminal.\ \ | |
350 | .R | |
351 | When you type characters, a gnome deep in the system | |
352 | gathers your characters and saves them in a secret | |
353 | place. | |
354 | The | |
355 | characters will not be given to a program | |
356 | until you type a return (or newline), as described above | |
357 | in | |
358 | .I | |
359 | Logging in. | |
360 | .R | |
361 | .LP | |
362 | .UX | |
363 | terminal I/O is full-duplex. | |
364 | It has full read-ahead, which means that you can | |
365 | type at any time, | |
366 | even while a program is | |
367 | typing at you. | |
368 | Of course, if you type during output, the printed output will | |
369 | have the input characters interspersed. | |
370 | However, whatever you type will be saved | |
371 | up and interpreted in correct sequence. | |
372 | There is a limit to the amount of read-ahead, | |
373 | but it is generous and not likely to be exceeded unless | |
374 | the system is in trouble. | |
375 | When the read-ahead limit is exceeded, the system | |
376 | throws away all the saved characters. | |
377 | .LP | |
378 | The character `@' in typed input | |
379 | kills all the preceding characters in the line, so | |
380 | typing mistakes | |
381 | can be repaired on a single line. | |
382 | Also, the character `#' erases the last character typed. | |
383 | (Most users prefer to use a backspace rather than `#', | |
384 | and many prefer control X instead of `@'; | |
385 | .IR tset (1) | |
386 | or | |
387 | .IR stty (1) | |
388 | can be used to arrange this.) | |
389 | Successive uses of `#' erase characters back to, but | |
390 | not beyond, the beginning of the line. | |
391 | `@' and `#' can be transmitted to a program | |
392 | by preceding them with `\\'. | |
393 | (So, to erase `\\', you need two `#'s). | |
394 | .LP | |
395 | The `break' or `interrupt' key causes an | |
396 | .I | |
397 | interrupt signal, | |
398 | .R | |
399 | as does the | |
400 | \s8ASCII\s10 `delete' (or `rubout') character, | |
401 | which is not passed to programs. | |
402 | This signal | |
403 | generally causes whatever program | |
404 | you are running to terminate. | |
405 | It is typically used to stop a long printout that | |
406 | you don't want. | |
407 | However, programs can arrange either to ignore | |
408 | this signal altogether, | |
409 | or to be notified when it happens (instead | |
410 | of being terminated). | |
411 | The editor, for example, catches interrupts and | |
412 | stops what it is doing, | |
413 | instead of terminating, so that an interrupt can | |
414 | be used to halt an editor printout without | |
415 | losing the file being edited. | |
416 | .LP | |
417 | The | |
418 | .IR quit "" | |
419 | signal is generated | |
420 | by typing the \s8ASCII\s10 FS character. | |
421 | (FS appears many places on different terminals, most commonly | |
422 | as control-\e or control-\^|\^.) | |
423 | It not only causes a running program to terminate | |
424 | but also generates a file with the core image | |
425 | of the terminated process. | |
426 | Quit is useful | |
427 | for debugging. | |
428 | .LP | |
429 | Besides adapting to the speed of the terminal, | |
430 | .UX | |
431 | tries to be intelligent about whether | |
432 | you have a terminal with the newline function | |
433 | or whether it must be simulated with carriage-return | |
434 | and line-feed. | |
435 | In the latter case, all input carriage returns | |
436 | are turned to newline characters (the standard | |
437 | line delimiter) | |
438 | and both a carriage return and a line feed | |
439 | are echoed to the terminal. | |
440 | If you get into the wrong mode, the | |
441 | .IR reset (1) | |
442 | command will rescue you. | |
443 | .LP | |
444 | Tab characters are used freely in | |
445 | .UX | |
446 | source programs. | |
447 | If your terminal does not have the tab function, | |
448 | you can arrange to have them turned into spaces | |
449 | during output, and echoed as spaces | |
450 | during input. | |
451 | The system assumes | |
452 | that tabs are set every eight columns. | |
453 | Again, the | |
454 | .IR tset (1) | |
455 | or | |
456 | .IR stty (1) | |
457 | command will set or reset this mode. | |
458 | .IR Tset (1) | |
459 | can be used to set the tab stops automatically when necessary. | |
460 | .LP | |
461 | .I | |
462 | How to run a program; the shells.\ \ | |
463 | .R | |
464 | When you have successfully logged in, a program | |
465 | called a shell is listening to your terminal. | |
466 | The shell reads typed-in lines, splits them up | |
467 | into a command name and arguments, and executes the command. | |
468 | A command is simply an executable program. | |
469 | The Shell looks in several system directories to find the command. You can also | |
470 | place commands in your own directory and have the shell find them there. | |
471 | There is nothing special about system-provided | |
472 | commands except that they are kept in a directory | |
473 | where the shell can find them. | |
474 | .LP | |
475 | The command name is always the first word on an input line; | |
476 | it and its arguments are separated from one another by | |
477 | spaces. | |
478 | .LP | |
479 | When a program terminates, the shell will ordinarily regain control and type | |
480 | a prompt at you to indicate that it is ready for another command. | |
481 | .LP | |
482 | The shells have many other capabilities, which are described in detail in | |
483 | sections | |
484 | .IR sh (1) | |
485 | and | |
486 | .IR csh (1). | |
487 | If the shell prompts you with `$', then it is an instance of | |
488 | .IR sh (1) | |
489 | the standard Bell-labs provided shell. | |
490 | If it prompts with `%' then it is an instance of | |
491 | .IR csh (1) | |
492 | a shell written at Berkeley. | |
493 | The shells are different for all but the most simple terminal usage. | |
494 | Most users at Berkeley choose | |
495 | .IR csh (1) | |
496 | because of the | |
497 | .I history | |
498 | mechanism and the | |
499 | .I alias | |
500 | feature, which greatly enhance its power when used interactively. | |
501 | .LP | |
502 | You can change from one shell to the other by using the | |
503 | .I chsh (1) | |
504 | command, which takes effect at your next login. | |
505 | .LP | |
506 | .I | |
507 | The current directory.\ \ | |
508 | .R | |
509 | .UX | |
510 | has a file system arranged in a hierarchy of directories. | |
511 | When the system administrator gave you a user name, | |
512 | he also created a directory for you (ordinarily | |
513 | with the same name as your user name). | |
514 | When you log in, any file | |
515 | name you type is by default | |
516 | in this directory. | |
517 | Since you are the owner of this directory, you have | |
518 | full permission to read, write, alter, or destroy | |
519 | its contents. | |
520 | Permissions to have your will with other directories | |
521 | and files will have been granted or denied to you | |
522 | by their owners. | |
523 | As a matter of observed fact, few | |
524 | .UX | |
525 | users | |
526 | protect their files from destruction, | |
527 | let alone perusal, by other users. | |
528 | .LP | |
529 | To change the | |
530 | current directory (but not the set of permissions you | |
531 | were endowed with at login) use | |
532 | .IR cd (1). | |
533 | .LP | |
534 | .I | |
535 | Path names.\ \ | |
536 | .R | |
537 | To refer to files not in the current directory, you must | |
538 | use a path name. | |
539 | Full path names begin with `/', the name of the root directory of the | |
540 | whole file system. | |
541 | After the slash comes the name of each directory containing the next | |
542 | sub-directory (followed by a `/') until finally the | |
543 | file name is reached. | |
544 | For example, | |
545 | .I | |
546 | /\^usr/\^lem/\^filex | |
547 | .R | |
548 | refers to the file | |
549 | .I | |
550 | filex | |
551 | .R | |
552 | in the directory | |
553 | .I | |
554 | lem; lem | |
555 | .R | |
556 | is itself a subdirectory of | |
557 | .I | |
558 | usr; usr | |
559 | .R | |
560 | springs directly from the root directory. | |
561 | .LP | |
562 | If your current directory has subdirectories, | |
563 | the path names of files therein begin with | |
564 | the name of the subdirectory with no prefixed `/'. | |
565 | .LP | |
566 | A path name may be used anywhere a file name is | |
567 | required. | |
568 | .LP | |
569 | Important commands which modify the contents of files | |
570 | are | |
571 | .IR cp (1), | |
572 | .IR mv (1), | |
573 | and | |
574 | .IR rm (1), | |
575 | which respectively copy, move (i.e. rename) and remove files. | |
576 | To find out the status of files or directories, use | |
577 | .IR ls (1). | |
578 | See | |
579 | .IR mkdir (1) | |
580 | for making directories and | |
581 | .I | |
582 | rmdir | |
583 | .R | |
584 | (in | |
585 | .IR rm (1)) | |
586 | for destroying them. | |
587 | .LP | |
588 | For a fuller discussion of the file system, see | |
589 | `The | |
590 | .UX | |
591 | Time-Sharing System,' | |
592 | by Ken Thompson and Dennis Ritchie. | |
593 | It may also be useful to glance through | |
594 | section 2 of this manual, which discusses | |
595 | system calls, even if you don't intend | |
596 | to deal with the system at that level. | |
597 | .LP | |
598 | .I | |
599 | Writing a program.\ \ | |
600 | .R | |
601 | To enter the text of a source program into a | |
602 | .UX | |
603 | file, use | |
604 | the editor | |
605 | .IR ex (1) | |
606 | or its display editing alias | |
607 | .IR vi (1). | |
608 | (The standard editor | |
609 | .IR ed (1) | |
610 | is also available.) | |
611 | The principal languages in | |
612 | .UX | |
613 | are | |
614 | provided by the C compiler | |
615 | .IR cc (1), | |
616 | the Fortran compiler | |
617 | .IR f77 (1), | |
618 | the Pascal interpreter | |
619 | .IR pi (1), px (1), | |
620 | the Lisp system | |
621 | .IR lisp (1), | |
622 | and the APL system | |
623 | .IR apl (1). | |
624 | After the program text has been entered through | |
625 | the editor | |
626 | and written on a file, you can give the file | |
627 | to the appropriate language processor as an argument. | |
628 | The output of the language processor | |
629 | will be left on a file in the current directory named `a.out'. | |
630 | (If the output is precious, use | |
631 | .I mv | |
632 | to move it to a less | |
633 | exposed name soon.)\ | |
634 | .LP | |
635 | When you have finally gone through this entire process | |
636 | without provoking any diagnostics, the resulting program | |
637 | can be run by giving its name to the shell | |
638 | in response to the shell (`$' or `%') prompt. | |
639 | .LP | |
640 | Your programs can receive arguments from the command line | |
641 | just as system programs do, | |
642 | see | |
643 | .IR exec (2). | |
644 | .LP | |
645 | .I | |
646 | Text processing.\ \ | |
647 | .R | |
648 | Almost all text is entered through the editor | |
649 | .IR ex (1) | |
650 | (often entered via | |
651 | .IR vi (1)). | |
652 | The commands most often used to write text on a terminal are: | |
653 | .I | |
654 | cat, pr, more | |
655 | .R | |
656 | and | |
657 | .I nroff, | |
658 | all in section 1. | |
659 | .LP | |
660 | The | |
661 | .I cat | |
662 | command simply dumps \s8ASCII\s10 text | |
663 | on the terminal, with no processing at all. | |
664 | The | |
665 | .IR pr "" | |
666 | command paginates the text, supplies headings, | |
667 | and has a facility for multi-column output. | |
668 | .I | |
669 | Nroff | |
670 | .R | |
671 | is an elaborate text formatting program. | |
672 | Used naked, it requires careful forethought, but for | |
673 | ordinary documents it has been tamed; | |
674 | see | |
675 | .IR me (7) | |
676 | and | |
677 | .IR ms (7). | |
678 | .I | |
679 | .LP | |
680 | .I Troff | |
681 | prepares documents for a | |
682 | Graphics Systems phototypesetter or a Versatec Plotter; | |
683 | it is very similar to | |
684 | .I nroff, | |
685 | and often works from exactly the same | |
686 | source text. | |
687 | It was used to produce this manual. | |
688 | .LP | |
689 | .IR Script (1) | |
690 | lets you keep a record of your session in a file, | |
691 | which can then be printed, mailed, etc. | |
692 | It provides the advantages of a hard-copy terminal | |
693 | even when using a display terminal. | |
694 | .LP | |
695 | .IR More (1) | |
696 | is useful for preventing the output of a command from | |
697 | zipping off the top of your screen. | |
698 | It is also well suited to perusing files. | |
699 | .LP | |
700 | .I | |
701 | Status inquiries.\ \ | |
702 | .R | |
703 | Various commands exist to provide you with useful | |
704 | information. | |
705 | .IR w (1) | |
706 | prints a list of users presently logged in, | |
707 | and what they are doing. | |
708 | .IR date (1) | |
709 | prints the current time and date. | |
710 | .IR ls (1) | |
711 | will list the files in your directory or give | |
712 | summary information about particular files. | |
713 | .LP | |
714 | .I | |
715 | Surprises.\ \ | |
716 | .R | |
717 | Certain commands provide inter-user communication. | |
718 | Even if you do not plan to use them, it would be | |
719 | well to learn something about them, because someone else may | |
720 | aim them at you. | |
721 | .LP | |
722 | To communicate with another user currently logged in, | |
723 | .IR write (1) | |
724 | is used; | |
725 | .IR mail (1) | |
726 | will leave a message whose presence will be announced | |
727 | to another user when he next logs in. | |
728 | The write-ups in the manual also suggest how to respond to | |
729 | the two commands if you are a target. | |
730 | .LP | |
731 | When you log in, a message-of-the-day may greet you | |
732 | before the first prompt. | |
733 | .SH | |
734 | CONVERTING FROM THE 6TH EDITION | |
735 | .LP | |
736 | There follows a catalogue of significant, mostly incompatible, | |
737 | changes that will affect old users converting from the sixth edition | |
738 | on a PDP-11. | |
739 | No attempt is made to list all new facilities, or even all | |
740 | minor, but easily spotted changes, | |
741 | just the bare essentials without which it will be | |
742 | almost impossible to do anything. | |
743 | .LP | |
744 | .I | |
745 | Addressing files.\ \ | |
746 | .R | |
747 | Byte addresses in files are now long (32-bit) integers. | |
748 | Accordingly | |
749 | .I seek | |
750 | has been replaced by | |
751 | .IR lseek (2). | |
752 | Every program that contains a | |
753 | .I seek | |
754 | must be modified. | |
755 | .I Stat | |
756 | and | |
757 | .IR fstat (2) | |
758 | have been affected similarly, since file lengths are now | |
759 | 32- rather than 24-bit quantities. | |
760 | .LP | |
761 | .I | |
762 | Assembly language.\ \ | |
763 | .R | |
764 | This language is dead. Necromancy will be severely punnished. | |
765 | .LP | |
766 | .I Stty | |
767 | and | |
768 | .I gtty.\ \ | |
769 | .R | |
770 | These system calls have been extensively altered, | |
771 | see | |
772 | .IR ioctl (2) | |
773 | and | |
774 | .IR tty (4). | |
775 | .LP | |
776 | .I | |
777 | C language, lint.\ \ | |
778 | .R | |
779 | The syntax for initialization | |
780 | requires an equal sign = before an initializer, | |
781 | and brackets { } around compound initial values; | |
782 | arrays and structures are now initialized honestly. | |
783 | Assignment operators such as =+ and =\- | |
784 | are now written in the reverse order: +=, \-=. This removes the possibility | |
785 | of ambiguity in constructs such as x=\-2, y=*p, and a=/*b. | |
786 | You will also certainly want to learn about | |
787 | .DS | |
788 | long integers | |
789 | type definitions | |
790 | casts (for type conversion) | |
791 | unions (for more honest storage sharing) | |
792 | #include <filename> (which searches in standard places) | |
793 | .DE | |
794 | .LP | |
795 | The program | |
796 | .IR lint (1) | |
797 | checks for obsolete syntax and | |
798 | does strong type checking of C programs, singly | |
799 | or in groups that are expected to be loaded together. | |
800 | It is indispensable for conversion work. | |
801 | .LP | |
802 | .I Fortran.\ \ | |
803 | The old | |
804 | .I fc | |
805 | is replaced by | |
806 | .I f77, | |
807 | a true compiler for Fortran 77, | |
808 | compatible with C. | |
809 | There are substantial changes in the language; | |
810 | see `A Portable Fortran 77 Compiler' in Volume 2. | |
811 | .LP | |
812 | .I | |
813 | Stream editor.\ \ | |
814 | .R | |
815 | The program | |
816 | .IR sed (1) | |
817 | is adapted to massive, repetitive | |
818 | editing jobs of the sort encountered in converting to | |
819 | the new system. | |
820 | It is well worth learning. | |
821 | .LP | |
822 | .I | |
823 | Standard I/O.\ \ | |
824 | .R | |
825 | The old | |
826 | .I | |
827 | fopen, getc, putc | |
828 | .R | |
829 | complex and the old | |
830 | .I \-lp | |
831 | package are both dead, | |
832 | and even | |
833 | .I getchar | |
834 | has changed. | |
835 | All have been replaced by the clean, highly efficient, | |
836 | .IR stdio (3) | |
837 | package. | |
838 | The first things to know are that | |
839 | .IR getchar (3) | |
840 | returns the integer EOF (\-1) (which is not a possible byte value) | |
841 | on end of file, that 518-byte buffers are out, and that there | |
842 | is a defined FILE data type. | |
843 | .LP | |
844 | .I Make.\ \ | |
845 | The program | |
846 | .IR make (1) | |
847 | handles the recompilation and loading of | |
848 | software in an orderly way from | |
849 | a `makefile' recipe given for each piece of software. | |
850 | It remakes only as much as the modification dates of the input files | |
851 | show is necessary. | |
852 | The makefiles will guide you in building your new system. | |
853 | .LP | |
854 | .I | |
855 | Shell, chdir.\ \ | |
856 | .R | |
857 | F. L. Bauer once said Algol 68 is the Everest that | |
858 | must be climbed by every computer scientist because | |
859 | it is there. | |
860 | So it is with the shell for | |
861 | .UX | |
862 | users. | |
863 | Everything beyond simple command invocation from a terminal is | |
864 | different. | |
865 | Even | |
866 | .I chdir | |
867 | is now spelled | |
868 | .I cd. | |
869 | If you wish to use | |
870 | .I sh | |
871 | (as opposed to | |
872 | .IR csh ) | |
873 | then you will want to study | |
874 | .IR sh (1) | |
875 | long and hard. | |
876 | .LP | |
877 | .I "C shell" .\ \ | |
878 | .IR Csh (1), | |
879 | developed at Berkeley, | |
880 | has features comparible to | |
881 | .IR sh . | |
882 | It includes a history mechanism that saves you from retyping all or part | |
883 | of previous commands, as well as an efficient aliasing (macro) mechanism. | |
884 | These features make | |
885 | .I csh | |
886 | pleasent to use interactively. | |
887 | .I Csh | |
888 | programs have a syntax reminiscent of | |
889 | .I C, | |
890 | while | |
891 | .I sh | |
892 | command programs have a syntax reminiscent of \s-2ALGOL\s0-68. | |
893 | .LP | |
894 | .I Debugging.\ \ | |
895 | .IR Sdb (1) | |
896 | is a far more capable replacement for the debugger | |
897 | .I cdb, | |
898 | and debugs C and Fortran at the source level. | |
899 | For machine language debugging, | |
900 | .I adb | |
901 | replaces | |
902 | .I db. | |
903 | The first-time user should be especially careful about | |
904 | distinguishing / and ? in | |
905 | .I adb | |
906 | commands, and watching to make sure that the | |
907 | .I x | |
908 | whose value he asked for is the real | |
909 | .I x, | |
910 | and not just some absolute location equal to the stack offset | |
911 | of some automatic | |
912 | .I x. | |
913 | You can always use the `true' name, | |
914 | .I _x, | |
915 | to pin down a C external variable. | |
916 | .LP | |
917 | .I Dsw. | |
918 | This little-known, but indispensable facility has been | |
919 | taken over by | |
920 | .I | |
921 | rm \-ri. | |
922 | .LP | |
923 | .I | |
924 | Boot procedures.\ \ | |
925 | .R | |
926 | Needless to say, these are all different. | |
927 | See section 8 of this volume, and | |
928 | `Setting up \s8UNIX\s10' in Volume 2. |