home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man0 / basinf next >
Encoding:
Text File  |  1975-06-26  |  11.8 KB  |  383 lines

  1. .tr |
  2. .bp
  3. .ce
  4. HOW TO GET STARTED
  5. .sp 1.5
  6. This section provides the basic information
  7. you need to get started on \s8UNIX\s10:
  8. how to log in and log out,
  9. how to communicate through your terminal,
  10. and how to run a program.
  11. See ``U\s8NIX\s10 for Beginners''
  12. by Brian W. Kernighan for a more complete introduction
  13. to the system.
  14. .pg
  15. .ft I
  16. Logging in.||
  17. .ft R
  18. You must call \s8UNIX\s10 from an appropriate terminal.
  19. \s8UNIX\s10 supports \s8ASCII\s10 terminals typified by the \s8TTY\s10 37,
  20. the GE Terminet 300, the Dasi 300, and various
  21. graphical terminals.
  22. You must also have a valid user name,
  23. which may be obtained, together with the telephone number, from the system administrators.
  24. The same telephone number
  25. serves terminals operating at all the standard speeds.
  26. After a data connection is established,
  27. the login procedure depends on what kind of terminal
  28. you are using.
  29. .pg
  30. .in .5i
  31. .ul
  32. 300-baud terminals:||
  33. Such terminals include the GE Terminet 300, most display terminals,
  34. Execuport, TI, GSI, and certain
  35. Anderson-Jacobson terminals.
  36. These terminals generally have a speed
  37. switch which should be set at ``300'' (or ``30'' for
  38. 30 characters per second)
  39. and a half/full duplex switch which should be set at
  40. full-duplex.
  41. (This switch will often have to be changed
  42. since many other systems require half-duplex).
  43. When a connection is established, the system
  44. types ``login:''; you type your
  45. user name, followed by the ``return'' key.
  46. If you have a password, the system asks for it
  47. and turns off the printer on the terminal
  48. so the password will not appear.
  49. After you have logged in,
  50. the ``return'', ``new line'', or ``linefeed'' keys
  51. will give exactly the same results.
  52. .pg
  53. .ul
  54. \s8TTY\s10 37 terminal:||
  55. When you have established a data connection,
  56. the system types out a few garbage characters
  57. (the ``login:'' message at the wrong speed).
  58. Depress the ``break'' (or ``interrupt'')
  59. key; this is a speed-independent signal
  60. to \s8UNIX\s10 that a 150-baud terminal
  61. is in use.
  62. The system then will type ``login:,'' this time at the correct
  63. speed;
  64. you respond with your user name.
  65. From the \s8TTY\s10 37 terminal, and any other which has the ``new-line''
  66. function (combined carriage return and linefeed), terminate each line you type with the
  67. ``new-line'' key
  68. (\fInot\fR the ``return'' key).
  69. .pg
  70. .in 0
  71. For all these terminals, it is important
  72. that you type your name in lower-case if possible; if you type
  73. upper-case letters, \s8UNIX\s10
  74. will assume that your terminal cannot generate lower-case
  75. letters and will translate all subsequent upper-case
  76. letters to lower case.
  77. .pg
  78. The evidence that you have successfully
  79. logged in is that the Shell program
  80. will type a ``%'' to you.
  81. (The Shell is described below under
  82. ``How to run a program.'')
  83. .pg
  84. For more information, consult
  85. \fIgetty\fR (VIII), which discusses the login sequence in more
  86. detail, and \fItty\fR (IV), which discusses typewriter I/O.
  87. .pg
  88. .ul
  89. Logging out.||
  90. There are three ways to log out:
  91. .pg
  92. .in .5i
  93. You can simply hang up the phone.
  94. .pg
  95. You can log out by typing an end-of-file indication
  96. (EOT character, control ``d'') to the Shell.
  97. The Shell will terminate and the ``login: '' message
  98. will appear again.
  99. .pg
  100. You can also log in directly as another user
  101. by giving a \fIlogin\fR command (I).
  102. .pg
  103. .in 0
  104. .ul
  105. How to communicate through your terminal.||
  106. When you type to \s8UNIX\s10, a gnome deep in the system
  107. is gathering your characters and saving them in a secret
  108. place.
  109. The
  110. characters will not be given to a program
  111. until you type a return (or new-line), as described above
  112. in
  113. .ul
  114. Logging in.
  115. .pg
  116. \s8UNIX\s10 typewriter I/O is full-duplex.
  117. It has full read-ahead, which means that you can
  118. type at any time,
  119. even while a program is
  120. typing at you.
  121. Of course, if you type during output, the output will
  122. have the input characters interspersed.
  123. However, whatever you type will be saved
  124. up and interpreted in correct sequence.
  125. There is a limit to the amount of read-ahead,
  126. but it is generous and not likely to be exceeded unless
  127. the system is in trouble.
  128. When the read-ahead limit is exceeded, the system
  129. throws away all the saved characters.
  130. .pg
  131. On a typewriter input line, the character ``@''
  132. kills all the characters typed before it, so typing mistakes
  133. can be repaired on a single line.
  134. Also, the character ``#'' erases the last character typed.
  135. Successive uses of ``#'' erase characters back to, but
  136. not beyond, the beginning of the line.
  137. ``@'' and ``#'' can be transmitted to a program
  138. by preceding them with ``\\''.
  139. (So, to erase ``\\'', you need two ``#''s).
  140. .pg
  141. The \s8ASCII\s10 ``delete'' (a.k.a. ``rubout'') character is not passed to programs
  142. but instead generates
  143. an
  144. .ul
  145. interrupt signal.
  146. This signal
  147. generally causes whatever program
  148. you are running to terminate.
  149. It is typically used to stop a long printout that
  150. you don't want.
  151. However, programs can arrange either to ignore
  152. this signal altogether,
  153. or to be notified when it happens (instead
  154. of being terminated).
  155. The editor, for example, catches interrupts and
  156. stops what it is doing,
  157. instead of terminating, so that an interrupt can
  158. be used to halt an editor printout without
  159. losing the file being edited.
  160. .pg
  161. The \fIquit\fR signal is generated
  162. by typing the \s8ASCII\s10 FS character.
  163. It not only causes a running program to terminate
  164. but also generates a file with the core image
  165. of the terminated process.
  166. Quit is useful
  167. for debugging.
  168. .pg
  169. Besides adapting to the speed of the terminal,
  170. \s8UNIX\s10 tries to be intelligent about whether
  171. you have a terminal with the new-line function
  172. or whether it must be simulated with carriage-return
  173. and line-feed.
  174. In the latter case, all input carriage returns
  175. are turned to new-line characters (the standard
  176. line delimiter)
  177. and both a carriage return and a line feed
  178. are echoed to the terminal.
  179. If you get into the wrong mode, the \fIstty\fR command
  180. (I) will rescue you.
  181. .pg
  182. Tab characters are used freely in \s8UNIX\s10 source programs.
  183. If your terminal does not have the tab function,
  184. you can arrange to have them turned into spaces
  185. during output, and echoed as spaces
  186. during input.
  187. The system assumes
  188. that tabs are set every eight columns.
  189. Again, the \fIstty\fR command (I)
  190. will set or reset this mode.
  191. Also, there is a file which, if printed on \s8TTY\s10 37
  192. or TermiNet 300 terminals, will set the tab stops
  193. correctly (\fItabs\fR (V)).
  194. .pg
  195. Section \fItty\fR (IV) discusses typewriter I/O more fully.
  196. .pg
  197. .ul
  198. How to run a program; the Shell.||
  199. When you have successfully logged into \s8UNIX\s10, a program
  200. called the Shell is listening to your terminal.
  201. The Shell reads typed-in lines, splits them up
  202. into a command name and arguments, and executes the command.
  203. A command is simply an executable program.
  204. The Shell looks first in your current directory
  205. (see next section)
  206. for a program with the given name,
  207. and if none is there, then in a system directory.
  208. There is nothing special about system-provided
  209. commands except that they are kept in a directory
  210. where the Shell can find them.
  211. .pg
  212. The command name is always the first word on an input line;
  213. it and its arguments are separated from one another by
  214. spaces.
  215. .pg
  216. When a program terminates, the Shell will ordinarily regain control and type 
  217. a ``%'' at you to indicate that it is ready for another command.
  218. .pg
  219. The Shell has many other capabilities, which are described in detail in section
  220. \fIsh\fR\|(I).
  221. .pg
  222. .ul
  223. The current directory.||
  224. \s8UNIX\s10 has a file system arranged in a hierarchy of directories.
  225. When the system administrator gave you a user name,
  226. he also created a directory for you (ordinarily
  227. with the same name as your user name).
  228. When you log in, any file
  229. name you type is by default
  230. in this directory.
  231. Since you are the owner of this directory, you have
  232. full permissions to read, write, alter, or destroy
  233. its contents.
  234. Permissions to have your will with other directories
  235. and files will have been granted or denied to you
  236. by their owners.
  237. As a matter of observed fact, few \s8UNIX\s10 users
  238. protect their files from destruction,
  239. let alone perusal, by other users.
  240. .pg
  241. To change the
  242. current directory (but not the set of permissions you
  243. were endowed with at login) use \fIchdir\fR (I).
  244. .pg
  245. .ul
  246. Path names.||
  247. To refer to files not in the current directory, you must
  248. use a path name.
  249. Full path names begin with ``/'', the name of the root directory of the
  250. whole file system.
  251. After the slash comes the name of each directory containing the next
  252. sub-directory (followed by a ``/'') until finally the
  253. file name is reached.
  254. E.g.:
  255. .ul
  256. /\|usr/\|lem/\|filex
  257. refers to the file
  258. .ul
  259. filex
  260. in the directory
  261. .ul
  262. lem; lem
  263. is itself a subdirectory of
  264. .ul
  265. usr; usr
  266. springs directly from the root directory.
  267. .pg
  268. If your current directory has subdirectories,
  269. the path names of files therein begin with
  270. the name of the subdirectory (no prefixed ``/'').
  271. .pg
  272. Without important exception,
  273. a path name may be used anywhere a file name is
  274. required.
  275. .pg
  276. Important commands which modify the contents of files
  277. are \fIcp\fR (I), \fImv\fR (I), and \fIrm\fR (I),
  278. which respectively copy, move (i.e. rename) and remove files.
  279. To find out the status of files or directories, use \fIls\fR (I).
  280. See \fImkdir\fR (I) for making directories; \fIrmdir\fR (I) for destroying them.
  281. .pg
  282. For a fuller discussion of the file system, see
  283. ``The \s8UNIX\s10 Time-Sharing System,''
  284. by the present authors.
  285. It may also be useful to glance through
  286. section II of this manual, which discusses
  287. system calls, even if you don't intend
  288. to deal with the system at that level.
  289. .pg
  290. .ul
  291. Writing a program.||
  292. To enter the text of a source program into a \s8UNIX\s10 file, use \fIed\fR (I).
  293. The three principal languages in \s8UNIX\s10 are
  294. assembly language (see \fIas\fR (I)), Fortran (see \fIfc\fR (I)),
  295. and C (see \fIcc\fR (I)).
  296. After the program text has been entered through 
  297. the editor
  298. and written on a file, you can give the file
  299. to the appropriate language processor as an argument.
  300. The output of the language processor
  301. will be left on a file in the current directory named ``a.out''.
  302. (If the output is precious, use \fImv\fR to move it to a less
  303. exposed name soon.)|
  304. If you wrote in assembly language, you will probably
  305. need to load the program with library subroutines; see
  306. \fIld \fR(I).  The other two language processors call
  307. the loader automatically.
  308. .pg
  309. When you have finally gone through this entire process
  310. without provoking any diagnostics, the resulting program
  311. can be run by giving its name to the Shell
  312. in response to the ``%'' prompt.
  313. .pg
  314. Next, you will need \fIcdb\fR (I) or \fIdb\fR (I) to
  315. examine the remains of your program.
  316. The former is useful for C programs, the latter
  317. for assembly-language.
  318. No debugger is much help for Fortran.
  319. .pg
  320. Your programs can receive arguments from the command line
  321. just as system programs do.
  322. See \fIexec\fR (II).
  323. .pg
  324. .ul
  325. Text processing.||
  326. Almost all text is entered through the editor.
  327. The commands most often used to write text on a terminal are:
  328. .ul
  329. cat, pr, roff, nroff,
  330. and
  331. .ul
  332. troff,
  333. all in section I.
  334. .pg
  335. The \fIcat\fR command simply dumps \s8ASCII\s10 text
  336. on the terminal, with no processing at all.
  337. The \fIpr\fR command paginates the text, supplies headings,
  338. and has a facility for multi-column output.
  339. .ul
  340. Troff
  341. and
  342. .ul
  343. nroff
  344. are elaborate text formatting programs,
  345. and require careful forethought
  346. in entering both the text and the formatting commands
  347. into the input file.
  348. .ul
  349. Troff
  350. drives a Graphic Systems phototypesetter;
  351. it was used to produce this manual.
  352. .ul
  353. Nroff
  354. produces output on a typewriter terminal.
  355. .ul
  356. Roff
  357. (I)
  358. is a somewhat less elaborate text formatting
  359. program, and requires somewhat less forethought.
  360. .pg
  361. .ul
  362. Surprises.||
  363. Certain commands provide inter-user communication.
  364. Even if you do not plan to use them, it would be
  365. well to learn something about them, because someone else may
  366. aim them at you.
  367. .pg
  368. To communicate with another user currently logged in,
  369. .ul
  370. write
  371. (I)
  372. is used;
  373. .ul
  374. mail
  375. (I)
  376. will leave a message whose presence will be announced
  377. to another user when he next logs in.
  378. The write-ups in the manual also suggest how to respond to
  379. the two commands if you are a target.
  380. .pg
  381. When you log in, a message-of-the-day may greet you
  382. before the first ``%''.
  383.