home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / minix / 5086 / man2.Z / man2
Encoding:
Text File  |  1993-01-07  |  97.5 KB  |  2,894 lines

  1. echo x - m4
  2. sed '/^X/s///' > m4 << '/'
  3. X.CD "m4 \(en macro processor"
  4. X.SX "m4\fR [\fB\(enD \fIname\fR = \fIvalue\fR]\fR [\fB\(enU \fIname\fR] 
  5. X.FL "\(enD" "Define a symbol"
  6. X.FL "\(enU" "Undefine a symbol"
  7. X.EY "m4 <m4test" "Run M4"
  8. X.PP
  9. X\fIM4\fR is a general-purpose macro processor.
  10. XIt is described in Chap. 9.
  11. XIt has been used to implement programming languages, such as RATFOR.
  12. X
  13. X
  14. X
  15. /
  16. echo x - maccreate
  17. sed '/^X/s///' > maccreate << '/'
  18. X.CD "maccreate \(en create an empty macintosh file [MACINTOSH]"
  19. X.SX "maccreate \fInblocks\fR \fIfile\fR"
  20. X.FL "\fR(none)"
  21. X.EX "maccreate 512 vol:dir:file" "Create a 512K file"
  22. X.PP
  23. X.I Maccreate
  24. Xwill create a Macintosh file that can serve as a
  25. X.MX
  26. Xdisk partition. Also see the descriptions of hdopen and hdclose.
  27. X
  28. X
  29. X
  30. /
  31. echo x - macfile
  32. sed '/^X/s///' > macfile << '/'
  33. X.CD "macfile \(en list, read and write Macintosh volumes [MACINTOSH]"
  34. X.SX "macfile\fR [\fB\(enRadlrw\fR] [\fIfile\fR]"
  35. X.FL "\(enR" "Recursively descend directories when listing them"
  36. X.FL "\(ena" "Read or write ASCII file"
  37. X.FL "\(end" "Directory list"
  38. X.FL "\(enl" "Use long format for directory listing"
  39. X.FL "\(enr" "Read a \s-2Macintosh\s0 file into \s-2MINIX\s0"
  40. X.FL "\(enw" "Write a \s-2MINIX\s0" file to a \s-2Macintosh\s0 volume"
  41. X.EX "macfile \(endl" "List mounted volumes"
  42. X.EX "macfile \(endl vol:dir" "Long listing of the specified directory"
  43. X.EX "macfile \(enr dir:file >adv" "Read file \fIfile\fR into adv"
  44. X.EX "macfile \(enwa f" "Copy ASCII \fIstdin\fR to file \fIf\fR"
  45. X.PP
  46. X.I Macfile
  47. Xuses the Macintosh ROM to transfer files between the
  48. Xnormal Macintosh operating system and \s-2MINIX\s0.
  49. XIt can list volumes, directories and read and write files.
  50. XWhen the ASCII flag is specified, the
  51. X.MX
  52. Xnew line character is mapped onto
  53. Xthe Macintosh line feed character.
  54. X.I Macfile
  55. Xmay be linked to
  56. X.I macdir ,
  57. X.I macread
  58. Xand
  59. X.I macwrite ,
  60. Xin which case the \fB\(end\fR, \fB\(enr\fR, and \fB\(enw\fR flags are not
  61. Xneeded.
  62. X
  63. X
  64. X
  65. X.SP -0.5
  66. /
  67. echo x - macread
  68. sed '/^X/s///' > macread << '/'
  69. X.CD "macread \(en read a Macintosh file [MACINTOSH]"
  70. X.SX "macread\fR [\fB\(ena\fR] \fIfile\fR"
  71. X.EX "macread dir:file >adv" "Copy file \fIfile\fR into adv"
  72. X.EX "macread \(ena dir:file >adv" "Copy ascii file \fIfile\fR onto stdout"
  73. X.FL "\(ena" "Read an ASCII file"
  74. X.PP
  75. X.I Macread
  76. Xuses the Macintosh ROM to copy a
  77. XMacintosh operating system file to standard output.
  78. XWhen the ASCII flag is specified, the
  79. XMacintosh line feed character
  80. Xis mapped onto
  81. Xthe
  82. X.MX
  83. Xnew line character.
  84. X.I Macread
  85. Xis a link to
  86. X.I macfile.
  87. X
  88. X
  89. X
  90. X.SP -0.5
  91. /
  92. echo x - macros
  93. sed '/^X/s///' > macros << '/'
  94. X.de CD
  95. X.ne 2
  96. X.if t .ta 0.9i 1.15i 2.75i 3.25i 3.75i
  97. X.if n .ta 11m 15m 40m
  98. X.nr x 0 0
  99. X.nr y 0 0
  100. X.nr z 0 0
  101. X.if n #\\$1
  102. X.if n .br
  103. X\\fBCommand:\&    \\$1\\fR
  104. X.br
  105. X..
  106. X.de SX
  107. X.if \\nx<=0 \\fBSyntax:\&    \\$1
  108. X.if \\nx>0 \&    \\fB\\$1
  109. X.nr x 1 1
  110. X.br
  111. X..
  112. X.de FL
  113. X.if \\ny<=0 \\fBFlags:\&    \\fB\\$1    \\fR\\$2
  114. X.if \\ny>0 \&     \\fB\\$1    \\fR\\$2
  115. X.nr y 1 1
  116. X.br
  117. X..
  118. X.de EX
  119. X.br
  120. X.nf
  121. X.if \\nz<=0 \\fB\&Examples:    \\fR\\$1    \\fR# \\$2
  122. X.if \\nz>0 \&    \\fR\\$1    \\fR# \\$2
  123. X.nr z 1 1
  124. X.br
  125. X..
  126. X.de EY
  127. X.br
  128. X.nf
  129. X.if \\nz<=0 \\fB\&Example:    \\fR\\$1    \\fR# \\$2
  130. X.if \\nz>0 \&    \\fR\\$1    \\fR# \\$2
  131. X.nr z 1 1
  132. X.br
  133. X..
  134. X
  135. /
  136. echo x - macwrite
  137. sed '/^X/s///' > macwrite << '/'
  138. X.CD "macwrite \(en write a Macintosh file [MACINTOSH]"
  139. X.SX "macwrite\fR [\fB\(ena\fR] \fIfile\fR"
  140. X.EX "macwrite dir:file <adv" "Copy file adv to mac file \fIfile\fR"
  141. X.EX "macwrite \(ena dir:file" "Copy stdin to mac file \fIfile\fR"
  142. X.FL "\(ena" "Write an ASCII file"
  143. X.PP
  144. X.I Macwrite
  145. Xuses the Macintosh ROM to copy standard input into the
  146. Xthe named Macintosh file.
  147. XWhen the ASCII flag is specified, the
  148. X.MX
  149. Xnew line character
  150. Xis mapped onto the
  151. XMacintosh line feed character.
  152. XThe file is created if it doesn't exist, or is overwritten if it does.
  153. XOnce the file is written you can set the type and creator
  154. Xflags with the \fIsettype\fR command.
  155. X.I Macwrite
  156. Xis a link to
  157. X.I macfile.
  158. X
  159. X
  160. X
  161. X.SP 1
  162. /
  163. echo x - mail
  164. sed '/^X/s///' > mail << '/'
  165. X.CD "mail \(en send and receive electronic mail"
  166. X.SX "mail\fR [\fB\(endpqrv\fR]\fR [\fB\(enf \fIfile\fR] [\fIuser\fR]
  167. X.FL "\(end" "Force use of the shell variable \fIMAILER\fR"
  168. X.FL "\(enf" "Use \fIfile\fR instead of \fI/usr/spool/mail/user\fR as mailbox"
  169. X.FL "\(enp" "Print all mail and then exit"
  170. X.FL "\(enq" "Quit program if SIGINT received"
  171. X.FL "\(enr" "Reverse print order, i.e., print oldest first"
  172. X.FL "\(env" "Verbose mode"
  173. X.EX "mail ast" "Send a message to \fIast\fR"
  174. X.EX "mail" "Read your mail"
  175. X.PP
  176. X\fIMail\fR is an extremely simple electronic mail program.  It can be used
  177. Xto send or receive email on a single 
  178. X.MX 
  179. Xsystem, in which case it functions
  180. Xas user agent and local delivery agent.  
  181. XIf the flag \fIMAILER\fR is defined in \fImail.c\fR,
  182. Xit can also call a trans\%port agent to handle remote mail as well.
  183. XNo such agent is supplied with
  184. X.MX .
  185. X.PP
  186. XWhen called by \fIuser\fR with no arguments, it examines the mailbox
  187. X\fI/usr/spool/mail/user\fR, prints one message (depending on the \fB\(enr\fR
  188. Xflag), and waits for one of the following commands:
  189. X.SP 1
  190. X.HS
  191. X.nf
  192. X.ta 0.25i 1.25i
  193. X    <newline>    Go to the next message
  194. X    \(en    Print the previous message
  195. X    !command    Fork off a shell and execute \fIcommand\fR
  196. X    CTRL-D    Update the mailbox and quit (same as q)
  197. X    d    Delete the current message and go to the next one
  198. X    q    Update the mailbox and quit (same as CTRL-D)
  199. X    p    Print the current message again
  200. X    s [\fIfile\fR]    Save message in the named file
  201. X    x    Exit without updating the mailbox
  202. X.HS
  203. X.PP
  204. X.SP 1
  205. XTo send mail, the program is called with the name of the recipient as an
  206. Xargument.  The mail is sent, along with a postmark line containing the date.
  207. XFor local delivery, a file named after the recipient in the directory
  208. X\fI/usr/spool/mail\fR must be writable.
  209. X
  210. X
  211. X
  212. /
  213. echo x - make
  214. sed '/^X/s///' > make << '/'
  215. X.CD "make \(en a program for maintaining large programs"
  216. X.SX "make\fR [\fB\(enf \fIfile\fR]\fR [\fB\(eniknpqrst\fR] [\fIoption\fR] ... [\fItarget\fR]
  217. X.FL "\(enf" "Use \fIfile\fP as the makefile"
  218. X.FL "\(eni" "Ignore status returned by commands"
  219. X.FL "\(enk" "On error, skip to next command"
  220. X.FL "\(enn" "Report, but do not execute"
  221. X.FL "\(enp" "Print macros and targets"
  222. X.FL "\(enq" "Question up-to-dateness of target"
  223. X.FL "\(enr" "Rule inhibit; do not use default rules"
  224. X.FL "\(ens" "Silent mode"
  225. X.FL "\(ent" "Touch files instead of making them"
  226. X.EX "make kernel" "Make \fIkernel\fP up to date"
  227. X.EX "make \(enn \(enf mfile" "Tell what needs to be done"
  228. X.PP
  229. X.I Make
  230. Xis a program that is normally used for developing large programs consisting of
  231. Xmultiple files.
  232. XIt keeps track of which object files depend on which source and header files.
  233. XWhen called, it does the minimum amount of recompilation to bring the target
  234. Xfile up to date.
  235. X.PP
  236. XThe file dependencies are expected in 
  237. X.I makefile
  238. Xor
  239. X.I Makefile ,
  240. Xunless another file is specified with \fB\(enf\fR.
  241. X.I Make
  242. Xhas some default rules built in, for example, it knows how to make 
  243. X.I .s
  244. Xfiles
  245. Xfrom 
  246. X.I .c
  247. Xfiles.
  248. XHere is a sample 
  249. X.I makefile .
  250. X.HS
  251. X.nf
  252. X.ta 0.25i 1.0i 3.0i
  253. X    d=/user/ast        # \fId\fP is a macro
  254. X    program:    head.s tail.s    # \fIprogram\fR depends on these
  255. X        cc \(eno program head.s tail.s    # tells how to make \fIprogram\fP 
  256. X        echo Program done.    # announce completion
  257. X    head.s:    $d/def.h head.c    # \fIhead.s\fP depends on these
  258. X.br
  259. X    tail.s:    $d/var.h tail.c    # \fItail.s\fP depends on these
  260. X.HS
  261. X.fi
  262. XA complete description of \fImake\fR would require too much space here.
  263. XMany books on
  264. X.UX
  265. Xdiscuss
  266. X.I make .
  267. XStudy the numerous \fIMakefiles\fR in the 
  268. X.MX
  269. Xsource tree for examples.
  270. X
  271. X
  272. X
  273. /
  274. echo x - man
  275. sed '/^X/s///' > man << '/'
  276. X.CD "man \(en display manual page"
  277. X.SX "man\fR [\fIman_directory\fR]\fR [\fIdigit\fR] [\fIname\fR] ...
  278. X.FL "\fR(none)"
  279. X.EX "man" "Display main index"
  280. X.EX "man cdiff" "Display man page for \fIcdiff\fR program"
  281. X.EX "man 2 fork" "Display man page for \fIfork\fR system call"
  282. X.EX "man 3" "Display the part 3 man pages"
  283. X.PP
  284. X\fIMan\fR is a program that displays manual pages.
  285. XWhen called with a program name, it displays the manual page for that
  286. Xprogram.
  287. XWhen the digit \fIk\fR is given as an argument, the file \fI/usr/man/man\fRk
  288. Xis used instead of the default, \fI/usr/man/man1\fR.
  289. XWhen no name is given (or just a digit), the list of valid entries is
  290. Xdisplayed.
  291. XThe arrows can be used to select an entry, and <return> can be used to
  292. Xdisplay the selected entry.
  293. X\fIQ\fR or \fIq\fR leaves the program.
  294. XA directory name can be given to override the use of \fI/usr/man\fR.
  295. XSince all the manual pages are provided in printed format, to save diskette
  296. Xspace, no manual pages are provided on diskette.
  297. XThus \fIman\fR is primarily useful for your own documentation.
  298. X
  299. X
  300. X
  301. X.SP 1
  302. /
  303. echo x - master
  304. sed '/^X/s///' > master << '/'
  305. X.CD "master \(en control the creation of shervers [IBM]"
  306. X.SX "master \fIcount \fIuid \fIgid \fIcommand"
  307. X.FL "\fR(none)"
  308. X.EY "master 2 1 1 /bin/sherver port" "Start 2 shervers"
  309. X.PP
  310. XIf a machine is intended to be used as a server, its \fI/etc/rc\fR 
  311. Xfile should
  312. Xhave a command similar to the example above.  When the system is booted, 
  313. X\fImaster\fR runs and forks off the required number of shervers (shell
  314. Xservers), up to a maximum of four.
  315. XThey run with the indicated uid and gid, and listen to the indicated port.  
  316. XWhen an \fIrsh\fR is done
  317. Xon a client machine, the command is given to one of the shervers for execution.
  318. XWhen the sherver is done, it exits, \fImaster\fR, which is always running, 
  319. Xsees this,
  320. Xand creates a new sherver.  
  321. XThus \fImaster\fR is analogous to \fIinit\fR, only it makes
  322. Xnew shervers (usually) instead of new \fIlogin\fR programs.  
  323. X\fIMaster\fR must run as root to be able to do setuid and setgid.
  324. X
  325. X
  326. X.SP 1
  327. /
  328. echo x - mdb
  329. sed '/^X/s///' > mdb << '/'
  330. X.CD "mdb \(en Minix debugger [68000]"
  331. X.SX "mdb \fIexecutable\fR"
  332. X.FL "\fR(none)"
  333. X.EY "mdb /usr/bin/ls" "Invoke the debugger on the \fIls\fR program"
  334. X.PP
  335. X.I Mdb
  336. Xprovides a means of debugging
  337. X.MX
  338. Xprograms. 
  339. XIt supports symbolic debugging. 
  340. XThe argument,
  341. X.I executable ,
  342. Xis a 
  343. X.MX
  344. Xexecutable file. 
  345. XIf no file is specified the default is \fIa.out\fR.
  346. XA description of the commands is given in Chap. 9.
  347. X
  348. X
  349. X
  350. X.SP 1
  351. /
  352. echo x - megartc
  353. sed '/^X/s///' > megartc << '/'
  354. X.CD "megartc \(en set date from real time clock [Mega ST]"
  355. X.SX "megartc [\(end]"
  356. X.FL "\(end" "output some debugging information"
  357. X.EY "megartc" "Set the date from the Mega ST real time clock"
  358. X.PP
  359. X.I Megartc
  360. Xreads the current date and time from the battery powered real
  361. Xtime clock in the Mega ST and sets the
  362. X.MX 
  363. Xtime accordingly.
  364. X
  365. X
  366. X
  367. /
  368. echo x - mined
  369. sed '/^X/s///' > mined << '/'
  370. X.CD "mined \(en \*(M2 editor"
  371. X.SX "mined\fR [\fIfile\fR]
  372. X.FL "\fR(none)"
  373. X.EX "mined /user/ast/book.3" "Edit an existing file"
  374. X.EX "mined" "Call editor to create a new file"
  375. X.EX "ls \(enl | mined" "Use \fImined\fR as a pager to inspect listing"
  376. X.PP
  377. X.I Mined
  378. X(pronounced min-ed) is a simple full-screen editor.
  379. XWhen editing a file, it holds the file in memory, thus speeding up
  380. Xediting, but limiting the editor to files of up to about 35K.
  381. XLarger files must first be cut into pieces by
  382. X.I split .
  383. XLines may be arbitrarily long.
  384. XOutput from a command may be piped into
  385. X.I mined
  386. Xso it can be viewed without scrolling off the screen.
  387. XSee also Chap. 9.
  388. X
  389. X
  390. X
  391. /
  392. echo x - minimacros
  393. sed '/^X/s///' > minimacros << '/'
  394. X.de CD
  395. X.ne 2
  396. X.if t .ta 0.9i 1.15i 2.75i 3.25i 3.75i
  397. X.if n .ta 11m 15m 40m
  398. X.nr x 0 0
  399. X.nr y 0 0
  400. X.nr z 0 0
  401. X.if n #\\$1
  402. X.if n .br
  403. X\\fBCommand:\&    \\$1\\fR
  404. X.br
  405. X..
  406. X.de SX
  407. X.if \\nx<=0 \\fBSyntax:\&    \\$1
  408. X.if \\nx>0 \&    \\fB\\$1
  409. X.nr x 1 1
  410. X.br
  411. X..
  412. X.de FL
  413. X.if \\ny<=0 \\fBFlags:\&    \\fB\\$1    \\fR\\$2
  414. X.if \\ny>0 \&     \\fB\\$1    \\fR\\$2
  415. X.nr y 1 1
  416. X.br
  417. X..
  418. X.de EX
  419. X.br
  420. X.nf
  421. X.if \\nz<=0 \\fB\&Examples:    \\fR\\$1    \\fR# \\$2
  422. X.if \\nz>0 \&    \\fR\\$1    \\fR# \\$2
  423. X.nr z 1 1
  424. X.br
  425. X..
  426. X.de EY
  427. X.br
  428. X.nf
  429. X.if \\nz<=0 \\fB\&Example:    \\fR\\$1    \\fR# \\$2
  430. X.if \\nz>0 \&    \\fR\\$1    \\fR# \\$2
  431. X.nr z 1 1
  432. X.br
  433. X..
  434. X
  435. /
  436. echo x - minix
  437. sed '/^X/s///' > minix << '/'
  438. X.CD "minix \(en \*(M2 bootstrap [AMIGA]"
  439. X.SX "minix \fR [\fB\(ene \fRadr] [\fB\(enf \fRadr] [\fB\(enk \fRfile] [\fB\(enl \fRadr] [\fB\(enm \fRadr] [\fB\(enn \fRadr] [\fB\(enq \fRfreq]"
  440. X.br
  441. X.ti 1.45i
  442. X[\fB\(enr \fRrate] [\fB\(ens \fRadr] [\fB\(ent \fRfreq] [\fB\(en?]"
  443. X.FL "\(ene" "Kernel execute address (default: kernel destination address)"
  444. X.FL "\(enf" "Font data e.g. $fc1234 (default: romfont)"
  445. X.FL "\(enk" "Kernel image data file (default: \fIminix.img\fR)"
  446. X.FL "\(enl" "Kernel image already loaded, at given address"
  447. X.FL "\(enm" "Address of 256K memory chunk you want to include in list"
  448. X.FL "\(enn" "Address of 256K memory chunk you want to exclude from list"
  449. X.FL "\(enq" "Set keyboard repeat speed, default=15 Hz"
  450. X.FL "\(enr" "Set diskette seek rate (default: 4000 \(*msec)"
  451. X.FL "\(ens" "Kernel destination address (default: $000200)"
  452. X.FL "\(ent" "Set clock freq (default: PAL=7093790 Hz, NTSC=7159090 Hz)"
  453. X.FL "\(en?" "Display this message"
  454. X.EX "minix" "Boot \*(M2 from the default \fIminix.img\fRfile"
  455. X.EX "minix \(enm $300000" "Add a 256K RAM block at $300000 and boot"
  456. X.EX "minix \(ent 7093700" "Set a slightly lower clock rate and then boot"
  457. X.PP
  458. XThe casual user will (should) probably never use most of these options,
  459. Xbut they might be helpful for development purposes. 
  460. XIf you do not know what you are doing, do not use these options; wait until you
  461. Xhave become an expert.
  462. X
  463. X
  464. X
  465. /
  466. echo x - mkdir
  467. sed '/^X/s///' > mkdir << '/'
  468. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  469. X.CD "mkdir \(en make a directory"
  470. X.SX "mkdir [\fB\(enp\fR] [\fB\(enm \fImode\fR] \fIdirectory ..."
  471. X.FL "\(enm" "Create directory with mode"
  472. X.FL "\(enp" "Create missing intermediate directories"
  473. X.EX "mkdir dir" "Create \fIdir\fP in the current directory"
  474. X.EX "mkdir \(enp /user/ast/dir" "Create the \fI/user/ast\fP and \fI/user/ast/dir\fP"
  475. X.PP
  476. XThe specified directory or directories are created and initialized. If any
  477. Xintermediate directory is missing and \fB(enp\fR is specified, the missing
  478. Xcomponent will be created and no error displayed if directory already
  479. Xexists. If the \fB\(enm\fR flag is used, this will be equivalent to a chmod
  480. Xon the directory after its creation.
  481. X
  482. X
  483. X
  484. /
  485. echo x - mkfifo
  486. sed '/^X/s///' > mkfifo << '/'
  487. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  488. X.CD "mkfifo \(en make a named pipe"
  489. X.SX "mkfifo [\fB\(enm \fImode\fR] \fIfifo ..."
  490. X.FL "\(enm" "Create fifo with specified mode"
  491. X.EX "mkfifo pipe" "Create \fIpipe\fP in the current directory"
  492. X.EX "mkfifo -m a+w systatus" "Create the \fIsystatus\fP writable by all"
  493. X.PP
  494. XThe specified fifo special files are created.
  495. XIf the \fB\(enm\fR flag is used, this will be equivalent to a chmod
  496. Xon the fifo special file after its creation.
  497. X
  498. X
  499. X
  500. /
  501. echo x - mkfs
  502. sed '/^X/s///' > mkfs << '/'
  503. X.CD "mkfs \(en make a file system"
  504. X.SX "mkfs \fR[\fB\(enLdot\fR] \fIspecial \fIprototype"
  505. X.FL "\(enL" "Make a listing on standard output"
  506. X.FL "\(end" "Use mod time of \fImkfs\fR binary for all files"
  507. X.FL "\(eno" "Use a drive other than 0 or 1 (safety precaution)"
  508. X.FL "\(ent" "Do not test if file system fits on the medium"
  509. X.FL "\(en1" "Make a version 1 file system (for backward compatibility)"
  510. X.EX "mkfs /dev/fd1 proto" "Make a file system on \fI/dev/fd1\fR"
  511. X.EX "mkfs /dev/fd1 360" "Make empty 360 block file system"
  512. X.PP
  513. X.I Mkfs
  514. Xbuilds a file system and copies specified files to it.
  515. XThe prototype file tells which directories and files to copy to it.
  516. XIf the prototype file cannot be opened, and its name is just a string of
  517. Xdigits, an empty file system will be made with the specified number of
  518. Xblocks.
  519. XA sample prototype file follows.
  520. XThe text following the \fI#\fR sign in the example below is comment.
  521. XIn real prototype files, comments are not allowed.
  522. X.SP 0.5
  523. X.HS
  524. X.nf
  525. X.ta 0.20i 0.70i 1.10i 3i 3.5i 4i
  526. X    boot            # boot block file (ignored)
  527. X    360 63            # blocks and i-nodes
  528. X    d--755 1 1        # root directory
  529. X       bin    d--755 \|2 1    # bin dir: mode (755), uid (2), gid (1)
  530. X        sh    \|---755 2 1 /user/bin/shell    # shell has mode \fIrwxr-xr-x\fP
  531. X        mv    -u-755 2 1 /user/bin/mv    # u = SETUID bit
  532. X        login    -ug755 2 1 /user/bin/login    # SETUID and SETGID
  533. X       $            # end of \fI/bin\fP
  534. X       dev    d--755 2 1    # special files: tty (char), fd0 (block)
  535. X        tty    c--777 2 1 4 0    # uid=2, gid=1, major=4, minor=0
  536. X        fd0    b--644 2 1 2 0 360    # uid, gid, major, minor, blocks
  537. X       $            # end of \fI/dev\fP
  538. X       user    d--755 12 1    # user dir: mode (755), uid (12), gid (1)
  539. X        ast    d--755 12 1    # \fI/user/ast\fP
  540. X        $        # \fI/user/ast\fP is empty
  541. X       $            # end of \fI/user\fP
  542. X    $            # end of root directory
  543. X.HS
  544. X.SP 0.5
  545. X.fi
  546. XThe first entry on each line (except the first 3 and the $ lines, which
  547. Xterminate directories) is the name the file or directory will get on the
  548. Xnew file system.  
  549. XNext comes its mode, with the first character being
  550. X\fB\(endbc\fR for regular files, directories, block special files and character 
  551. Xspecial files, respectively.
  552. XThe next two characters are used to specify the SETUID and SETGID bits, as
  553. Xshown above.
  554. XThe last three characters of the mode are the 
  555. X.I rwx
  556. Xprotection bits.
  557. X.PP
  558. XFollowing the mode are the uid and gid.
  559. XFor special files, the major and minor devices are needed.
  560. XThe size in blocks must also be specified for block special files (the
  561. X.MX
  562. Xblock size is 1K; this can only be changed by changing
  563. X.I BLOCK_SIZE
  564. Xand then recompiling the operating system).
  565. X
  566. X
  567. X
  568. /
  569. echo x - mknod
  570. sed '/^X/s///' > mknod << '/'
  571. X.CD "mknod \(en create a special file"
  572. X.SX "mknod \fIfile\fR [\fBb\fR] [\fBc\fR] \fImajor \fIminor \fR[\fIsize\fR]"
  573. X.FL "\fR(none)"
  574. X.EX "mknod /dev/plotter c 7 0" "Create special file for a plotter"
  575. X.EX "mknod /dev/fd3 b 2 3 360" "Create a 360K device for diskette drive 3"
  576. X.PP
  577. X.I Mknod
  578. Xcreates a special file named
  579. X.I file ,
  580. Xwith the indicated major and minor device numbers.
  581. XThe second argument specifies a block or character file.
  582. XBlock devices have a size, which must be specified in blocks.
  583. XCharacter devices do not have a size so the fifth argument is omitted.
  584. X
  585. X
  586. X
  587. /
  588. echo x - mkproto
  589. sed '/^X/s///' > mkproto << '/'
  590. X.CD "mkproto \(en create a \s-2MINIX\s0 prototype file"
  591. X.SX "mkproto \fR[\fB\(enb \fIn\fR] [\fB\(end \fIstr\fR] [\fB\(eng \fIn\fR] [\fB\(eni \fIn\fR] [\fB\(enp \fInnn\fR] [\fB\(ens\fR] [\fB\(ent \fIroot\fR] [\fB\(enu \fIn\fR]"
  592. X.FL "\(enb" "Number of blocks in the prototype is \fIn\fR"
  593. X.FL "\(end" "Indent the prototype file using \fIstr\fR instead of tab"
  594. X.FL "\(eng" "Use \fIn\fR as the gid for all files and directories"
  595. X.FL "\(eni" "Number of i-nodes in the prototype is \fIn\fR"
  596. X.FL "\(enp" "Use \fInnn\fR (3 octal digits) as the protection mode"
  597. X.FL "\(ens" "Use the same uid, gid and mode as the source files have"
  598. X.FL "\(ent" "Use the string \fIroot\fR as the path prefix for every file"
  599. X.FL "\(enu" "Use \fIn\fR as the uid for all files and directories"
  600. X.EX "mkproto \(enb360" "Make a 360K prototype of this directory"
  601. X.EX "mkproto \(enu2 \(eng1 \(enp644" "Give all files uid 2, gid 1 and mode 644"
  602. X.PP
  603. X\fIMkproto\fR creates an \fImkfs\fR prototype file for the specified
  604. Xsource-directory. 
  605. XThe prototype file is either written to \fIstdout\fR or, if specified, 
  606. Xthe proto-file.
  607. X
  608. X
  609. X
  610. /
  611. echo x - modem
  612. sed '/^X/s///' > modem << '/'
  613. X.CD "modem \(en switch the modem and getty state"
  614. X.SX "modem \fR[\fB\(eno\fR] [\fB\(eni \fInum\fR] \fBtty\fIn\fR"
  615. X.FL "\(eno" "Turn getty off and set modem to dialout"
  616. X.FL "\(eni" "Set line to dialin"
  617. X.EX "modem \(eno tty1" "Set tty1 to dialout"
  618. X.EX "modem \(eni2 tty1" "Set tty1 to dialin (2 rings)"
  619. X.PP
  620. XThe \fIgetty\fR program allows a terminal port to be used for both dialin and
  621. Xdialout. 
  622. XThis little program switches the getty state, and also sends
  623. Xsome commands to the modem attached to the specified line.
  624. XIf the \fB\(eno\fR flag is presnt, \fImodem\fR will put the 
  625. Xgetty process (if any) connected to the specified line into 
  626. XSUSPEND state, which means that it
  627. Xwill not pay attention to that line until it is reset to RESTART state.
  628. XAlso, \fImodem\fR will send some (Hayes) 
  629. Xcommands to the attached modem to disable the auto-nanswer mode. 
  630. XThe \fB\(eni\fR flag specifies the number of times the telephone has to 
  631. Xring before the modem may answer the call (to give the operator a chance).
  632. X
  633. X
  634. X
  635. X.SP 1
  636. /
  637. echo x - mon_man
  638. sed '/^X/s///' > mon_man << '/'
  639. X   5  K    4034: 10 Dec 92 Kees J. Bot     Little monitor document
  640. X(Message # 5: 4034 bytes, KEEP)
  641. XReceived: from spanker.cs.vu.nl by top.cs.vu.nl id aa00984; 10 Dec 92 9:49 MET
  642. XReceived: from hornet.cs.vu.nl by spanker.cs.vu.nl id aa00324;
  643. X          10 Dec 92 9:49 MET
  644. XDate:     Thu, 10 Dec 92 9:49:24 MET
  645. XFrom:     "Kees J. Bot" <kjb@cs.vu.nl>
  646. XTo:       ast@cs.vu.nl
  647. XSubject:  Little monitor document
  648. XMessage-ID:  <9212100949.aa16951@hornet.cs.vu.nl>
  649. X
  650. XI've written a small document on the monitor as you requested.  Below is
  651. Xa shar file with the nroff source.  The command
  652. X
  653. X    nroff -ms mon.doc.ms | colcrt - > mon.doc
  654. X
  655. Xwill turn it into a flat file.  Only the page breaks are left to be
  656. Xremoved.
  657. X
  658. X(I should be less vocal on the net, now someone sent his Minix questions
  659. Xto me, but the praise still goes to you: "Tell Andy he did a superb job
  660. Xputting this OS together."  Just passing it on. :-)
  661. X--
  662. X                                Kees.
  663. X_._. .._ _   ._ ._.. ___ _. __.   _ .... .   _.. ___ _ _ . _..   ._.. .. _. .
  664. X: This is a shar archive.  Extract with sh, not csh.
  665. X: This archive ends with exit, so do not worry about trailing junk.
  666. X: --------------------------- cut here --------------------------
  667. XPATH=/bin:/usr/bin:/usr/ucb
  668. Xecho Extracting 'mon.doc.ms'
  669. Xsed 's/^X//' > 'mon.doc.ms' << '+ END-OF-FILE ''mon.doc.ms'
  670. XX.SH
  671. XXDoing more with the Minix Boot Monitor.
  672. XX.PP
  673. XXThis text describes the menu interface of the Minix Boot Monitor, and
  674. XXthe commands that may be used to customize it.
  675. XX.LP
  676. XXFirst of all, the monitor mode as distributed normally hides some of the
  677. XXfunctionality, but shows you an explanation of the environment
  678. XXvariables instead.  If you add -DEXTENDED_LIST to CFLAGS in the Makefile
  679. XXand recompile, then you will no longer see the long explanation (you
  680. XXshould know it by now), but you will see all the commands the monitor
  681. XXknows about.
  682. XX.SH
  683. XXThe commands.
  684. XX.PP
  685. XXThe boot command has two functions, one is to load and start Minix, the
  686. XXother is to boot a different operating system.  If the first partition
  687. XXon your hard disk contains MS-DOS, then
  688. XX.DS
  689. XX.B
  690. XXboot hd1
  691. XX.R
  692. XX.DE
  693. XXwill boot MS-DOS.  (Not all operating systems like to be called this
  694. XXway, some insist on being on the active partition.)
  695. XX.LP
  696. XXThe delay, ls, and other simple commands are not too difficult to
  697. XXunderstand, just try them out.  The trap command may be used to execute
  698. XXa function after a delay.  You can show a menu first and boot Minix
  699. XXafter 5 seconds of inactivity like this:
  700. XX.DS
  701. XX.B
  702. XXtrap 5000 boot; menu
  703. XX.R
  704. XX.DE
  705. XX(This must be typed on one line, traps are cancelled when the prompt is
  706. XXprinted.)
  707. XX.SH
  708. XXFunctions.
  709. XX.PP
  710. XXFunctions are used to bundle commands, or to build menu items.  The best
  711. XXexample of a simple function is 'main', the function executed by the
  712. XXmonitor on startup.  Main is by default defined as:
  713. XX.DS
  714. XX.B
  715. XXmain() { menu }
  716. XX.R
  717. XX.DE
  718. XXSo that's why you see a menu at the start.  The example with 'trap'
  719. XXabove could be executed by main if you type:
  720. XX.DS
  721. XX.B
  722. XXmain() { trap 5000 boot; menu }
  723. XXsave
  724. XX.R
  725. XX.DE
  726. XXThe save command will save the changed environment of the monitor to the
  727. XXsecond half of the boot block, the "boot parameters sector".
  728. XX.LP
  729. XXFunctions may have one or two arguments, the first is a key to be
  730. XXpressed from the menu to execute the function, the optional second
  731. XXargument is the text that is to be displayed on the menu.  The single
  732. XXargument functions should only be produced by construct, like this
  733. XXone:
  734. XX.DS
  735. XX.B
  736. XXAT(a) {label=AT;image=42:626;echo AT kernel selected;menu}
  737. XX.R
  738. XX.DE
  739. XXIt invites you to choose one of many kernels on a special boot floppy.
  740. XX.LP
  741. XXThe two argument functions are used to customize the menu, once you
  742. XXdefine one the default option disappears, so your first function will
  743. XXprobably be one to start Minix.  Example:
  744. XX.DS
  745. XX.B
  746. XXminix(=,Start Minix) { boot }
  747. XXdos(d,Boot MS-DOS) { boot hd1 }
  748. XXsave
  749. XXmenu
  750. XX.R
  751. XX.DE
  752. XXNow you can type '=' or 'd' to choose between Minix and DOS.
  753. X+ END-OF-FILE mon.doc.ms
  754. Xchmod 'u=rw,g=r,o=r' 'mon.doc.ms'
  755. Xset `wc -c 'mon.doc.ms'`
  756. Xcount=$1
  757. Xcase $count in
  758. X2542)    :;;
  759. X*)    echo 'Bad character count in ''mon.doc.ms' >&2
  760. X        echo 'Count should be 2542' >&2
  761. Xesac
  762. Xexit 0
  763. /
  764. echo x - more
  765. sed '/^X/s///' > more << '/'
  766. X.CD "more \(en pager"
  767. X.SX "more\fR [\fB\(endf\&lpsu\fR]\fR [\fB\(en\fIn\fR] [\fB+\fIn\fR] [\fB+\fR/\fIpattern\fR] [\fIfile\fR] ..."
  768. X.FL "\(end" "Display prompt message at each pause"
  769. X.FL "\(enf" "Do not fold lines"
  770. X.FL "\(enl" "Do not treat CTRL-L as form feed"
  771. X.FL "\(enp" "Page mode.  Do not scroll"
  772. X.FL "\(ens" "Suppress multiple blank lines"
  773. X.FL "\(enu" "Use escape sequences for underlining"
  774. X.EX "more file" "Display file on the screen"
  775. X.EX "more \(enp file1 file2" "Display two files in page mode"
  776. X.EX "more \(en10 file" "Use a 10 line window"
  777. X.EX "more +/begin file" "Hunt for the string \fIbegin\fR"
  778. X.PP
  779. X\fIMore\fR is a pager that allows one to examine files.
  780. XWhen \fImore\fR starts up, it displays a screenful of information from the
  781. Xfirst file in its list, and then pauses for one of the following commands.
  782. XIn this description, # represents an integer telling how many of something.
  783. X.HS
  784. X.nf
  785. X.ta 0.5i 1.5i
  786. X    <space>    \(en Display next page
  787. X    <return>    \(en Display next line
  788. X    CTRL-B    \(en Go backward half a screenful
  789. X    CTRL-D    \(en Go forward half a screenful
  790. X    CTRL-L    \(en Redisplay the screen
  791. X    #<space>    \(en Go forward # lines
  792. X    =    \(en Print current line number
  793. X    .    \(en Repeat previous command
  794. X    '    \(en (single quote) Go back to start of last search
  795. X    !    \(en Escape to a shell
  796. X    #/<expr>    \(en Go to #-th occurrence of <expr>
  797. X    :f    \(en Display current file name and line number
  798. X    #:n    \(en Skip forward # files
  799. X    #:p    \(en Skip backward # files
  800. X    b    \(en Go backward half a screenful
  801. X    d    \(en Go forward half a screenful
  802. X    #f    \(en Skip # screenfuls
  803. X    h    \(en Display \fI/usr/lib/more.help\fR
  804. X    #n    \(en Go to #-th occurence of last <expr>
  805. X    q    \(en Quit \fImore\fR
  806. X    Q    \(en Quit \fImore\fR
  807. X    #s    \(en Skip # lines
  808. X    v    \(en Try to execute \fI/usr/bin/vi\fR
  809. X    #z    \(en Go forward # lines and set screen size to #
  810. X.fi
  811. X.HS
  812. XFor the benefit of users who always want to use certain flags when calling
  813. X\fImore\fR, the shell variable MORE can be set,
  814. Xfor example, to MORE="\(ENp".
  815. X
  816. X
  817. X
  818. /
  819. echo x - mount
  820. sed '/^X/s///' > mount << '/'
  821. X.CD "mount \(en mount a file system"
  822. X.SX "/etc/mount \fIspecial \fIfile\fR [\fB\(enr\fR]"
  823. X.FL "\(enr" "File system is mounted read-only"
  824. X.EY "/etc/mount /dev/fd1 /user" "Mount diskette 1 on \fI/user\fP"
  825. X.PP
  826. XThe file system contained on the special file is mounted on \fIfile\fP.
  827. XIn the example above, the root directory of the file system in drive 1
  828. Xcan be accessed as
  829. X.DI /user
  830. Xafter the mount.
  831. XWhen the file system is no longer needed, it must be unmounted before being
  832. Xremoved from the drive.
  833. X
  834. X
  835. X
  836. /
  837. echo x - mref
  838. sed '/^X/s///' > mref << '/'
  839. X.CD "mref \(en make listing and cross reference map of \s-2MINIX\s0"
  840. X.SX "mref\fR [\fB\(endlmstx\fR] [\fB\(enp \fIn\fR] [\fB\(en\fIn\fR] \fIfile ..."
  841. X.FL "\(end" "Do not produce definition file (global symbol table)"
  842. X.FL "\(enl" "Do not produce listing"
  843. X.FL "\(enm" "Multiple references on one line are cited only once"
  844. X.FL "\(enp" "Set initial page number to \fIn\fR"
  845. X.FL "\(ens" "Suppress line numbering between procedures"
  846. X.FL "\(ent" "Generate output for \fItroff\fR"
  847. X.FL "\(enx" "Do not produce the cross reference map"
  848. X.FL "\(en\fIn" "Number of lines to print per page, default = 50"
  849. X.EX "mref *.[\fIhc\fR]" "List and cross reference files \fI.h\fR and \fI.c\fR"
  850. X.EX "mref \(en60 \(ent *.c" "Produce \fItroff\fR input at 60 lines/page"
  851. X.EX "mref \(endx \(enp 100 *.c" "Listing only, first page is numbered 100"
  852. X.PP
  853. XIn default mode, 
  854. X.I mref
  855. Xproduces three output files: a numbered listing of the input files
  856. X(on standard output), a global symbol table (on \fIsymbol.out\fR),
  857. Xand a cross reference map to the global symbols (on \fIxref.out\fR).
  858. XA global symbol in this context is one present in a #define, PUBLIC,
  859. XPRIVATE, or SYMBOL statement (the latter being introduced to allow users
  860. Xto explicitly declare certain symbols as global).
  861. XAny of the three outputs can be suppressed, or alternatively, be made
  862. Xsuitable for input to \fItroff\fR for typesetting.
  863. X
  864. X
  865. X
  866. /
  867. echo x - mv
  868. sed '/^X/s///' > mv << '/'
  869. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  870. X.CD "mv \(en move or rename a file"
  871. X.SX "mv [\fB\(enf\&i\fR] \fIfile1 file2"
  872. X.SX "mv [\fB\(enf\&i\fR] \fIfile\fR ... \fIdirectory"
  873. X.FL "\(enf" "Do not prompt before removing existing files"
  874. X.FL "\(eni" "Prompt before removing existing files"
  875. X.EX "mv oldname newname" "Move \fIoldname\fP to \fInewname\fP"
  876. X.EX "mv file1 file2 /user/ast" "Move two files to \fI/user/ast\fP"
  877. X.PP
  878. X.I Mv
  879. Xmoves one or more files from one place in the file system to another.
  880. XIf the old path and new path are on the same device, it is done by renaming
  881. Xotherwise by copying. If you're not superuser, the copy will destroy the
  882. Xfile's owner, group and setuid/setgid bits.
  883. X.I mv
  884. Xwill prompt before removing non-writable files if \fBstdin\fR is a terminal
  885. Xor the \fB\(eni\fR flag was specified.
  886. X
  887. X
  888. X
  889. /
  890. echo x - ncheck
  891. sed '/^X/s///' > ncheck << '/'
  892. X.CD "ncheck \(en i-node to name converter"
  893. X.SX "ncheck\fR [\fB\(eni\fI numbers\fR] [\fB\(ena\fR] [\fB\(ens\fR] \fIfile_system\fR"
  894. X.FL "\(ena" "List all files, even . and .."
  895. X.FL "\(eni" "Followed by a list of i-nodes"
  896. X.FL "\(ens" "List only special and setuid files"
  897. X.EX "ncheck \(en /dev/fd0" "List everything on \fI/dev/fd0\fR"
  898. X.EX "ncheck \(eni 10,15 /dev/fd0" "List i-nodes 10 and 15 on \fI/dev/fd0\fR"
  899. X.PP
  900. X\fISometimes one knows about an i-node number and wants to find the file
  901. Xname that goes with it.  This program makes that mapping.
  902. XThe default is to list everything on the device, but the \fB\(eni\fR
  903. Xflag restricts the list to specified i-nodes and the \fB\(ens\fR flag
  904. Xrestricts it to special files and setuid files (to look for possible
  905. Xsecurity violations).
  906. /
  907. echo x - nm
  908. sed '/^X/s///' > nm << '/'
  909. X.CD "nm \(en print name list"
  910. X.SX "nm\fR [\fB\(endgnopru\fR]\fR [\fIfile\fR] ..."
  911. X.FL "\(end" "Print the offsets in decimal instead of in hex"
  912. X.FL "\(eng" "Print only external symbols"
  913. X.FL "\(enn" "Sort numerically rather than alphabetically"
  914. X.FL "\(eno" "Prepend file name to each line rather than only once"
  915. X.FL "\(enp" "Do not sort, print in symbol-table order"
  916. X.FL "\(enr" "Sort in reverse order"
  917. X.FL "\(enu" "Print only undefined symbols"
  918. X.EX "nm \(enn a.out" "Print all symbols in numerical order"
  919. X.EX "nm \(endg a.out" "Print globals alphabetically in decimal"
  920. X.PP
  921. X\fINm\fR prints the symbol table of executable files when it is available.
  922. XIf no file is given, the symbols in \fIa.out\fR are used.  
  923. XThe format of the table 
  924. Xis somewhat compatible with the one produced  by \fIasld\fR when used with 
  925. Xthe \fB\(ens\fR option. The symbol table can be added with \fIast\fR.  
  926. XAssembly language files do not have symbol tables.
  927. X
  928. X
  929. X
  930. /
  931. echo x - nroff
  932. sed '/^X/s///' > nroff << '/'
  933. X.CD "nroff \(en text formatter"
  934. X.SX "nroff\fR [\fB\(enbv\fR]\fR [\fB\(enm\fImacros\fR] [\fB\(enp\fIn\fR] [\fB\(en\fRn\fR] [\fB+\fRn\fR] [\fIfile\fR] ..."
  935. X.FL "\(enb" "Output device can backspace"
  936. X.FL "\(enm" "Use \fI/usr/lib/tmac/tmac.\fR macros"
  937. X.FL "\(env" "Print \fInro\fR version number"
  938. X.FL "\(mi\fIn\fR" "Last page to print"
  939. X.FL "+\fIn\fR" "First page to print"
  940. X.EX "nroff infile >outfile" "Format \fIinfile\fR"
  941. X.EX "nroff +3 \(en5 infile >outfile" "Only output pages 3-5"
  942. X.PP
  943. X\fINroff\fR is a text formatter like \fIroff\fR, but more flexible.
  944. XUnlike \fIroff\fR, it accepts parametrized macros, for example.
  945. XThe commands are given in Chap. 9.
  946. X
  947. X
  948. X
  949. /
  950. echo x - od
  951. sed '/^X/s///' > od << '/'
  952. X.CD "od \(en octal dump"
  953. X.SX "od\fR [\fB\(enbcdhox\fR]\fR [\fIfile\fR] [ [\fB+\fR] \fIoffset\fR [\fB.\fR][\fBb\fR]\fR ]"
  954. X.FL "\(enb" "Dump bytes in octal"
  955. X.FL "\(enc" "Dump bytes as ASCII characters"
  956. X.FL "\(end" "Dump words in decimal"
  957. X.FL "\(enh" "Print addresses in hex (default is octal)"
  958. X.FL "\(eno" "Dump words in octal (default)"
  959. X.FL "\(env" "Verbose (list duplicate lines)"
  960. X.FL "\(enx" "Dump words in hex"
  961. X.EX "od \(enox file" "Dump \fIfile\fP in octal and hex"
  962. X.EX "od \(end file +1000" "Dump \fIfile\fP starting at byte 01000"
  963. X.EX "od \(enc file +10.b" "Dump \fIfile\fP starting at block 10"
  964. X.PP
  965. X.I Od
  966. Xdumps a file in one or more formats.
  967. XIf \fIfile\fP is missing, \fIstdin\fR is dumped.
  968. XThe \fIoffset\fP argument tells
  969. X.I od
  970. Xto skip a certain number of bytes or blocks before starting.
  971. XThe offset is in octal bytes, unless it is followed by a 
  972. X\*(OQ.\*(CQ for decimal or \fBb\fP for blocks or both.
  973. X
  974. X
  975. X
  976. /
  977. echo x - passwd
  978. sed '/^X/s///' > passwd << '/'
  979. X.CD "passwd \(en change a login password"
  980. X.SX "passwd\fR [\fIname\fR]"
  981. X.FL "\fR(none)"
  982. X.EX "passwd" "Change current user's password"
  983. X.EX "passwd ast" "Change ast's password (super\(enuser only)"
  984. X.PP
  985. X.I Passwd
  986. Xis used to change your password.
  987. XIt prompts for the old and new passwords.
  988. XIt asks for the new password twice, to reduce the effect of a typing error.
  989. XDo not forget to copy the modified password file back to the root file system,
  990. Xor the changes will be lost when the system is rebooted.
  991. X
  992. X
  993. X
  994. /
  995. echo x - paste
  996. sed '/^X/s///' > paste << '/'
  997. X.CD "paste \(en paste multiple files together"
  998. X.SX "paste\fR [\fB\(ens\fR]\fR [\fB\(end\fI list\fR] \fIfile..."
  999. X.FL "\(end" "Set delimiter used to separate columns to \fIlist\fR.
  1000. X.FL "\(ens" "Print files sequentially, file \fIk\fR on line \fIk\fR.
  1001. X.EX "paste file1 file2" "Print \fIfile1\fR in col 1, \fIfile2\fR in col 2"
  1002. X.EX "paste \(ens f1 f2" "Print \fIf1\fR on line 1 and \fIf2\fR on line 2"
  1003. X.EX "paste -d : file1 file2" "Print the lines separated by a colon"
  1004. X.PP
  1005. X\fIPaste\fR concatenates corresponding lines of the given input files
  1006. Xand writes them to standard output. The lines of the different files
  1007. Xare separated by the delimiters given with the option \(ens\fR. If
  1008. Xno list is given, a tab is substituted for every linefeed, except the last one.
  1009. XIf end-of-file is hit on an input file, subsequent lines are empty.
  1010. XSuppose a set of \fIk\fR files each has one word per line.  
  1011. XThen the \fIpaste\fR output will have \fIk\fR columns, 
  1012. Xwith the contents of file \fIj\fR in column \fIj\fR.  
  1013. XIf the \fB\(ens\fR flag is given, then the first
  1014. Xfile is on line 1, the second file on line 2, etc.  
  1015. XIn effect, \fB\(ens\fR turns the output sideways.
  1016. X.PP
  1017. XIf a list of delimiters is given, they are used in turn.  The C escape
  1018. Xsequences \\n, \\t, \\\\, and \\0 are used for linefeed, tab, backslash, and
  1019. Xthe null string, respectively.
  1020. /
  1021. echo x - patch
  1022. sed '/^X/s///' > patch << '/'
  1023. X.CD "patch \(en patches up a file from the original and a diff"
  1024. X.SX "patch\fR [\fB\(enNRbcdef\&lnop\fR]\fR [\fB\(enF\fIn\fR] [\fB\(enD \fIlabel\fR] [\fIfile \fR[\fIdifflist\fR]]"
  1025. X.FL "\(enD" "Mark changes with   #ifdef...#endif   next arg gives label"
  1026. X.FL "\(enF" "Sets the maximum fuzz factor to \fIn\fR"
  1027. X.FL "\(enN" "Ignore patches that are reversed or already applied"
  1028. X.FL "\(enR" "Reverse the patches"
  1029. X.FL "\(enb" "Next argument is backup extension, instead of using a tilde (\(ap)"
  1030. X.FL "\(enc" "Interpret the patch file as a context diff"
  1031. X.FL "\(end" "Cd to the next arg (assumed a dir) before doing anything"
  1032. X.FL "\(ene" "Interpret the patch file as an ed script"
  1033. X.FL "\(enf" "Forces \fIpatch\fR to do its work without asking any questions"
  1034. X.FL "\(enl" "Do matching loosely (e.g., all white space is equivalent)"
  1035. X.FL "\(enn" "Interpret the patch file as a normal diff"
  1036. X.FL "\(eno" "Next argument is the output file name"
  1037. X.FL "\(enp" "Sets the pathname strip count"
  1038. X.EX "patch file difflist" "Fix up \fIfile\fR"
  1039. X.EX "patch <difflist" "Patch multiple files"
  1040. X.PP
  1041. X\fIPatch\fR takes an original file and a diff listing and recreates the 
  1042. Xnew file.  It is functionally similar to 
  1043. X\fIfix\fR, but much more powerful.  Not only
  1044. Xcan it handle normal diffs, but also context diffs produced by \fIcdiff\fR.  In
  1045. Xaddition, it works even when the file being patched has other changes to it.
  1046. XIt deduces the type of \fIdifflist\fR itself (unless 
  1047. Xgiven \fB\(enc\fR, \fB\(ene\fR, or \fB\(enn\fR).
  1048. XThe normal usage is given in the example above.  In this case \fIpatch\fR will
  1049. Xmodify \fIfile\fR to incorporate all the patches.  
  1050. XThe original file will be saved to a file ending in a tilde (\(ap).
  1051. X.PP
  1052. XIf no input file is given, \fIpatch\fR reads \fIstdin\fR which may contain
  1053. Xthe concatenation of multiple diff listings.
  1054. XIn this way, all the files in a directory may be updated at once.
  1055. XSee Chap. 9 for more information.
  1056. X
  1057. X
  1058. X
  1059. /
  1060. echo x - pathchk
  1061. sed '/^X/s///' > pathchk << '/'
  1062. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  1063. X.CD "pathchk \(en check pathname"
  1064. X.SX "pathchk [\fB\(enp\fR] \fIpath\fR ..."
  1065. X.FL "\(enp" "Check against POSIX rules"
  1066. X.EX "pathchk /usr/src/file.c" "Check the accessibility of \fIfile.c\fP"
  1067. X.EX "pathchk \(enp file" "Check posix compliance of \fIfile\fR"
  1068. X.PP
  1069. X.I Pathchk
  1070. Xverifies path names and display error if paths are too long, contain names
  1071. Xthat are too long, go thru a non-searchable directory or contain an
  1072. Xinvalid character in names. If the \fB\(enp\fR flag is specified, the POSIX
  1073. Xrules apply instead of the rules of the current file system.
  1074. X
  1075. X
  1076. X
  1077. X
  1078. /
  1079. echo x - pr
  1080. sed '/^X/s///' > pr << '/'
  1081. X.CD "pr \(en print a file"
  1082. X.SX "pr\fR [\fB\(enMfnt\fR]\fR [\fB\(enh \fIn\fR]  [\fB\(enl \fIn\fR]  [\fB\(enw \fIn\fR] [\fB\(en\fRcolumns\fR] [\fB+\fIpage\fR] [\fIfile\fR] ..."
  1083. X.FL "\(enM" "Use MINIX style line number"
  1084. X.FL "\(enf" "Do not fold long lines"
  1085. X.FL "\(enh" "Take next argument as page header"
  1086. X.FL "\(enl" "Sets page length in lines"
  1087. X.FL "\(enn" "Number the output lines"
  1088. X.FL "\(ent" "Do not print page header or trailer"
  1089. X.FL "\(enw" "Sets line length in characters"
  1090. X.EX "pr \(enw85 \(enl60 file" "Use 85 character line, 60 line page"
  1091. X.EX "pr \(en3 file" "List \fIfile\fP three columns to a page"
  1092. X.EX "pr +4 file" "Start printing with page 4"
  1093. X.PP
  1094. X.I Pr
  1095. Xformats one or more files for printing.
  1096. XIf no files are specified, \fIstdin\fR is printed.
  1097. XOptions are provided for setting the width and height of the page, the
  1098. Xnumber of columns to use (default 1), and the page to start with, among others.
  1099. X
  1100. X
  1101. X
  1102. /
  1103. echo x - prep
  1104. sed '/^X/s///' > prep << '/'
  1105. X.CD "prep \(en prepare a text file for statistical analysis"
  1106. X.SX "prep\fR [\fIfile\fR]"
  1107. X.FL "\fR(none)"
  1108. X.EY "prep infile >outfile" "Prepare \fIinfile\fR"
  1109. X.PP
  1110. X\fIPrep\fR strips off most of the troff commands from a text file and then
  1111. Xoutputs all the words, one word per line, in the order they occur in the file.
  1112. XThis file can then be sorted and compared to a dictionary (as a spelling
  1113. Xchecker), or used for statistical analyses.
  1114. X
  1115. X
  1116. X
  1117. /
  1118. echo x - pretty
  1119. sed '/^X/s///' > pretty << '/'
  1120. X.CD "pretty \(en \s-2MINIX\s0 pretty printer"
  1121. X.SX "pretty \fIfile ..."
  1122. X.FL "\fR(none)"
  1123. X.EY "pretty file1 file2" "Convert two files to \s-2MINIX\s0 layout"
  1124. X.PP
  1125. X\fIPretty\fR converts one or more C source files to 
  1126. X.MX 
  1127. Xformat by changing 
  1128. Xtheir layout.  Running this program does not affect the resulting binary
  1129. Xprograms.  Actually, \fIpretty\fR is a postprocessor for \fIindent\fR, which
  1130. Xmust be installed in \fI/bin\fR or \fI/usr/bin\fR.  Although the output is
  1131. Xnot bad, it is not entirely consistent with the book or even with itself.
  1132. X
  1133. X
  1134. X
  1135. /
  1136. echo x - printenv
  1137. sed '/^X/s///' > printenv << '/'
  1138. X.CD "printenv \(en print out the current environment"
  1139. X.SX "printenv"
  1140. X.FL "\fR(none)"
  1141. X.EY "printenv" "Print the environment"
  1142. X.PP
  1143. X\fIPrintenv\fR prints out the current environment strings, one per line.
  1144. X
  1145. X
  1146. X
  1147. /
  1148. echo x - printroot
  1149. sed '/^X/s///' > printroot << '/'
  1150. X.CD "printroot \(en print the name of the root device on standard output"
  1151. X.SX "printroot"
  1152. X.FL "\fR(none)"
  1153. X.EY "printroot" "Print the name of the root device"
  1154. X.PP
  1155. X.I Printroot 
  1156. Xis useful for initializing the \fI/etc/mtab\fR entry when the system is
  1157. Xbooted.
  1158. XIt figures out what the root device is by searching \fI/dev\fR until it
  1159. Xfinds a block special file with the right major/minor device numbers.
  1160. X
  1161. X
  1162. X
  1163. X.SP 1
  1164. /
  1165. echo x - ps
  1166. sed '/^X/s///' > ps << '/'
  1167. X.CD "ps \(en process status"
  1168. X.SX "ps [\(fB\(en\fR] [\(fBalxU\fR] [\(fBkernel mm fs\fR]"
  1169. X.FL "\(ena" "Print all processes with controlling terminals"
  1170. X.FL "\(enl" "Give long listing"
  1171. X.FL "\(enx" "Include processes without a terminal"
  1172. X.FL "\(enU" "Update (optional) name database"
  1173. X.EX "ps \(enaxl" "Print all processes and tasks in long format"
  1174. X.EX "ps \(enU /kernel /fs /mm" "Update database with given namelists"
  1175. X.PP
  1176. X\fIPs\fR prints the status of active processes.  Normally only the caller's own
  1177. Xprocesses are listed in short format (the PID, TTY, TIME and CMD fields as
  1178. Xexplained below).  The long listing contains:
  1179. X.HS
  1180. X.ta 0.5i 1.0i
  1181. X  F    Kernel flags:
  1182. X        001: free slot
  1183. X        002: no memory map
  1184. X        004: sending;
  1185. X        010: receiving
  1186. X        020: inform on pending signals
  1187. X        040: pending signals
  1188. X        100: being traced.
  1189. X.HS
  1190. X  S
  1191. X    State:
  1192. X        R: runnable
  1193. X        W: waiting (on a message)
  1194. X        S: sleeping (i.e.,suspended on MM or FS)
  1195. X        Z: zombie
  1196. X        T: stopped
  1197. X.HS
  1198. X  UID, PID, PPID, PGRP
  1199. X    The user, process, parent process and process group ID's.
  1200. X.HS
  1201. X  ADDR, SZ
  1202. X    Decimal address and size of the process in kilobytes.
  1203. X.HS
  1204. X  RECV
  1205. X    Process/task on which a receiving process is waiting or sleeping.
  1206. X.HS
  1207. X  TTY    
  1208. X    Controlling tty for the process.
  1209. X.HS
  1210. X  TIME
  1211. X    Process' cumulative (user + system) execution time.
  1212. X.HS
  1213. X  CMD    Command line arguments of the process.
  1214. X.HS
  1215. X.PP
  1216. XIf extra arguments (the kernel, mm and fs nonstripped executables) are
  1217. Xgiven, these are used to obtain the system addresses from (instead of the
  1218. Xdefault system executables).  This applies to the \fB\(enU\fR option also.  
  1219. XThis option creates \fI/etc/psdatabase\fR that contains system addresses and 
  1220. Xterminal names, after which \fIps\fR is faster and doesn't need the system 
  1221. Xexecutables anymore.
  1222. X.PP
  1223. XThe default system executables are \fI/usr/src/{kernel/kernel,mm/mm,fs/fs}\fR.
  1224. XIf the database is updated, an old psdatabase exists, and no paths are given to
  1225. Xps, it uses the paths that were previously stored in the database.  
  1226. XA \fIps \(enU\fR" in \fI/etc/rc\fR thus generally ensures an up-to-date 
  1227. Xdatabase.
  1228. X.PP
  1229. XThe files \fI/dev/{mem,kmem}\fR are used to read the system tables and command
  1230. Xline arguments from.  Terminal names in \fI/dev\fR are used to generate the 
  1231. Xmnemonic names in the TTY column, so \fIps\fR is independent of terminal naming
  1232. Xconventions.
  1233. X.PP
  1234. XWarning: \fIps\fR depends heavily on up-to-date system addresses and 
  1235. Xparameters.
  1236. XIt prints messages when they appear to be outdated.
  1237. /
  1238. echo x - pwd
  1239. sed '/^X/s///' > pwd << '/'
  1240. X.CD "pwd \(en print working directory"
  1241. X.SX "pwd"
  1242. X.FL "\fR(none)"
  1243. X.EY "pwd~~~~~" "Print the name of the working directory"
  1244. X.PP
  1245. XThe full path name of the current working directory is printed.
  1246. X
  1247. X
  1248. X
  1249. /
  1250. echo x - rcp
  1251. sed '/^X/s///' > rcp << '/'
  1252. X.CD "rcp \(en remote copy [IBM]"
  1253. X.SX "rcp\fR [\fImachine1!\fR]\fIfile1\fR [\fImachine2!\fR]\fIfile2"
  1254. X.FL "\fR(none)"
  1255. X.EX "rcp file mach1!/usr/ast/x" "Local \fIfile\fR to remote machine"
  1256. X.EX "rcp mach2!/usr/ast/x file" "Fetch remote file \fIx\fR"
  1257. X.PP
  1258. X\fIRcp\fR is not a program.  It is a shell script that does remote 
  1259. Xcopying.  It makes use of the programs \fIto\fR and \fIfrom\fR.
  1260. X
  1261. X
  1262. X
  1263. /
  1264. echo x - readall
  1265. sed '/^X/s///' > readall << '/'
  1266. X.CD "readall \(en read a device quickly to check for bad blocks"
  1267. X.SX "readall\fR [\fB\(enbt\fR] \fIfile"
  1268. X.FL "\(enb" "Produce shell script on \fIstdout\fR that calls \fIbadblocks\fR"
  1269. X.FL "\(ent" "Just print device size"
  1270. X.EX "readall /dev/hd0" "Read all of \fI/dev/hd0\fR"
  1271. X.EX "readall -b /dev/hd1 >s" "Generate shell script on \fIs\fR"
  1272. X.PP
  1273. X\fIReadall\fR reads all of the named device in large chunks.  
  1274. XIt reports about blocks that it cannot read.  
  1275. XUnlike \fIdiskcheck\fR, it does not attempt to write on
  1276. Xthe disk, making it safer to use when one is worried about a sick system.
  1277. XWhen the \fB\(enb\fR flag is given, the output is a shell script that
  1278. Xcalls the \fIbadblocks\fR program to marked all the bad blocks.
  1279. XWhenever installing 
  1280. X.MX ,
  1281. Xit is wise to run \fIreadall\fR with the \fB\(enb\fR flag first on all
  1282. Xthe hard disks.
  1283. X
  1284. X
  1285. X
  1286. /
  1287. echo x - readclock
  1288. sed '/^X/s///' > readclock << '/'
  1289. X.CD "readclock \(en read the real time clock [IBM PC/AT and AMIGA]"
  1290. X.SX "readclock"
  1291. X.FL "\fR(none)"
  1292. X.EY "date \`/usr/bin/readclock\` </dev/tty" "Useful in \fI/etc/rc\fR"
  1293. X.PP
  1294. X\fIReadclock\fR reads the AT's real time clock and prints the result in 
  1295. Xa form useful to date, namely, MMDDYYhhmmss.  
  1296. XIf the clock does not exist (e.g., on a
  1297. XPC), it outputs \*(OQ\(enq\*(CQ to query the user for the time.  
  1298. XThe example given above
  1299. Xcan be put in \fI/etc/rc\fR to load the real time when the system is booted.
  1300. X
  1301. X
  1302. X
  1303. /
  1304. echo x - readfs
  1305. sed '/^X/s///' > readfs << '/'
  1306. X.CD "readfs \(en read a \s-2MINIX\s0 file system"
  1307. X.SX "readfs\fR [\fB\(enil\fR] \fIblock_special\fR [\fIdir\fR]"
  1308. X.FL "\(eni" "Give information about the file, but do not extract files"
  1309. X.FL "\(enl" "List the files extracted on standard output"
  1310. X.EY "readfs \(enl /dev/fd0" "List contents of diskette"
  1311. X disk"
  1312. X.PP
  1313. X\fIReadfs\fR reads a diskette containing a 
  1314. X.MX
  1315. Xfile system.  It can
  1316. Xextract all the files from it, give a listing of them, or both.  The files
  1317. Xextracted can be put in a user-specified directory (default: current
  1318. Xdirectory).  If subdirectories are needed, they will be created automatically.
  1319. X
  1320. X
  1321. X
  1322. X.SP 1
  1323. /
  1324. echo x - recover
  1325. sed '/^X/s///' > recover << '/'
  1326. X.CD "recover \(en recover files that have been removed."
  1327. X.SX "recover \fIfile ..."
  1328. X.FL (none)
  1329. X.EX "rm x; recover x" "Unremove x"
  1330. X.EX "recover a b c" "Recover three files"
  1331. X.PP
  1332. XMINIX allows files that have been deleted (e.g., with \fIrm\fR) to be
  1333. Xrestored (in \fI/tmp\fR).
  1334. XThe trick is that when a file is unlinked, its i-node number is kept in
  1335. Xthe directory entry.
  1336. XAs long as the directory entry and disk blocks are not reused, the file
  1337. Xcan be recovered.
  1338. XThis program is actually just a little front end for \fIde\fR, which must be
  1339. Xinstalled and executable ast setuid root.
  1340. X
  1341. X
  1342. X
  1343. X.SP 1.6
  1344. /
  1345. echo x - ref
  1346. sed '/^X/s///' > ref << '/'
  1347. X.CD "ref \(en look up a reference in a \fItags\fR file"
  1348. X.SX "ref \fIfunction\fR"
  1349. X.FL "\fR(none)"
  1350. X.EY "ref func" "Find \fIfunc\fR"
  1351. X.PP
  1352. X\fIRef\fR looks up a function name in the \fIrefs\fR file in the current
  1353. Xdirectory.
  1354. XThis file is usually made by \fIctags\fR.
  1355. X
  1356. X
  1357. X
  1358. X.SP 1.6
  1359. /
  1360. echo x - rev
  1361. sed '/^X/s///' > rev << '/'
  1362. X.CD "rev \(en reverse the characters on each line of a file"
  1363. X.SX "rev\fR [\fIfile\fR] ..."
  1364. X.FL "\fR(none)"
  1365. X.EY "rev file" "Reverse each line"
  1366. X.PP
  1367. XEach file is copied to standard output with all the characters of each line
  1368. Xreversed, last one first and first one last.
  1369. X
  1370. X
  1371. X
  1372. X.SP 1.6
  1373. /
  1374. echo x - rm
  1375. sed '/^X/s///' > rm << '/'
  1376. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  1377. X.CD "rm \(en remove a file"
  1378. X.SX "rm\fR [\fB\(enRf\&ir\fR] \fIname\fR ..."
  1379. X.FL "\(enf" "Forced remove: no questions asked"
  1380. X.FL "\(eni" "Interactive remove: ask before removing"
  1381. X.FL "\(enR" "Remove directories too"
  1382. X.FL "\(enr" "Same as \fB\(enR\fR"
  1383. X.EX "rm file" "Remove \fIfile\fR"
  1384. X.EX "rm \(eni *.c" "Remove \fI.c\fP files, asking about each"
  1385. X.PP
  1386. X.I Rm
  1387. Xremoves one or more files.
  1388. XIf a file has no write permission,
  1389. X.I rm
  1390. Xasks for permission (type \*(OQy\*(CQ or \*(OQn\*(CQ) unless \fB\(enf\fR
  1391. Xis specified.
  1392. XIf the file is a directory, it will be recursively descended and removed
  1393. Xif and only if the \fB\(enR\fR flag is present.
  1394. X
  1395. X
  1396. X
  1397. /
  1398. echo x - rmaker
  1399. sed '/^X/s///' > rmaker << '/'
  1400. X.CD "rmaker \(en a simple resource compiler [MACINTOSH]"
  1401. X.SX "rmaker \fIinputfile\fR \fIoutputfile\fR"
  1402. X.FL "\fR(none)"
  1403. X.EX "rmaker boot.r vol:dir:f" "Compile the resource described in \fIboot.r\fB
  1404. X.PP
  1405. XRmaker will produce a Macintosh resource file from a resource input
  1406. Xspecification. This is not a complete implementation of a resource
  1407. Xcompiler, and it only understands a relatively small number of resource
  1408. Xformats. The input syntax is similar to that of the well-known rmaker
  1409. Xapplication. 
  1410. X.PP
  1411. XThis is a partial list of the resource types it understands:
  1412. X.HS
  1413. X.ta 0.25i 1i
  1414. X.nf
  1415. X    '\fBSTR \fR'    Strings
  1416. X    '\fBBNDL\fR'    Bundles
  1417. X    '\fBFREF\fR'    File refs (for bundles)
  1418. X    '\fBHEXA\fR'    Hex data
  1419. X    '\fBCODE\fR'    Code
  1420. X    '\fBALRT\fR'    Alerts
  1421. X    '\fBDITL\fR'    Dialog item lists
  1422. X    '\fBDLOG\fR'    Dialogs
  1423. X    '\fBWIND\fR'    Window templates
  1424. X    '\fBMENU\fR'    Menus
  1425. X    '\fBICON\fR'    ICON
  1426. X    '\fBICN#\fR'    ICON lists
  1427. X    '\fBCURS\fR'    Cursors
  1428. X    '\fBPAT \fR'    Patterns
  1429. X.fi
  1430. X
  1431. X
  1432. X
  1433. /
  1434. echo x - rmdir
  1435. sed '/^X/s///' > rmdir << '/'
  1436. X.CD "rmdir \(en remove a directory"
  1437. X.SX "rmdir \fIdirectory ...
  1438. X.FL "\fR(none)"
  1439. X.EX "rmdir /user/ast/foobar" "Remove directory \fIfoobar\fP"
  1440. X.EX "rmdir /user/ast/f*" "Remove 0 or more directories"
  1441. X.PP
  1442. XThe specified directories are removed.
  1443. XOrdinary files are not removed.
  1444. XThe directories must be empty.
  1445. X
  1446. X
  1447. X
  1448. /
  1449. echo x - roff
  1450. sed '/^X/s///' > roff << '/'
  1451. X.CD "roff \(en text formatter"
  1452. X.SX "roff\fR [\fB\(enhs\fR]\fR [\fB+\fIn\fR] [\fB\(en\fIn\fR] \fIfile\fR ..."
  1453. X.FL "\(enh" "Expand tabs to spaces in output"
  1454. X.FL "\(ens" "Stop before each page; continue on DEL"
  1455. X.FL "+\fIn\fP" "Start printing with page \fIn\fP"
  1456. X.FL "\(en\fIn\fP" "Stop after page \fIn\fP"
  1457. X.EX "roff file" "Run off \fIfile\fP"
  1458. X.EX "roff +5 file" "Run off \fIfile\fP starting at page 5"
  1459. X.PP
  1460. X.I Roff
  1461. Xis a text formatter.
  1462. XIts input consists of the text to be output, intermixed with formatting commands.
  1463. XA formatting command is a line containing the control character followed by
  1464. Xa two character command name, and possibly one or more arguments.
  1465. XThe control character is initially \*(OQ.\*(CQ (dot).
  1466. XThe formatted output is produced on standard output.
  1467. X.PP
  1468. XThe formatting commands are listed below, with
  1469. X.I n
  1470. Xbeing a number,
  1471. X.I c
  1472. Xbeing a character, and
  1473. X.I t
  1474. Xbeing a title.
  1475. XA + before \fIn\fP means it may be signed, indicating a positive or negative
  1476. Xchange from the current value.
  1477. XInitial values for
  1478. X.I n ,
  1479. Xwhere relevant, are given in parentheses.
  1480. X.HS
  1481. X.ta 0.25i 1i
  1482. X.nf
  1483. X    \fB.ad\fP    Adjust right margin.
  1484. X    \fB.ar\fP    Arabic page numbers.
  1485. X    \fB.br\fP    Line break.  Subsequent text will begin on a new line.
  1486. X    \fB.bl\fP n    Insert \fIn\fP blank lines.
  1487. X    \fB.bp\fP +n    Begin new page and number it \fIn\fP. No \fIn\fP means +1.
  1488. X    \fB.cc\fP c    Control character is set to \fIc\fP.
  1489. X    \fB.ce\fP n    Center the next \fIn\fP input lines.
  1490. X    \fB.de\fP zz    Define a macro called \fIzz\fP. A line with \*(OQ..\*(CQ ends definition.
  1491. X    \fB.ds\fP    Double space the output. Same as \fB.ls 2\fP.
  1492. X    \fB.ef\fP t    Even page footer title is set to \fIt\fP.
  1493. X    \fB.eh\fP t    Even page header title is set to \fIt\fP.
  1494. X    \fB.fi\fP    Begin filling output lines as full as possible.
  1495. X    \fB.fo\fP t    Footer titles (even and odd) are set to \fIt\fP.
  1496. X    \fB.hc\fP c    The character \fIc\fP (e.g., %) tells \fIroff\fP where hyphens are permitted.
  1497. X    \fB.he\fP t    Header titles (even and odd) are set to \fIt\fP.
  1498. X    \fB.hx\fP    Header titles are suppressed.
  1499. X    \fB.hy\fP n    Hyphenation is done if \fIn\fP is 1, suppressed if it is 0. Default is 1.
  1500. X    \fB.ig\fP    Ignore input lines until a line beginning with \*(OQ..\*(CQ is found.
  1501. X    \fB.in\fP n    Indent \fIn\fP spaces from the left margin; force line break.
  1502. X    \fB.ix\fP n    Same as \fI.in\fP but continue filling output on current line.
  1503. X    \fB.li\fP n    Literal text on next \fIn\fP lines.  Copy to output unmodified.
  1504. X    \fB.ll\fP +n    Line length (including indent) is set to \fIn\fP (65).
  1505. X    \fB.ls\fP +n    Line spacing: \fIn\fP (1) is 1 for single spacing, 2 for double, etc.
  1506. X    \fB.m1\fP n    Insert \fIn\fP (2) blank lines between top of page and header.
  1507. X    \fB.m2\fP n    Insert \fIn\fP (2) blank lines between header and start of text.
  1508. X    \fB.m3\fP n    Insert \fIn\fP (1) blank lines between end of text and footer.
  1509. X    \fB.m4\fP n    Insert \fIn\fP (3) blank lines between footer and end of page.
  1510. X    \fB.na\fP    No adjustment of the right margin.
  1511. X    \fB.ne\fP n    Need \fIn\fP lines.  If fewer are left, go to next page.
  1512. X    \fB.nn\fP +n    The next \fIn\fP output lines are not numbered.
  1513. X    \fB.n1\fP    Number output lines in left margin starting at 1.
  1514. X    \fB.n2\fP n    Number output lines starting at \fIn\fP.  If 0, stop numbering.
  1515. X    \fB.ni\fP +n    Indent line numbers by \fIn\fP (0) spaces.
  1516. X    \fB.nf\fP    No more filling of lines.
  1517. X    \fB.nx\fP f    Switch input to file \fIf\fP.
  1518. X    \fB.of\fP t    Odd page footer title is set to \fIt\fP.
  1519. X    \fB.oh\fP t    Odd page header title is set to \fIt\fP.
  1520. X    \fB.pa\fP +n    Page adjust by \fIn\fP (1).  Same as .bp
  1521. X    \fB.pl\fP +n    Paper length is \fIn\fP (66) lines.
  1522. X    \fB.po\fP +n    Page offset.  Each line is started with \fIn\fP (0) spaces.
  1523. X    \fB.ro\fP    Page numbers are printed in Roman numerals.
  1524. X    \fB.sk\fP n    Skip \fIn\fP pages (i.e., make them blank), starting with next one.
  1525. X    \fB.sp\fP n    Insert \fIn\fP blank lines, except at top of page.
  1526. X    \fB.ss\fP    Single spacing.  Equivalent to .ls 1.
  1527. X    \fB.ta\fP    Set tab stops, e.g., .ta 9 17 25 33 41 49 57 65 73 (default).
  1528. X    \fB.tc\fP c    Tabs are expanded into \fIc\fP.  Default is space.
  1529. X    \fB.ti\fP n    Indent next line \fIn\fP spaces; then go back to previous indent.
  1530. X    \fB.tr\fP ab    Translate \fIa\fP into \fIb\fP on output.
  1531. X    \fB.ul\fP n    Underline the letters and numbers in the next \fIn\fP lines.
  1532. X.fi
  1533. X
  1534. X
  1535. X
  1536. /
  1537. echo x - rsh
  1538. sed '/^X/s///' > rsh << '/'
  1539. X.CD "rsh \(en remote shell for networking [IBM]"
  1540. X.SX "rsh [\fB\(enbei\fR] \fIport\fR"
  1541. X.FL "\(enb" "Start the rsh in the background"
  1542. X.FL "\(ene" "Keep \fIstderr\fR separate from \fIstdout\fR"
  1543. X.FL "\(eni" "Take input from the local process"
  1544. X.EX "rsh machine5 "ls \(enl /usr/bin"" "List remote \fIbin\fR directory"
  1545. X.EX "rsh abc cat /usr/doc/f >f" "Fetch remote file"
  1546. X.EX "rsh foobar" "Log onto remote machine"
  1547. X.PP
  1548. XThe remote shell command is the way to have a distant server carry out
  1549. Xa command over the Ethernet.  The port given as the first argument can be
  1550. Xany string of up to 6 characters, but it must match the port used by some
  1551. Xsherver.  The command will be executed and the results returned on \fIstdout\fR.
  1552. XUnless the \fB\(ene\fR flag is given, the remote 
  1553. X\fIstderr\fR and \fIstdout\fR are merged onto the
  1554. Xlocal \fIstdout\fR.  Giving 
  1555. X\fIrsh\fR with just a port and no argument is the standard way
  1556. Xto log onto a remote machine.
  1557. X
  1558. X
  1559. X
  1560. /
  1561. echo x - rz
  1562. sed '/^X/s///' > rz << '/'
  1563. X.CD "rz \(en receive a file using the zmodem protocol"
  1564. X.SX "rz\fR [\(en\fBabepqvy\fR]\fR [\fB\(ent \fItimeout\fR]
  1565. X.FL "\(ena" "CP/M to UNIX conventions"
  1566. X.FL "\(enb" "Binary file"
  1567. X.FL "\(ene" "Escape for all control characters"
  1568. X.FL "\(enp" "Protect file if it already exists"
  1569. X.FL "\(enq" "Quiet; opposite of verbose"
  1570. X.FL "\(ent" "Set \fItimeout\fR in tenths of a second"
  1571. X.FL "\(env" "Verbose; opposite of quiet"
  1572. X.FL "\(eny" "Yes, clobber existing files"
  1573. X.EX "rz </dev/tty1 >/dev/tty1" "Receive a file"
  1574. X.PP
  1575. X\fIRz\fR is a program that accepts a file sent from another computer using the
  1576. Xzmodem protocol.
  1577. XIt is a highly complex program.
  1578. XSee Chap 9 for more details.
  1579. X
  1580. X
  1581. X
  1582. X.SP 1
  1583. /
  1584. echo x - sed
  1585. sed '/^X/s///' > sed << '/'
  1586. X.CD "sed \(en stream editor"
  1587. X.SX "sed\fR [\fB\(enegn\fR]\fR [\fB\(enf \fIscript_file\fR]\fR [\fIedit_script\fR] [\fIfile\fR]"
  1588. X.FL "\(ene" "Accept multiple commands commands on the commands line"
  1589. X.FL "\(enf" "The following argument contains the edit script"
  1590. X.FL "\(eng" "Set the global flag on all substitute commands"
  1591. X.FL "\(enn" "Only output selected lines"
  1592. X.EX "sed \(enf script <file" "Run a sed script on \fIfile\fR"
  1593. X.EX "sed \(fm/pig/s//hog/g\(fm <file" "Replace \fIpig\fR by \fIhog\fR in the file"
  1594. X.PP
  1595. X\fISed\fR is a stream editor.
  1596. XIt takes an edit script either from its argument or a file, and performs
  1597. Xan edit session on a named file or \fIstdin\fR, producing output 
  1598. Xon \fIstdout\fR.
  1599. X
  1600. X
  1601. X
  1602. X.SP 1
  1603. /
  1604. echo x - settype
  1605. sed '/^X/s///' > settype << '/'
  1606. X.CD "settype \(en set type and/or creator of a Mac file [MACINTOSH]"
  1607. X.SX "settype \fR [\fB\(enc \fRcreator] [\fB\(ent \fRtype] \fIfile\fR"
  1608. X.FL "\(enc" "Set the creator flag"
  1609. X.FL "\(ent" "Set the type flag"
  1610. X.EX "settype vol:dir:f" "Show the type and creator flags of file \fIf\fR"
  1611. X.EX "settype -t TEXT vol:f" "Set the type of the file \fIf\fR to TEXT"
  1612. X.PP
  1613. X.I Settype
  1614. Xwill report or set the creator and/or type of the specified Macintosh file.
  1615. X
  1616. X
  1617. X
  1618. X.SP 2
  1619. /
  1620. echo x - sh
  1621. sed '/^X/s///' > sh << '/'
  1622. X.CD "sh \(en shell"
  1623. X.SX "sh\fR [\fIfile\fR]"
  1624. X.FL "\fR(none)"
  1625. X.EY "sh < script" "Run a shell script"
  1626. X.PP
  1627. X.I Sh
  1628. Xis the shell.
  1629. XIt permits redirection of input and output, pipes, magic characters, 
  1630. Xbackground processes, shell scripts and most of the other features of 
  1631. Xthe V7 (Bourne) shell.
  1632. XA few of the more common commands are listed below:
  1633. X.nf
  1634. X.ta 2i 2.5i 3i 
  1635. X.HS
  1636. X.in +0.25i
  1637. Xdate    # Regular command
  1638. Xsort <file    # Redirect \fIstdin\fR
  1639. Xsort <file1  >file2    # Redirect \fIstdin\fR and \fIstdout\fR
  1640. Xcc file.c  2>error    # Redirect \fIstderr\fR
  1641. Xa.out >f  2>&1    # Combine standard output and standard error
  1642. Xsort <file1  >>file2    # Append output to \fIfile2\fR
  1643. Xsort <file1  >file2 &    # Background job
  1644. X(ls \(enl; a.out) &    # Run two background commands sequentially
  1645. Xsort <file | wc    # Two-process pipeline
  1646. Xsort <f | uniq | wc    # Three-process pipeline
  1647. Xls \(enl *.c    # List all files ending in \fI.c\fR
  1648. Xls \(enl [\fIa-c\fR]*    # List all files beginning with \fIa\fR, \fIb\fR, or \fIc\fR
  1649. Xls \(enl ?    # List all one-character file names
  1650. Xls \\?    # List the file whose name is question mark
  1651. Xls \(fm???\(fm    # List the file whose name is three question marks
  1652. Xv=/usr/ast    # Set shell variable \fIv\fR
  1653. Xls \(enl $v    # Use shell variable \fIv\fR
  1654. XPS1=\(fmHi! \(fm    # Change the primary prompt to \fIHi!\fR
  1655. XPS2=\(fmMore: \(fm    # Change the secondary prompt to \fIMore:\fR 
  1656. Xls \(enl $HOME    # List the home directory
  1657. Xecho $PATH    # Echo the search path
  1658. Xif ... then ... else ... fi    # If statement
  1659. Xfor ... do ... done    # Iterate over argument list
  1660. Xwhile ... do ... done    # Repeat while condition holds
  1661. Xcase ... in ...  esac    # Select clause based on condition
  1662. Xecho $?    # Echo exit status of previous command
  1663. Xecho $$    # Echo shell's pid
  1664. Xecho $#    # Echo number of parameters (shell script)
  1665. Xecho $2    # Echo second parameter (shell script)
  1666. Xecho $*    # Echo all parameters (shell script)
  1667. X.in -0.25i
  1668. X.fi
  1669. X
  1670. X
  1671. X
  1672. /
  1673. echo x - shar
  1674. sed '/^X/s///' > shar << '/'
  1675. X.CD "shar \(en shell archiver"
  1676. X.SX "shar \fIfile ..."
  1677. X.FL "\fR(none)"
  1678. X.EX "shar *.c >s" "Collect C programs in shell archive"
  1679. X.EX "sh <s" "Extract files from a shell archive"
  1680. X.PP
  1681. XThe named files are collected together into a shell archive written onto
  1682. Xstandard output.
  1683. XThe individual files can be extracted by redirecting the shell archive into
  1684. Xthe shell.
  1685. XThe advantage of
  1686. X.I shar
  1687. Xover
  1688. X.I ar
  1689. Xis that \fIshar\fP archives can be read on almost any 
  1690. X.UX
  1691. Xsystem, whereas numerous, incompatible versions of
  1692. X.I ar
  1693. Xare in widespread use.
  1694. XExtracting the files from a shell archive requires that 
  1695. X.I sed
  1696. Xbe accessible.
  1697. X
  1698. X
  1699. X
  1700. /
  1701. echo x - sherver
  1702. sed '/^X/s///' > sherver << '/'
  1703. X.CD "sherver \(en shell server [IBM]"
  1704. X.SX "sherver \fIport"
  1705. X.FL "\fR(none)"
  1706. X.EY "sherver machine1" "Start a sherver listening to \fIport\fR"
  1707. X.PP
  1708. XThe \fIrsh\fR command does its remote execution by doing a remote 
  1709. Xprocedure call to some sherver.  
  1710. XThe sherver executes the command and then exits.  Usually a
  1711. Xmaster will be running to make a new one.  Because shervers get their input 
  1712. Xfrom a pipe, remote execution cannot handle signals and CTRL-D, because they
  1713. Xcannot be sent down a pipe.
  1714. X
  1715. X
  1716. X
  1717. /
  1718. echo x - size
  1719. sed '/^X/s///' > size << '/'
  1720. X.CD "size \(en print text, data, and bss size of a program"
  1721. X.SX "size\fR [\fIfile\fR] ..."
  1722. X.FL "\fR(none)"
  1723. X.EY "size file" "Print the size of \fIfile\fP"
  1724. X.PP
  1725. XThe text, data, bss, and total sizes for each argument are printed.
  1726. XIf no arguments are present, 
  1727. X.I a.out
  1728. Xis assumed.
  1729. XThe amount of memory available for combined stack and data segment growth
  1730. Xis printed in the column \*(OQstack.\*(CQ
  1731. XThis is the value manipulated by the 
  1732. X.I chmem
  1733. Xcommand.
  1734. XThe total amount of memory allocated to the program when it is loaded is
  1735. Xlisted under \*(OQmemory.\*(CQ
  1736. XThis value is just the sum of the other four columns.
  1737. X
  1738. X
  1739. X
  1740. /
  1741. echo x - sleep
  1742. sed '/^X/s///' > sleep << '/'
  1743. X.CD "sleep \(en suspend execution for a given number of seconds"
  1744. X.SX "sleep \fIseconds"
  1745. X.FL "\fR(none)"
  1746. X.EY "sleep 10" "Suspend execution for 10 sec."
  1747. X.PP
  1748. XThe caller is suspended for the indicated number of seconds.
  1749. XThis command is typically used in shell scripts.
  1750. X
  1751. X
  1752. X
  1753. /
  1754. echo x - sort
  1755. sed '/^X/s///' > sort << '/'
  1756. X.CD "sort \(en sort a file of ASCII lines"
  1757. X.SX "sort\fR [\fB\(enbcdf\&imnru\fR]\fR [\fB\(ent\fIc\fR]  [\fB\(eno \fIname\fR] [\fB+\fIpos1\fR] [\fB\(en\fIpos2\fR] \fIfile\fR ..."
  1758. X.FL "\(enb" "Skip leading blanks when making comparisons"
  1759. X.FL "\(enc" "Check to see if a file is sorted"
  1760. X.FL "\(end" "Dictionary order: ignore punctuation"
  1761. X.FL "\(enf" "Fold upper case onto lower case"
  1762. X.FL "\(eni" "Ignore nonASCII characters"
  1763. X.FL "\(enm" "Merge presorted files"
  1764. X.FL "\(enn" "Numeric sort order"
  1765. X.FL "\(eno" "Next argument is output file"
  1766. X.FL "\(enr" "Reverse the sort order"
  1767. X.FL "\(ent" "Following character is field separator"
  1768. X.FL "\(enu" "Unique mode (delete duplicate lines)"
  1769. X.EX "sort \(ennr file" "Sort keys numerically, reversed"
  1770. X.EX "sort +2 \(en4 file" "Sort using fields 2 and 3 as key"
  1771. X.EX "sort +2 \(ent: \(eno out" "Field separator is \fI:\fP"
  1772. X.EX "sort +.3 \(en.6" "Characters 3 through 5 form the key"
  1773. X.PP
  1774. X.I Sort
  1775. Xsorts one or more files.
  1776. XIf no files are specified, \fIstdin\fR is sorted.
  1777. XOutput is written on standard output, unless \fB\(eno\fP is specified.
  1778. XThe options \fB+\fIpos1 \fB\(en\fIpos2\fR use only fields \fIpos1\fR
  1779. Xup to but not including \fIpos2\fR as the sort key, where a field is a
  1780. Xstring of characters delimited by spaces and tabs, unless a different field
  1781. Xdelimiter is specified with \fB\(ent\fR.
  1782. XBoth \fIpos1\fR and \fIpos2\fR have the form \fIm.n\fR where \fIm\fR tells
  1783. Xthe number of fields and \fIn\fR tells the number of characters.
  1784. XEither \fIm\fR or \fIn\fR may be omitted.
  1785. X
  1786. X
  1787. X
  1788. /
  1789. echo x - spell
  1790. sed '/^X/s///' > spell << '/'
  1791. X.CD "spell \(en print all words in a file not present in the dictionary"
  1792. X.SX "spell \fIfile"
  1793. X.FL "\fR(none)"
  1794. X.EY "spell document" "Print the spelling errors on \fIstdout\fR"
  1795. X.PP
  1796. X\fISpell\fR is the 
  1797. X.MX
  1798. Xspelling checker.  
  1799. XIt is actually a short shell script.
  1800. XFirst, the program \fIprep\fR strips off the \fIroff\fR, 
  1801. X\fInroff\fR, and \fItroff\fR control lines,
  1802. Xand the punctuation, and lists each word on a separate line.  These words are
  1803. Xthen sorted.  The resulting output is then compared to the dictionary.  Words
  1804. Xpresent in the file but not present in the dictionary are listed.  The
  1805. Xdictionary must be located in \fI/usr/lib/dictionary\fR.
  1806. X
  1807. X
  1808. X
  1809. /
  1810. echo x - split
  1811. sed '/^X/s///' > split << '/'
  1812. X.CD "split \(en split a large file into several smaller files"
  1813. X.SX "split\fR [\fB\(en\fIn\fR]\fR [\fIfile \fR[\fIprefix\fR]\fR]"
  1814. X.FL "\(en\fIn\fP" "Number of lines per piece (default: 1000)"
  1815. X.EX "split \(en200 file" "Split \fIfile\fP into pieces of 200 lines each"
  1816. X.EX "split file z" "Split \fIfile\fP into \fIzaa\fP, \fIzab\fP, etc."
  1817. X.PP
  1818. X.I Split 
  1819. Xreads \fIfile\fP and writes it out in \fIn\fP-line pieces.
  1820. XBy default, the pieces are called \fIxaa\fP, \fIxab\fP, etc.
  1821. XThe optional second argument can be used to provide an alternative
  1822. Xprefix for the output file names.
  1823. X
  1824. X
  1825. X
  1826. /
  1827. echo x - strings
  1828. sed '/^X/s///' > strings << '/'
  1829. X.CD "strings \(en print all the strings in a binary file"
  1830. X.SX "strings\fR [\fB\(en\fR] [\fB\(eno\fR]\fR [\fB\(en\fIn\fR] \fIfile ..."
  1831. X.FL "\(en" "search whole file, not just data seg"
  1832. X.FL "\(eno" "Print octal offset of each string"
  1833. X.FL "\(en\fIn" "\fIn\fR is minimum length string (default = 4)"
  1834. X.EX "strings \(en5 a.out" "Print the strings > 4 chars in \fIa.out\fR"
  1835. X.EX "strings \(en /bin/sh" "Search entire shell file (text and data)"
  1836. X.PP
  1837. X\fIStrings\fR looks for sequences of ASCII characters followed by a zero 
  1838. Xbyte.
  1839. XThese are usually strings.  This program is typically used to help identify
  1840. Xunknown binary programs
  1841. X
  1842. X
  1843. X
  1844. X.SP 1.5
  1845. /
  1846. echo x - strip
  1847. sed '/^X/s///' > strip << '/'
  1848. X.CD "strip \(en remove symbol table from executable file"
  1849. X.SX "strip\fR [\fIfile\fR] ..."
  1850. X.FL "\fR(none)"
  1851. X.EY "strip a.out" "Remove symbols from \fIa.out\fR"
  1852. X.PP
  1853. XFor each file argument, \fIstrip\fR removes the symbol table.  
  1854. XStrip makes a copy of the file being stripped, so links are lost.
  1855. X
  1856. X
  1857. X
  1858. X.SP 1.5
  1859. /
  1860. echo x - stterm
  1861. sed '/^X/s///' > stterm << '/'
  1862. X.CD "stterm \(en turn system into a dumb terminal [68000]"
  1863. X.SX "stterm \fR[\fB\(ens \fIspeed\fR] [\fB\(enl \fIline\fR] [\fB\(ene \fIescapechar\fR]"
  1864. X.FL "\(ens" "Specify speed (default is 9600 baud)"
  1865. X.FL "\(enl" "Specify line (default is /dev/tty1)"
  1866. X.FL "\(ene" "Redefine escape character (default is tilde)"
  1867. X.EY "stterm \(ens 1200" "Talk to /dev/tty1 at 1200 baud"
  1868. X.PP
  1869. X.I Stterm
  1870. Xallows
  1871. X.MX
  1872. Xto talk to a terminal or modem over an RS232 line.
  1873. XIt starts two other programs, a reader and a writer.
  1874. XThe reader monitors the RS232 line and copies all characters to the
  1875. Xscreen, while the writer monitors the keyboard and copies all
  1876. Xcharacters to the RS232 line.
  1877. X.PP
  1878. XSince all characters are transferred to the RS232 line, a special
  1879. Xescape character is present to control the behaviour of
  1880. X.I stterm
  1881. Xitself.
  1882. XBy default the escape character is the \(ap character, but it can be
  1883. Xredefined using the \fB\(ene\fR flag.
  1884. XIf the escape character is followed by a period or a CTRL-D
  1885. Xcharacter, the program terminates. 
  1886. XIf the escape character is followed by an ! (exclamation mark)
  1887. Xa subshell is started. 
  1888. XTo transmit the escape character, enter it twice. 
  1889. XAn escape character followed by something other than CTRL-D, period,
  1890. Xexclamation mark, or another escape character is invalid and generates
  1891. Xan error message.
  1892. X
  1893. X
  1894. X
  1895. /
  1896. echo x - stty
  1897. sed '/^X/s///' > stty << '/'
  1898. X.CD "stty \(en set terminal parameters"
  1899. X.SX "stty\fR [\fIoption ...\fR]
  1900. X.FL "\fR(none)"
  1901. X.EX "stty \(enecho" "Suppress echoing of input"
  1902. X.EX "stty erase #" "Set the erase character to \fI#\fP"
  1903. X.PP
  1904. XWhen given no arguments,
  1905. X.I stty
  1906. Xprints the current terminal parameters.
  1907. XIt can also be used to set the parameters, as follows:
  1908. X.ta 0.25i 1i
  1909. X.HS
  1910. X    \fBcbreak\fP    \(en Enter \fIcbreak\fP mode; erase and kill disabled
  1911. X.br
  1912. X    \fBecho\fP    \(en Echo input on the terminal
  1913. X.br
  1914. X    \fBnl\fP    \(en Accept only line feed to end lines
  1915. X.br
  1916. X    \fBraw\fP    \(en Enter \fIraw\fP mode; no input processing at all
  1917. X.br
  1918. X    \fBtabs\fP    \(en Output tabs (do not expand to spaces)
  1919. X.br
  1920. X    \fBerase\fR c    \(en Set erase character (initially backspace)
  1921. X.br
  1922. X    \fBint\fR c    \(en Set interrupt (SIGINT) character (initially DEL)
  1923. X.br
  1924. X    \fBkill\fR c    \(en Set kill line character (initially @)
  1925. X.br
  1926. X    \fBquit\fR c    \(en Set quit (SIGQUIT) character (initially CTRL-\\)
  1927. X.br
  1928. X    \fBeven\fR    \(en Use even parity
  1929. X.br
  1930. X    \fBodd\fR    \(en Use odd parity
  1931. X.br
  1932. X    \fB[5-8]\fR    \(en Number of bits per character
  1933. X.br
  1934. X    \fB[110-9600]\fR    \(en Baud rate
  1935. X.br
  1936. X    \fBdefault\fR    \(en Set options back to original values
  1937. X.HS
  1938. XThe first five options may be prefixed by \fB\(en\fP as in \fB\(entabs\fP
  1939. Xto turn the option off.
  1940. XThe next four options each have a single character parameter separated by a
  1941. Xspace from the option.
  1942. XThe \fBdefault\fR option sets the mode and the four settable characters back
  1943. Xto the values they had when the system was booted.
  1944. XIt is useful when a rogue program has messed them up.
  1945. X
  1946. X
  1947. X
  1948. X.SP 2.0
  1949. /
  1950. echo x - su
  1951. sed '/^X/s///' > su << '/'
  1952. X.CD "su \(en temporarily log in as superuser or another user"
  1953. X.SX "su\fR [\fIname\fR]"
  1954. X.FL "\fR(none)"
  1955. X.EX "su~~~~" "Become superuser"
  1956. X.EX "su ast" "Become \fIast\fR"
  1957. X.PP
  1958. X.I Su
  1959. Xcan be used to temporarily login as another user.
  1960. XIt prompts for the superuser password.
  1961. XIf the correct password is entered,
  1962. X.I su
  1963. Xcreates a shell with the desired uid.
  1964. XIf no name is specified, \fIroot\fR is assumed.
  1965. XTo exit the temporary shell, type CTRL-D.
  1966. XWhen memory is tight, it is better to become superuser by logging out and
  1967. Xthen logging in again as \fIroot\fR, rather than using \fIsu\fR since the
  1968. Xlatter creates an extra shell in memory.
  1969. X
  1970. X
  1971. /
  1972. echo x - sum
  1973. sed '/^X/s///' > sum << '/'
  1974. X.CD "sum \(en compute the checksum and block count of a file"
  1975. X.SX "sum \fIfile"
  1976. X.FL "\fR(none)"
  1977. X.EX "sum /user/ast/xyz" "Checksum \fI/user/ast/xyz"
  1978. X.PP
  1979. X.I Sum
  1980. Xcomputes the checksum of one or more files.
  1981. XIt is most often used to see if a file copied from another machine has
  1982. Xbeen correctly received.
  1983. XThis program works best when both machines use the same checksum algorithm.
  1984. XSee also \fIcrc\fR.
  1985. X
  1986. X
  1987. X
  1988. X.SP 2
  1989. /
  1990. echo x - svc
  1991. sed '/^X/s///' > svc << '/'
  1992. X.CD "svc \(en shell version control system"
  1993. X.SX "ci\fR [\fB\(enlu\fR]\fR \fIfile"
  1994. X.SX "co\fR [\fB\(enl\fR]\fR [\fB\(enr \fIrev\fR] \fIfile"
  1995. X.SX "svc \fIfile"
  1996. X.FL "\(enl" "For \fIci\fR, checkin, checkout again, and lock file"
  1997. X.FL "\(enl" "For \fIco\fR, checkout file and then lock the archive"
  1998. X.FL "\(enu" "After checking in, do not delete the file"
  1999. X.FL "\(enr" "Check out revision \fIrev\fR instead most recent revision
  2000. X.EX "ci \(enu file" "Check in \fIfile\fR"
  2001. X.EX "co \(enl file" "Check out \fIfile\fR and lock archive"
  2002. X.EX "co \(enr 2 file" "Check out version 2"
  2003. X.PP
  2004. X\fISvc\fR is the Shell Version Control system, patterned on RCS.
  2005. XIt maintains a sequence of versions in archive files, so that new versions
  2006. Xcan be checked in (added to the archive), and old versions can be checked
  2007. Xout (made available).
  2008. XTo create an archive for \fIfile\fR, check it in with the \fB\(enu\fR flag.
  2009. XThis action will prompt for a log message and then create an archive called
  2010. X\fIfile,S\fR in the current directory, or in the subdirectory \fISVC\fR if 
  2011. Xit exists.  
  2012. XThe file will not be deleted, but will be made unwritable.
  2013. X.PP
  2014. XTo update the file, check it out with the \fB\(enl\fR flag.
  2015. XThen modify it, and check it back in, giving a new message when prompted.
  2016. XAfter this process has been repeated many times, the archive will contain
  2017. Xthe entire history.
  2018. XAny version can be checked out using the \fB\(enr\fR flag.
  2019. XTo get a printout of the history, use \fIsvclog\fR.
  2020. X
  2021. X
  2022. X
  2023. /
  2024. echo x - sync
  2025. sed '/^X/s///' > sync << '/'
  2026. X.CD "sync \(en flush the cache to disk"
  2027. X.SX "sync"
  2028. X.FL "\fR(none)"
  2029. X.EY "sync" "Write out all modified cache blocks"
  2030. X.PP
  2031. X.MX
  2032. Xmaintains a cache of recently used disk blocks.
  2033. XThe 
  2034. X.I sync
  2035. Xcommand writes any modified cache blocks back to the disk.
  2036. XThis is essential before stopping the system, and should be done before
  2037. Xrunning any
  2038. X.I a.out
  2039. Xprogram that might crash.
  2040. X
  2041. X
  2042. X
  2043. /
  2044. echo x - sz
  2045. sed '/^X/s///' > sz << '/'
  2046. X.CD "sz \(en send a file using the zmodem protocol"
  2047. X.SX "sz\fR [\fB\(enLNbdefnopqruvy+\fR]\fR [\fB\(enci \fIcommand\fR] [\fB\(enLl\fR n\fR] [\fB\(ent \fItimeout\fR]
  2048. X.FL "\(enL" "Use \fIn\fR-byte packets"
  2049. X.FL "\(enN" "Overwrite if source is newer/longer"
  2050. X.FL "\(enb" "Binary file"
  2051. X.FL "\(enc" "Send command for execution"
  2052. X.FL "\(end" "Convert dot to slash in names"
  2053. X.FL "\(ene" "Escape for all control characters"
  2054. X.FL "\(enf" "Send full path name"
  2055. X.FL "\(eni" "Send command and return immediately"
  2056. X.FL "\(enl" "Flow control every \fIn\fR packets"
  2057. X.FL "\(enn" "Overwrite destination if source is newer"
  2058. X.FL "\(eno" "Use old (16-bit) checksum"
  2059. X.FL "\(enp" "Protect file if it already exists"
  2060. X.FL "\(enq" "Quiet; opposite of verbose"
  2061. X.FL "\(enr" "Resume interrupt file transfer"
  2062. X.FL "\(ent" "Set \fItimeout\fR in tenths of a second"
  2063. X.FL "\(enu" "Unlink file after successful transmission"
  2064. X.FL "\(env" "Verbose; opposite of quiet"
  2065. X.FL "\(eny" "Yes, clobber existing files"
  2066. X.FL "\(en+" "Append to an existing file"
  2067. X.EY "sz file </dev/tty1 >/dev/tty1" "Send \fIfile\fR"
  2068. X.PP
  2069. XXMODEM, YMODEM, and ZMODEM are a family of protocols that are widely used
  2070. Xis the \s-2MS-DOS\s0 world for transferring information reliably from one
  2071. Xcomputer to another.  In all of these protocols, a series of bytes are sent
  2072. Xfrom one computer to the other, and then an acknowledgement is sent back
  2073. Xto confirm correct reception.  Checksums are used to detect errors so that
  2074. Xtransmission is reliable even in the face of noisy telephone lines.
  2075. X\fISz\fR is a program that sends a file sent from another computer using the
  2076. Xzmodem protocol.
  2077. XThe file can be received using \fIrz\fR.
  2078. XBoth are a highly complex programs.
  2079. XSee Chap. 9 for more information.
  2080. XFor an alternative, see \fIkermit\fR.
  2081. X
  2082. X
  2083. X
  2084. /
  2085. echo x - tail
  2086. sed '/^X/s///' > tail << '/'
  2087. X.CD "tail \(en print the last few lines of a file"
  2088. X.SX "tail\fR [\fB\(enc \fIn\fR] [\fB\(enf] [\fB\(enn \fIn\fR] [\fIfile\fR] ..."
  2089. X.FL "\(enc" "The count refers to characters"
  2090. X.FL "\(enf" "On FIFO or special file, keep reading after EOF"
  2091. X.FL "\(enn" "The count refers to lines"
  2092. X.EX "tail \(enn 6" "Print last 6 lines of \fIstdin\fR"
  2093. X.EX "tail \(enc 20 file" "Print the last 20 characters of \fIfile\fR"
  2094. X.EX "tail \(enn 1 file1 file2" "Print last line of two files"
  2095. X.EX "tail \(enn +8 file" "Print the tail starting with line 8"
  2096. X.PP
  2097. XThe last few lines of one or more files are printed.
  2098. XThe default count is 10 lines.
  2099. XThe default file is \fIstdin\fR.
  2100. XIf the value of \fIn\fR for the \fB\(enc\fR or \fB\(enn\fR flags starts with
  2101. Xa + sign, counting starts at the beginning, rather than the end of the file.
  2102. X
  2103. X
  2104. X
  2105. /
  2106. echo x - tar
  2107. sed '/^X/s///' > tar << '/'
  2108. X.CD "tar \(en tape archiver"
  2109. X.SX "tar\fR [\fBFcotvx\fR]\fR [\fBf\fR] \fItarfile \fIfile ...
  2110. X.FL "F" "Force tar to continue after an error"
  2111. X.FL "c" "Create a new archive; add named files"
  2112. X.FL "o" "Set uid/gid to original values on extraction"
  2113. X.FL "f" "Next argument is name of tarfile"
  2114. X.FL "t" "Print a table listing the archive's contents"
  2115. X.FL "v" "Verbose mode-tell what is going on as it happens"
  2116. X.FL "x" "The named files are extracted from the archive"
  2117. X.EX "tar c /dev/fd1 ." "Back up current directory to \fI/dev/fd1\fR"
  2118. X.EX "tar xv /dev/fd1 file1 file2" "Extract two files from the archive"
  2119. X.EX "tar cf \(en | (cd dest; tar xf \(en)" "Copy current directory to \fIdest\fR"
  2120. X.PP
  2121. X\fITar\fR is a POSIX-compatible archiver, except that it does not use tape.
  2122. XIt's primary advantage over
  2123. X.I ar
  2124. Xis that the 
  2125. X.I tar
  2126. Xformat is somewhat more standardized than the
  2127. X.I ar 
  2128. Xformat, making it theoretically possible to transport 
  2129. X.MX
  2130. Xfiles to another computer, but do not bet on it.
  2131. XIf the target machine runs
  2132. X.SY MS-DOS ,
  2133. Xtry
  2134. X.I doswrite .
  2135. X
  2136. X
  2137. X
  2138. /
  2139. echo x - tee
  2140. sed '/^X/s///' > tee << '/'
  2141. X.CD "tee \(en divert \fIstdin\fP to a file"
  2142. X.SX "tee\fR [\fB\(enai\fR] \fIfile\fR ..."
  2143. X.FL "\(ena" "Append to the files, rather than overwriting"
  2144. X.FL "\(eni" "Ignore interrupts"
  2145. X.EX "cat file1 file2 | tee x" "Save and display two files"
  2146. X.EX "pr file | tee x | lpr" "Save the output of \fIpr\fP on \fIx\fP"
  2147. X.PP
  2148. X.I Tee
  2149. Xcopies \fIstdin\fR to standard output.
  2150. XIt also makes copies on all the files listed as arguments.
  2151. X
  2152. X
  2153. X
  2154. /
  2155. echo x - term
  2156. sed '/^X/s///' > term << '/'
  2157. X.CD "term \(en turn PC into a dumb terminal [IBM]"
  2158. X.SX "term\fR [\fIbaudrate\fR]\fR [\fIparity\fR] [\fIbits_per_character\fR]"
  2159. X.FL "\fR(none)"
  2160. X.EX "term 2400" "Talk to modem at 2400 baud"
  2161. X.EX "term 1200 7 even" "1200 baud, 7 bits/char, even parity"
  2162. X.EX "term 8 9600" "9600 baud, 8 bits/char, no parity"
  2163. X.PP
  2164. X\fITerm\fR allows 
  2165. X.MX
  2166. Xto talk to a terminal or modem over RS232 
  2167. Xport 1.  The program first sets the baudrate, parity and character length, 
  2168. Xand then forks.
  2169. XThe parent sits in a loop copying from \fIstdin\fR (usually the console's
  2170. Xkeyboard), to the terminal or modem (\fI/dev/tty1\fR).  
  2171. XThe child sits in a loop
  2172. Xcopying from the terminal or modem (\fI/dev/tty1\fR) to standard output.  
  2173. XThus when
  2174. XRS232 port 1 is connected to a modem, every keystroke typed on the keyboard
  2175. Xis sent to the modem, and every character arriving from the modem is displayed.
  2176. XStandard input and output may be redirected, to provide a primitive file
  2177. Xtransfer program, with no checking.  To exit \fIterm\fR, 
  2178. Xhit the middle button on the numeric pad.
  2179. XImportant note: to use \fIterm\fR, it is essential that 
  2180. X\fI/etc/ttys\fR is configured so
  2181. Xthat there is no shell hanging on \fI/dev/tty1\fR.  
  2182. XIf there is, both the shell and
  2183. Xterm will try to read from \fI/dev/tty1\fR, and nothing will work.
  2184. X
  2185. X
  2186. X
  2187. X.SP 0.5
  2188. /
  2189. echo x - termcap
  2190. sed '/^X/s///' > termcap << '/'
  2191. X.CD "termcap \(en print the current termcap entry"
  2192. X.SX "termcap\fR [\fItype\fR]"
  2193. X.FL "\fR(none)"
  2194. X.EY "termcap" "Print the termcap entry"
  2195. X.PP
  2196. X\fITermcap\fR reads the /etc/termcap entry corresponding to the 
  2197. Xterminal type
  2198. Xsupplied as the argument.  If none is given, the current $TERM is used.
  2199. XIt then prints out all the parameters that apply.
  2200. X
  2201. X
  2202. X
  2203. X.SP 0.5
  2204. /
  2205. echo x - test
  2206. sed '/^X/s///' > test << '/'
  2207. X.CD "test \(en test for a condition"
  2208. X.SX "test \fIexpr"
  2209. X.FL "\fR(none)"
  2210. X.EY "test \(enr file" "See if file is readable"
  2211. X.PP
  2212. X\fITest\fR checks to see if files exist, are readable, etc. and returns
  2213. Xan exit status of zero if true and nonzero if false.  The legal operators are
  2214. X.sp
  2215. X.nf
  2216. X.ta 0.5i 1.5i
  2217. X    \(enr file    true if the file is readable
  2218. X    \(enw file    true if the file is writable
  2219. X    \(enx file    true if the file is executable
  2220. X    \(enf file    true if the file is not a directory
  2221. X    \(end file    true if the file is a directory
  2222. X    \(ens file    true if the file exists and has a size > 0
  2223. X    \(ent fd    true if file descriptor fd (default 1) is a terminal
  2224. X    \(enz s    true if the string s has zero length
  2225. X    \(enn s    true if the string s has nonzero length
  2226. X    s1 = s2    true if the strings s1 and s2 are identical
  2227. X    s1 != s2    true if the strings s1 and s2 are different
  2228. X    m \(eneq m    true if the integers m and n are numerically equal
  2229. X.fi
  2230. X
  2231. XThe operators \fB\(engt\fR, \fB\(enge\fR, \fB\(enne\fR, \fB\(enle\fR, and
  2232. X\fB\(enlt\fR may be used as well.
  2233. XThese operands may be combined with \fB\(ena\fR (Boolean and), 
  2234. X\fB\(eno\fR (Boolean or), !
  2235. X(negation).  
  2236. XThe priority of \fB\(ena\fR is higher than that of \fB\(eno\fR.  
  2237. XParentheses are permitted, but must be escaped to keep the shell from trying 
  2238. Xto interpret them.
  2239. X
  2240. X
  2241. X
  2242. /
  2243. echo x - time
  2244. sed '/^X/s///' > time << '/'
  2245. X.CD "time \(en report how long a command takes"
  2246. X.SX "time \fIcommand"
  2247. X.FL "\fR(none)"
  2248. X.EX "time a.out" "Report how long \fIa.out\fR takes"
  2249. X.EX "time ls \(enl *.c" "Report how long \fIls\fR takes"
  2250. X.PP
  2251. XThe command is executed and the real time, user time, and system time (in
  2252. Xhours, minutes, and seconds) are printed.
  2253. XShell scripts cannot be timed.
  2254. X
  2255. X
  2256. X
  2257. /
  2258. echo x - to
  2259. sed '/^X/s///' > to << '/'
  2260. X.CD "to \(en output half of a connection [IBM]"
  2261. X.SX "to \fIport"
  2262. X.FL "\fR(none)"
  2263. X.EY "cat f1 f2 | to mach4" "Send the catted files to port"
  2264. X.PP
  2265. X\fITo\fR and 
  2266. X\fIfrom\fR are used together to provide connection-oriented service.
  2267. XOn the sending machine, the last member of a pipeline is \fIto port\fR.  
  2268. XOn the
  2269. Xreceiving machine, the first member of a pipe line is \fIfrom port\fR.  The net
  2270. Xresult is that the output of the sending pipeline goes into the input of the
  2271. Xreceiving pipeline, making pipelines work across the network. As a simple
  2272. Xexample, consider:
  2273. X.HS
  2274. X.nf
  2275. X    on machine1:    cat f1 f2 | to Johnny
  2276. X    on machine2:    from Johnny | sort >x
  2277. X.fi
  2278. X.HS
  2279. XThe effect of these two commands is that the files f1 and f2 are concatenated,
  2280. Xtransferred to machine 2, and sorted there, with the output going to a file 
  2281. X\fIx\fR 
  2282. Xon machine 2.  The string \fIJohnny\fR is used by 
  2283. Xthe transaction system to identify
  2284. Xwhich sender goes with which receiver; any unique string can be used.
  2285. XMultiple transfers may take place simultaneously between different pairs
  2286. Xof machines on the same Ethernet.
  2287. X
  2288. X
  2289. X
  2290. /
  2291. echo x - tos
  2292. sed '/^X/s///' > tos << '/'
  2293. X.CD "tos \(en list, read and write \s-2TOS\s0 file systems [ATARI]"
  2294. X.SX "tos \(en[Radlrw] \fIdrive\fR [\fIfile\fR]"
  2295. X.FL "\(enR" "Recursively descend directories when listing them"
  2296. X.FL "\(ena" "Read or write ASCII file"
  2297. X.FL "\(end" "Directory list"
  2298. X.FL "\(enl" "Use long format for directory listing"
  2299. X.FL "\(enr" "Read a \s-2TOS\s0 file into \s-2MINIX\s0"
  2300. X.FL "\(enw" "Write a \s-2MINIX\s0" file to \s-2TOS\s0"
  2301. X.EX "tos \(endl 1" "List root directory on /dev/fd1"
  2302. X.EX "tos \(enr hd4 g/adv >adv" "Read file \fIg/adv\fR from \fI/dev/hd4\fR"
  2303. X.EX "tos \(enwa /dev/fd0 f" "Copy ASCII \fIstdin\fR to \fIf\fR on \fI/dev/fd0\fR"
  2304. X.PP
  2305. X.I Tos
  2306. Xknows about \s-2TOS\s0 file system structures on diskettes and hard disks.
  2307. XIt can list directories and read and write files.
  2308. XSlashes should be used in file names, even though \s-2TOS\s0 uses backslashes.
  2309. XThe drive can be specified as number (in which case it is appended to 
  2310. X\fI/dev/fd\fR),
  2311. Xas absolute path name (like \fI/dev/fd0\fR), or as suffix 
  2312. Xto \fI/dev/\fR (like \fIhd4\fR).
  2313. XASCII files have the final CTRL-Z stripped, and \fITOS\fR carriage return
  2314. Xplus line feed is mapped to
  2315. X.MX
  2316. Xline feed.
  2317. X.I Tos
  2318. Xmay be linked to
  2319. X.I tosdir ,
  2320. X.I tosread
  2321. Xand
  2322. X.I toswrite ,
  2323. Xin which case the \fB\(end\fR, \fB\(enr\fR, and \fB\(enw\fR flags are not
  2324. Xneeded.
  2325. X
  2326. X
  2327. X
  2328. /
  2329. echo x - touch
  2330. sed '/^X/s///' > touch << '/'
  2331. X.CD "touch \(en update a file's time of last modification"
  2332. X.SX "touch\fR [\fB\(enc\fR] \fIfile\fR ..."
  2333. X.FL "\(enc" "Do not create the file"
  2334. X.EY "touch *.h" "Make the \fI.h\fP files look recent"
  2335. X.PP
  2336. XThe time of last modification is set to the current time.
  2337. XThis command is mostly used to trick
  2338. X.I make
  2339. Xinto thinking that a file is more recent than it really is.
  2340. XIf the file being touched does not exist, it is created, unless the \fB\(enc\fR
  2341. Xflag is present.
  2342. X
  2343. X
  2344. X
  2345. /
  2346. echo x - tr
  2347. sed '/^X/s///' > tr << '/'
  2348. X.CD "tr \(en translate character codes"
  2349. X.SX "tr\fR [\fB\(encds\fR]\fR [\fIstring1\fR] [\fIstring2\fR]"
  2350. X.FL "\(enc" "Complement the set of characters in \fIstring1\fR"
  2351. X.FL "\(end" "Delete all characters specified in \fIstring1\fR"
  2352. X.FL "\(ens" "Squeeze all runs of characters in \fIstring1\fR to one character"
  2353. X.EX "tr \(fm[a\(enz]\(fm \(fm[A\(enZ]\(fm <x >y~~~~~" "Convert upper case to lower case"
  2354. X.EX "tr \(end \(fm0123456789\(fm <f1 >f2~~" "Delete all digits from \fIf1\fR"
  2355. X.PP
  2356. X.I Tr
  2357. Xperforms simple character translation.
  2358. XWhen no flag is specified, each character in 
  2359. X.I string1
  2360. Xis mapped onto the corresponding character in
  2361. X.I string2 .
  2362. X
  2363. X
  2364. X
  2365. /
  2366. echo x - transfer
  2367. sed '/^X/s///' > transfer << '/'
  2368. X.CD "transfer \(en read, write and format diskettes [AMIGA]"
  2369. X.SX "transfer \fR[\fB\(enf\fR] [\fB\(enr\fR] [\fB\(enw \fIfile\fR]"
  2370. X.FL "\(enf" "Format a diskette (9 sectors/track)"
  2371. X.FL "\(enr" "Read a file from a special diskette on \fIstdout\fR"
  2372. X.FL "\(enw" "Write \fIfile\fR to a diskette"
  2373. X.EX "transfer \(enf" "Format a diskette (9 sectors/track)"
  2374. X.EX "transfer \(enr" "Read a file from a special diskette"
  2375. X.EX "transfer \(enw /etc/passwd" "Write /etc/passwd to a special diskette"
  2376. X.PP
  2377. X.I Transfer
  2378. Xreads and writes a file from and to a special diskette, one file per diskette.
  2379. XThis diskette can only be used to transfer files from and to AmigaDOS,
  2380. Xbecause nobody else can read it. Besides reading and writing diskettes,
  2381. Xthe AmigaDOS version of
  2382. X.I transfer
  2383. Xcan also format diskettes using the \fB\(enf\fR option. 
  2384. XIf you already have
  2385. Xan AmigaDOS program which can read and write diskettes you might
  2386. Xalso use \fItos\fR to exchange files between
  2387. X.MX
  2388. Xand AmigaDOS.
  2389. X.PP
  2390. XA typical session to copy \fIminix.img\fR from
  2391. X.MX
  2392. Xto AmigaDOS might look like this:
  2393. X.HS
  2394. X.Cx "#    transfer  \(enw  minix.img"
  2395. X.HS
  2396. X\fIMinix.img\fR will be written to diskette. When \fItransfer\fR is ready you
  2397. Xcan log out, and reboot the Amiga. Hit CTRL-D to abort the
  2398. Xstartup-sequence and type
  2399. X.HS
  2400. X.Cx "1>    cd RAM:"
  2401. X.br
  2402. X.Cx "1>    transfer  \(enr"
  2403. X.HS
  2404. Xto read \fIminix.img\fR and type
  2405. X.HS
  2406. X.Cx "1>    copy minix.img DF0:"
  2407. X.HS
  2408. Xto copy \fIminix.img\fR onto an AmigaDOS diskette.
  2409. X.PP
  2410. XImportant note: when \fItransfer\fR tells you to insert a special diskette 
  2411. Xand hit return, \fIdo not\fR do so before the drive LED has gone out, 
  2412. Xto prevent the Amiga from crashing.
  2413. X
  2414. X
  2415. X
  2416. /
  2417. echo x - traverse
  2418. sed '/^X/s///' > traverse << '/'
  2419. X.CD "traverse \(en print directory tree under the named directory"
  2420. X.SX "traverse \fIdir"
  2421. X.FL "\fR(none)"
  2422. X.EY "traverse ." "Print tree starting at working dir"
  2423. X.PP
  2424. X\fITraverse\fR prints the tree structure starting at the named directory. 
  2425. XAll the subdirectories are listed, with the depth shown by indentation.
  2426. X
  2427. X
  2428. X
  2429. X.SP 1
  2430. /
  2431. echo x - treecmp
  2432. sed '/^X/s///' > treecmp << '/'
  2433. X.CD "treecmp \(en recursively list differences in two directory trees"
  2434. X.SX "treecmp\fR [\fB\(encv\fR] \fIolddir newdir"
  2435. X.FL "\(enc" "(changes) list the names of changed or new files"
  2436. X.FL "\(env" "(verbose) list all directories processed"
  2437. X.EY "treecmp \(env /usr/ast/V1 /usr/ast/V2" "Compare two trees"
  2438. X.PP
  2439. X\fITreecmp\fR recursively descends the directory tree of its second
  2440. Xargument and compares all files to those at the corresponding position in 
  2441. Xthe first argument.  
  2442. XIf the two trees are identical, i.e., all the corresponding
  2443. Xdirectories and files are the same, there is no output.  Otherwise, a list
  2444. Xof files missing from one of the trees or present in both but whose contents
  2445. Xare not identical in both are printed.
  2446. XWhen the \fB\(enc\fR flag is given, only files that are changed from the old
  2447. Xversion or are new (i.e., absent in the old version) are listed.
  2448. X
  2449. X
  2450. X
  2451. /
  2452. echo x - true
  2453. sed '/^X/s///' > true << '/'
  2454. X.CD "true \(en exit with the value true"
  2455. X.SX "true"
  2456. X.FL "\fR(none)"
  2457. X.EY "while true" "List the directory until DEL is hit"
  2458. X.br
  2459. X    do ls \(enl
  2460. X.br
  2461. X    done
  2462. X.PP
  2463. XThis command returns the value
  2464. X.I true .
  2465. XIt is used for shell programming.
  2466. XThe program is in reality not a program at all.
  2467. XIt is the null file.
  2468. X
  2469. X
  2470. X
  2471. X.SP 1.5
  2472. /
  2473. echo x - tset
  2474. sed '/^X/s///' > tset << '/'
  2475. X.CD "tset \(en set the $TERM variable"
  2476. X.SX "tset\fR [\fIdevice\fR]"
  2477. X.FL "\fR(none)"
  2478. X.EY "eval \`tset\`" "Set TERM"
  2479. X.PP
  2480. X\fITset\fR is used almost exclusively to set the shell variable TERM from
  2481. Xinside profiles.  If an argument is supplied, that is used as the value of
  2482. XTERM.  Otherwise it looks in \fI/etc/ttytype\fR.
  2483. X
  2484. X
  2485. X
  2486. X.SP 1.5
  2487. /
  2488. echo x - tsort
  2489. sed '/^X/s///' > tsort << '/'
  2490. X.CD "tsort \(en topological sort [IBM]"
  2491. X.SX "tsort \fIfile"
  2492. X.FL "\fR(none)"
  2493. X.EX "lorder *.s | tsort" "Give library ordering"
  2494. X.EX "ar cr libc.a \`lorder *.s | tsort\`" "Build library"
  2495. X.PP
  2496. X\fITsort\fR accepts a file of lines containing ordered pairs and builds a
  2497. Xtotal ordering from the partial orderings.
  2498. X
  2499. X
  2500. X
  2501. X.SP 1.5
  2502. /
  2503. echo x - ttt
  2504. sed '/^X/s///' > ttt << '/'
  2505. X.CD "ttt \(en tic tac toe"
  2506. X.SX "ttt"
  2507. X.FL "\fR(none)"
  2508. X.EY "ttt~~~" "Start the game"
  2509. X.PP
  2510. XThis program allows the user to engage in a game of tic tac toe (noughts and
  2511. Xcrosses) with the computer.
  2512. XThe program uses the alpha-beta algorithm, so the user had better be sharp.
  2513. X
  2514. X
  2515. X
  2516. /
  2517. echo x - tty
  2518. sed '/^X/s///' > tty << '/'
  2519. X.CD "tty \(en print the device name of this tty"
  2520. X.SX "tty \fR[\fB\(ens\fR]"
  2521. X.FL "\(ens" "Silent mode, only the exit status is affected."
  2522. X.EY "tty~~~" "Print the tty name"
  2523. X.PP
  2524. XPrint the name of the controlling tty. If the flag \fB\(ens\fR is given,
  2525. X\fItty\fR is equivalent to the call to \fIisatty()\fR.
  2526. X
  2527. X
  2528. X
  2529. /
  2530. echo x - umount
  2531. sed '/^X/s///' > umount << '/'
  2532. X.CD "umount \(en unmount a mounted file system"
  2533. X.SX "/etc/umount \fIspecial"
  2534. X.FL "\fR(none)"
  2535. X.EY "/etc/umount /dev/fd1" "Unmount diskette 1"
  2536. X.PP
  2537. XA mounted file system is unmounted after the cache has been flushed to disk.
  2538. XA diskette should never be removed while it is mounted.
  2539. XIf this happens, and is discovered before another diskette is inserted, the
  2540. Xoriginal one can be replaced without harm.
  2541. XAttempts to unmount a file system holding working directories or open files
  2542. Xwill be rejected with a \*(OQdevice busy\*(CQ message.
  2543. X
  2544. X
  2545. X
  2546. /
  2547. echo x - unexpand
  2548. sed '/^X/s///' > unexpand << '/'
  2549. X.CD "unexpand \(en convert spaces to tabs"
  2550. X.SX "unexpand\fR [\fB\(ena\fR]
  2551. X.FL "\(ena" "All spaces are unexpanded"
  2552. X.EY "unexpand oldfile >newfile" "Convert leading spaces to tabs"
  2553. X.PP
  2554. X\fIUnexpand\fR replaces spaces in the named files with tabs.
  2555. XIf no files are listed, \fIstdin\fR is given.
  2556. XThe \fB\(ena\fR flag is used to force all sequences of spaces to be
  2557. Xexpanded, instead of just leading spaces (the default).
  2558. X
  2559. X
  2560. X
  2561. /
  2562. echo x - uniq
  2563. sed '/^X/s///' > uniq << '/'
  2564. X.CD "uniq \(en delete consecutive identical lines in a file"
  2565. X.SX "uniq\fR [\fB\(encdu\fR]\fR [\fB\(en\fIn\fR] [\fB+\fIn\fR] [\fIinput [\fIoutput\fR]\fR]
  2566. X.FL "\(enc" "Give count of identical lines in the input"
  2567. X.FL "\(end" "Only duplicate lines are written to output"
  2568. X.FL "\(enu" "Only unique lines are written to output"
  2569. X.FL "\(en\fIn\fR" "Skip the first \fIn\fR columns when matching"
  2570. X.FL "+\fIn\fR" "Skip the first \fIn\fR fields when matching"
  2571. X.EX "uniq +2 file" "Ignore first 2 fields when comparing"
  2572. X.EX "uniq \(end inf outf" "Write duplicate lines to \fIoutf\fP"
  2573. X.PP
  2574. X.I Uniq
  2575. Xexamines a file for consecutive lines that are identical.
  2576. XAll but duplicate entries are deleted, and the file is written to output.
  2577. XThe +\fIn\fR option skips the first \fIn\fR fields, where a field is defined
  2578. Xas a run of characters separated by white space.
  2579. XThe \(en\fIn\fP option skips the first \fIn\fR spaces.
  2580. XFields are skipped first.
  2581. X
  2582. X
  2583. /
  2584. echo x - unshar
  2585. sed '/^X/s///' > unshar << '/'
  2586. X.CD "unshar \(en Remove files from a shell archive"
  2587. X.SX "unshar\fR [\fB\(enbtvx\fR] \fIsharfile \fImember ..."
  2588. X.FL "\(enb" "Unshar brutally, overwriting files if need be"
  2589. X.FL "\(ent" "Tell what is in the archive but do not extract"
  2590. X.FL "\(env" "Verbose mode"
  2591. X.FL "\(enx" "Extract only the members listed"
  2592. X.EX "unshar arch.sh" "Extract all members of the archive"
  2593. X.EX "unshar \(ent arch.sh" "List the contents of the archive"
  2594. X.EX "unshar \(enxf1 \(enxf2 arch.sh" "Extract \fIf1\fR and \fIf2\fR from \fIarch.sh\fR"
  2595. X.EX "uniq \(end inf outf" "Write duplicate lines to \fIoutf\fP"
  2596. X.PP
  2597. X.I Unshar
  2598. Xextracts members of a shell archive, the same as \fIsh\fR, except much faster.
  2599. XIt expects shell archives created with \fIshar.\fR
  2600. XIt also has options to list the contents of a shell archive, and to selectively
  2601. Xextract some members but not all.
  2602. X
  2603. X
  2604. X
  2605. /
  2606. echo x - update
  2607. sed '/^X/s///' > update << '/'
  2608. X.CD "update \(en periodically write the buffer cache to disk"
  2609. X.SX "/etc/update"
  2610. X.FL "\fR(none)"
  2611. X.EY "/etc/update &" "Start a process that flushes the cache"
  2612. X.PP
  2613. XWhen the system is booted,
  2614. X.I update
  2615. Xis started up in the background from 
  2616. X.I /etc/rc
  2617. Xto issue a 
  2618. X.SY SYNC
  2619. Xsystem call every 30 sec.
  2620. X
  2621. X
  2622. X
  2623. /
  2624. echo x - users
  2625. sed '/^X/s///' > users << '/'
  2626. X.CD "users \(en list the logged-in users"
  2627. X.SX "users"
  2628. X.FL "\fR(none)"
  2629. X.EY "users" "list the users"
  2630. X.PP
  2631. X\fIUsers\fR prints one line containing the names of all 
  2632. Xthe currently logged-in users.
  2633. X
  2634. X
  2635. X
  2636. /
  2637. echo x - uud
  2638. sed '/^X/s///' > uud << '/'
  2639. X.CD "uud \(en decode a binary file encoded with uue"
  2640. X.SX "uud\fR [\fB\(enn\fR]\fR [\fB\(ens \fIsrcdir\fR] [\fB\(ent \fIdstdir/\fR] \fIfile"
  2641. X.FL "\(enn" "Do not verify checksums"
  2642. X.FL "\(ens" "Name of directory where \fI.uue\fR file is"
  2643. X.FL "\(ent" "Name of directory where output goes"
  2644. X.EX "uud file.uue " "Re-create the original file"
  2645. X.EX "uud \(en <file.uue" "The \(en means use \fIstdin\fR"
  2646. X.PP
  2647. X\fIUud\fR decodes a file encoded with \fIuue\fR or
  2648. X.UX
  2649. X\fIuuencode\fR.
  2650. XThe decoded file is given the name that the original file had.  
  2651. XThe name information is part of the encoded file.
  2652. XMail headers and other junk before the encoded file are skipped.
  2653. X
  2654. X
  2655. X
  2656. /
  2657. echo x - uue
  2658. sed '/^X/s///' > uue << '/'
  2659. X.CD "uue \(en encode a binary file to ASCII (e.g., for mailing)"
  2660. X.SX "uue\fR [\fB\(en\fIn\fR] \fIfile\fR [\fB\(en\fR]"
  2661. X.FL "\(en\fIn\fR" "How many lines to put in each file"
  2662. X.EX "uue file" "Encode \fIfile\fR to \fIfile.uue\fR"
  2663. X.EX "uue file \(en >x" "Encode \fIfile\fR and write on \fIstdout\fR"
  2664. X.EX "uue \(en800 file" "Output on \fIfile.uaa\fR, \fIfile.uab\fR etc."
  2665. X.PP
  2666. X\fIUuencode\fR is a famous program that converts an arbitrary (usually binary)
  2667. Xfile to an encoding using only 64 ASCII characters.
  2668. X\fIUudecode\fR converts it back to the original file.
  2669. XThe \fIuue\fR and \fIuud\fR programs are the 
  2670. X.MX
  2671. Xversions of these programs, and are compatible with the \s-2UNIX\s0 ones.
  2672. XThe files produced can even be sent successfully over BITNET, which is 
  2673. Xnotorious for mangling files.
  2674. XIt is possible to have \fIuue\fR automatically split the encoded file up
  2675. Xinto small chunks.
  2676. XThe output files then get the suffixes \fI.uaa\fR, \fI.uab\fR, etc., instead
  2677. Xof \fI.uue\fR.
  2678. XWhen \fIuud\fR is given \fIfile.uaa\fR to decode, it automatically includes
  2679. Xthe subsequent pieces.
  2680. XThe encoding takes 3 bytes (24 bits) from the input file and renders it 
  2681. Xas 4 bytes in the output file.
  2682. X
  2683. X
  2684. X
  2685. X.SP 2
  2686. /
  2687. echo x - virecover
  2688. sed '/^X/s///' > virecover << '/'
  2689. X.CD "virecover \(en recover from a crash"
  2690. X.SX "virecover \fR[\fIfile\fR]"
  2691. X.FL "\fR(none)"
  2692. X.EY "virecover prog.c" "Recover \fIprog.c\fR
  2693. X.PP
  2694. X\fIVirecover\fR is used to recover an edit session after a crash.
  2695. XBoth \fIelvis\fR and \fIex\fR keep a scratch files in \fI/usr/tmp\fR.
  2696. XAfter an editor crash, this information is used to reconstruct the file.
  2697. XIf \fIvirecover\fR is called with no file name, it expects one of these
  2698. Xtemporary files on \fIstdin\fR.
  2699. X
  2700. X
  2701. X
  2702. X.SP 2
  2703. /
  2704. echo x - vol
  2705. sed '/^X/s///' > vol << '/'
  2706. X.CD "vol \(en split stdin into diskette-sized volumes"
  2707. X.SX "vol\fR [\fB\(enu\fR] \fIsize block_special"
  2708. X.FL "\(enu" "Unsave from diskettes"
  2709. X.EX "tar c \(en . | vol 360 /dev/fd0" "Prompt for disk every 360K"
  2710. X.EX "vol \(enu 360 /dev/fd0 | tar x \(en " "Restore a saved file system"
  2711. X.PP
  2712. XIt occasionally happens that a program generates an output stream intended
  2713. Xfor diskette but the stream is to large to fit on one diskette.  \fIVol\fP is a
  2714. Xprogram that accepts such a stream, and pauses every \fIn\fR 
  2715. Xblocks to request a new diskette to be inserted.  
  2716. XThis makes it possible to save arbitrarily long
  2717. Xstreams on a series of diskettes, as shown in the examples above.
  2718. X
  2719. X
  2720. X
  2721. /
  2722. echo x - wc
  2723. sed '/^X/s///' > wc << '/'
  2724. X.CD "wc \(en count characters, words, and lines in a file"
  2725. X.SX "wc\fR [\fB\(enclw\fR] \fIfile\fR ..."
  2726. X.FL "\(enc" "Print character count"
  2727. X.FL "\(enl" "Print line count"
  2728. X.FL "\(enw" "Print word count"
  2729. X.EX "wc file1 file2" "Print all three counts for both files"
  2730. X.EX "wc \(enl file" "Print line count only"
  2731. X.PP
  2732. X.I Wc
  2733. Xreads each argument and computes the number of characters, words and lines
  2734. Xit contains.
  2735. XA word is delimited by white space (space, tab, or line feed).
  2736. XIf no flags are present, all three counts are printed.
  2737. X
  2738. X
  2739. X
  2740. X.SP 0.6
  2741. /
  2742. echo x - weidertc
  2743. sed '/^X/s///' > weidertc << '/'
  2744. X.CD "weidertc \(en set date from Weide real time clock [ATARI]"
  2745. X.SX "weidertc [\(end]"
  2746. X.FL "\(end" "Output some debugging information"
  2747. X.EY "weidertc" "Set the date from the Weide real time clock"
  2748. X.PP
  2749. X.I Weidertc
  2750. Xreads the current date and time from a Weide real time clock (if present)
  2751. Xand sets the
  2752. X.MX
  2753. Xtime accordingly.
  2754. XThis program is usually called from
  2755. X.I /etc/rc .
  2756. X
  2757. X
  2758. X
  2759. X.SP 0.6
  2760. /
  2761. echo x - whatis
  2762. sed '/^X/s///' > whatis << '/'
  2763. X.CD "whatis \(en tell what the program does"
  2764. X.SX "whatis \fIname ..."
  2765. X.FL "\fR(none)"
  2766. X.EY "whatis head" "Gives a summary of what the \fIhead\fR program does"
  2767. X.PP
  2768. X\fIWhatis\fR searches the \fI/usr/etc/whatis\fR database for the arguments.
  2769. XFor each name, it prints the corresponding entry.
  2770. X
  2771. X
  2772. X
  2773. /
  2774. echo x - whatsnew
  2775. sed '/^X/s///' > whatsnew << '/'
  2776. X.CD "whatsnew \(en print a newly modified file, marking changes"
  2777. X.SX "whatsnew\fR [\fB\(en\fIn\fR] \fIfile.c file.c.cdif"
  2778. X.FL "\(en\fIn\fR" "Output line length"
  2779. X.EX "whatsnew file.c file.c.cdif~~~~~~" "Print \fIfile.c\fR with changes marked"
  2780. X.EX "whatsnew \(en70 file.c file.c.cdif" "Same as above, but with 70 col line"
  2781. X.PP
  2782. XIt commonly occurs that \fIcdif\fRs are posted to USENET.
  2783. XAfter installing a \fIcdif\fR file, it is sometimes desirable to print out
  2784. Xthe new file, with the changes marked on it.
  2785. X\fIWhatsnew\fR does precisely this, with the changes + and ! printed in the
  2786. Xright-hand margin.
  2787. X
  2788. X
  2789. X
  2790. X.SP 0.6
  2791. /
  2792. echo x - whereis
  2793. sed '/^X/s///' > whereis << '/'
  2794. X.CD "whereis \(en examine system directories for a given file"
  2795. X.SX "whereis \fIfile"
  2796. X.FL "\fR(none)"
  2797. X.EY "whereis stat.h" "Prints: \fI/usr/include/sys/stat.h\fR"
  2798. X.PP
  2799. X\fIWhereis\fR searches a fixed set of system 
  2800. Xdirectories, \fI/bin\fR, \fI/lib\fR, \fI/usr/bin\fR,
  2801. Xand others, and prints all occurrences of the argument name in any of them.
  2802. X
  2803. X
  2804. X
  2805. /
  2806. echo x - which
  2807. sed '/^X/s///' > which << '/'
  2808. X.CD "which \(en examine $PATH to see which file will be executed"
  2809. X.SX "which \fIname"
  2810. X.FL "\fR(none)"
  2811. X.EY "which a.out" "Tells which \fIa.out\fR will be executed"
  2812. X.PP
  2813. XThe $PATH shell variable controls the 
  2814. X.MX
  2815. Xsearch rules. 
  2816. XIf a command \fIa.out\fR is given, the shell first tries to find an 
  2817. Xexecutable file in the working directory.  
  2818. XIf that fails, it looks in various system directories, such as 
  2819. X\fI/bin\fR and \fI/usr/bin\fR.  
  2820. XThe\fR which\fR command makes the same search and gives the absolute
  2821. Xpath of the program that will be chosen, followed by other occurrences
  2822. Xof the file name along the path.
  2823. X
  2824. X
  2825. X
  2826. /
  2827. echo x - who
  2828. sed '/^X/s///' > who << '/'
  2829. X.CD "who \(en print list of currently logged in users"
  2830. X.SX "who\fR [\fIfile\fR]"
  2831. X.FL "\fR(none)"
  2832. X.EY "who   " "Print user names, terminals and times"
  2833. X.PP
  2834. X\fIWho\fR prints a list of currently logged in users.  For each one, 
  2835. Xthe user name, terminal, and login time is printed.  
  2836. XThis program gets its information from the file \fI/etc/utmp\fR, which 
  2837. Xis updated by init and login.  
  2838. XIf the file does not exist, neither of these will create it, and 
  2839. X\fIwho\fR will not work.  Note that if you decide to create an empty  
  2840. X\fI/usr/adm/wtmp\fR to enable the login accounting, it will grow forever and 
  2841. Xeventually fill up your disk unless you manually truncate it from time to time.
  2842. XIf an optional file name is provided, the logins in that file will be printed.
  2843. X
  2844. X
  2845. X
  2846. /
  2847. echo x - whoami
  2848. sed '/^X/s///' > whoami << '/'
  2849. X.CD "whoami \(en print current user name"
  2850. X.SX "whoami"
  2851. X.FL "\fR(none)"
  2852. X.EY "whoami" "Print user name"
  2853. X.PP
  2854. XIn case you forget who you are logged in as, \fIwhoami\fR will tell you.  If
  2855. Xyou use \fIsu\fR to become somebody else, 
  2856. X\fIwhoami\fR will give the current effective user.
  2857. X
  2858. X
  2859. X
  2860. /
  2861. echo x - width
  2862. sed '/^X/s///' > width << '/'
  2863. X.CD "width \(en force all the lines of a file to a given width"
  2864. X.SX "width\fR [\fB\(en\fIn\fR [ \fIinfile\fR [\fIoutfile\fR]\fR
  2865. X.FL "\(en\fIn\fR" "Outline line size"
  2866. X.EX "width \(en60 x y" "Copy \fIx\fR to \fIy\fR, force lines to 60 cols"
  2867. X.EX "width x" "Copy default (80) column lines to \fIstdout\fR"
  2868. X.PP
  2869. XThe input file is copied to the output file.
  2870. XAll lines are forced to a given size (default: 80 columns) by padding with
  2871. Xspaces or truncating.
  2872. XTabs are expanded to spaces.
  2873. X
  2874. X
  2875. X
  2876. /
  2877. echo x - write
  2878. sed '/^X/s///' > write << '/'
  2879. X.CD "write \(en send a message to a logged-in user"
  2880. X.SX "write\fR [\fB\(encv\fR] \fIuser\fR [\fItty\fR]
  2881. X.FL "\(enc" "Use cbreak mode"
  2882. X.FL "\(env" "Verbose mode"
  2883. X.EX "write ast" "Send a message to ast"
  2884. X.EX "write ast tty1" "Send a message to ast on tty1"
  2885. X.PP
  2886. X\fIWrite\fR lets a user send messages to another logged-in user.  
  2887. XLines typed by the user appear on the other user's screen a line at a time 
  2888. X(a character at a time in the case of cbreak mode).  
  2889. XThe file \fI/usr/adm/wtmp\fR is searched to determine which tty to send to. 
  2890. XIf the user is logged onto more than one terminal, the \fItty\fR argument
  2891. Xselects the terminal.  Type CTRL- D to terminate the command.
  2892. XUse ! as a shell escape.
  2893. /
  2894.