home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume18 / mush / part15 < prev    next >
Internet Message Format  |  1991-04-22  |  52KB

  1. From: argv@zipcode.com (Dan Heller)
  2. Newsgroups: comp.sources.misc
  3. Subject: v18i072:  mush - Mail User's Shell, Part15/22
  4. Message-ID: <1991Apr22.000501.19029@sparky.IMD.Sterling.COM>
  5. Date: 22 Apr 91 00:05:01 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: be92c2b4 2d1f6374 0bc333ae fd918d9a
  8.  
  9. Submitted-by: Dan Heller <argv@zipcode.com>
  10. Posting-number: Volume 18, Issue 72
  11. Archive-name: mush/part15
  12. Supersedes: mush: Volume 12, Issue 28-47
  13.  
  14. #!/bin/sh
  15. # do not concatenate these parts, unpack them in order with /bin/sh
  16. # file mush.1 continued
  17. #
  18. if test ! -r _shar_seq_.tmp; then
  19.     echo 'Please unpack part 1 first!'
  20.     exit 1
  21. fi
  22. (read Scheck
  23.  if test "$Scheck" != 15; then
  24.     echo Please unpack part "$Scheck" next!
  25.     exit 1
  26.  else
  27.     exit 0
  28.  fi
  29. ) < _shar_seq_.tmp || exit 1
  30. if test ! -f _shar_wnt_.tmp; then
  31.     echo 'x - still skipping mush.1'
  32. else
  33. echo 'x - continuing file mush.1'
  34. sed 's/^X//' << 'SHAR_EOF' >> 'mush.1' &&
  35. Saves the contents of the letter to \*Qdead.letter\*U
  36. (unless the `!' is specified) and then clears the message buffer; the user
  37. remains in editing mode.
  38. If the variable
  39. .B nosave
  40. is set, then `!' need not be specified.
  41. .TP
  42. ~e [editor]
  43. Enter the editor.
  44. Defaults to variable
  45. .BR editor ,
  46. environment EDITOR, or
  47. .IR vi ,
  48. except in tool mode, where ~e is equivalent to ~v.
  49. .TP
  50. ~F[!]
  51. Add a fortune [don't add] at end of message.
  52. Accessed via the \*QFortune\*U panel item in tool mode.
  53. .TP
  54. ~f [msg-list]
  55. Forward mail.
  56. The included messages are not indented,
  57. but are marked as \*Qforwarded mail\*U.
  58. Accessed via the \*QInclude\*U panel item in tool mode.
  59. .TP
  60. ~h
  61. Modify all message headers.
  62. Each header is displayed one by one and each may be edited.
  63. In tool mode, moves to the To: header; typing a carriage return 
  64. advances the input cursor to each of the other headers in turn.
  65. The mouse cursor changes to a \*Qbent arrow\*U when automatic
  66. input cursor advance is active.
  67. .TP
  68. ~I [msg-list]
  69. Same as ~i, but also include the message headers.
  70. Accessed via the \*QInclude\*U panel item in tool mode.
  71. .TP
  72. ~i [msg-list]
  73. Include the body of the current message (or listed messages).
  74. Accessed via the \*QInclude\*U panel item in tool mode.
  75. See the descriptions of the variables
  76. .BR indent_str ,
  77. .BR pre_indent_str ,
  78. and
  79. .BR post_indent_str .
  80. .TP
  81. ~p [pager]
  82. Page the message body; not available in tool mode.
  83. Defaults to variable
  84. .BR pager ,
  85. environment PAGER, or the default pager set up by the system administrator.
  86. This may be the internal pager.
  87. .TP
  88. ~q
  89. Quit message; save in ~/dead.letter if
  90. .B nosave
  91. is not set.
  92. Not available in tool mode.
  93. .TP
  94. ~r file
  95. Read filename into message buffer.
  96. Accessed via the \*QImport\*U panel item in tool mode.
  97. .TP
  98. ~S[!]
  99. Include [don't include] signature at end of message.
  100. The variables
  101. .B autosign
  102. and
  103. .B autosign2
  104. describe the file or string to append to the message.
  105. See the VARIABLES section for more information on these variables.
  106. Accessed via the \*QAutosign\*U panel item in tool mode.
  107. .TP
  108. ~s [subject]
  109. Modify the subject header.
  110. In tool mode, moves to the Subject: header, adding one if necessary.
  111. In other modes,
  112. if an argument is given (a new subject), then the subject line is
  113. .I replaced
  114. by the new subject line.
  115. If none is given, then the subject line is
  116. displayed for editing just as in the ~t command.
  117. .TP
  118. ~t [list]
  119. Change list of recipients (\*QTo\*U list).
  120. In tool mode, moves the cursor to the To: header.
  121. In other modes,
  122. if a list is given, this list is
  123. .B appended
  124. to the current list.
  125. If no list is given, then the current list
  126. is displayed and the cursor placed at the end of the list.
  127. You can backspace over the stuff in the list or you can append more
  128. addresses onto the end of the list as desired.
  129. .TP
  130. ~u
  131. Up one line; not available in tool mode.
  132. If the user made a mistake typing a letter and he
  133. has already hit carriage return, he may avoid entering the editor
  134. and edit the previous line using ~u.
  135. The line is retyped and
  136. the cursor is placed at the end allowing the user to backspace
  137. over it and retype the line.
  138. System-V users should note that if
  139. the new line is shorter than it was before the ~u command, the
  140. line is padded with blanks to the previous length of the file.
  141. .TP
  142. ~v [editor]
  143. Enter the visual editor; works in tool mode.
  144. Also accessible through the \*QEdit\*U button in tool mode.
  145. Defaults to variable
  146. .BR visual ,
  147. environment VISUAL, or
  148. .IR vi .
  149. .TP
  150. ~w file
  151. Write message buffer to the indicated file.
  152. Accessible in tool mode via the \*QExport\*U panel item.
  153. When the header editing is in use (the variable
  154. .B edit_hdrs
  155. or the \-E option of
  156. .BR mail ),
  157. this tilde-command can be used to create a \fIdraft file\fR.
  158. Draft files are partially completed letters that you wish to save for
  159. editing and eventually sending later.
  160. See the
  161. .B mail
  162. command for a description of rereading and sending drafts.
  163. .TP
  164. ~x
  165. Exit message; don't save in dead.letter.
  166. Accessible in tool mode via the \*QAbort\*U panel item.
  167. .TP
  168. ~$variable
  169. Insert the string value for variable into message; not available in tool mode.
  170. If a boolean variable is listed, nothing is appended regardless of its value.
  171. .TP
  172. ~:command
  173. Run the
  174. .I Mush
  175. command specified by \*Qcommand\*U; not available in tool mode.
  176. You may not run any command that sends mail.
  177. It is inadvisable to change folders at this time
  178. since the current message list may be corrupted, but the action is
  179. allowed nonetheless to provide flexibility for experienced users.
  180. .TP
  181. ~~
  182. A line beginning with two escape characters is unaffected by
  183. .I Mush
  184. except that only a single tilde is inserted into the letter.
  185. .PP
  186. The variable
  187. .B escape
  188. may be set to describe a character other than `~' to be used as the
  189. escape character.
  190. However,
  191. .I "tilde escapes are normally NOT interpreted when"
  192. Mush
  193. .IR "is started with redirected input" .
  194. If tilde-interpretation is desired, use the \-i option when starting
  195. .IR mush .
  196. .PP
  197. .IR "Mail Aliases" .
  198. .PP
  199. Mail aliases are shorthand names for long mail addresses.
  200. These are supported in the same manner as UCB Mail supports them.
  201. Because
  202. .I Mush
  203. has command line history reminiscent of
  204. .IR csh ,
  205. commands that use UUCP's `!' character for user-host and host-host
  206. separation should be escaped (preceded by a backslash).
  207. This is not necessary in the initialization file (.mushrc) because history
  208. referencing is ignored while these files are being sourced.
  209. See the INITIALIZATION and LINE-MODE INTERFACE sections for more
  210. information on initialization file format and the history mechanism.
  211. .PP
  212. Aliases reference normal mailing addresses as well as other aliases.
  213. If a loop is detected, then the user is notified and the message is forced
  214. into the file
  215. .B dead.letter
  216. in the user's home directory.
  217. The
  218. .B unalias
  219. command is used to reverse the effects of the
  220. .B alias
  221. command.
  222. XFrom the tool mode, aliases can be set and unset in an
  223. .IR "aliases subwindow" .
  224. Press the RIGHT mouse button on the \*QOptions\*U item in the main
  225. frame, and select \*QAliases\*U from the menu.
  226. .PP
  227. .IR Help .
  228. .PP
  229. .I Mush
  230. was designed so that each command or action should not be a mystery.
  231. Helping the user understand what to do and how to do whatever he wishes
  232. is the goal behind the help facility.
  233. For this reason, the
  234. .B help
  235. command gives information on both general usage and a few specific help
  236. categories.
  237. .PP
  238. In text mode, most help is obtained by typing \-? as an argument to a
  239. command.
  240. Almost every command has the \-? option.
  241. When this option is specified, most commands attempt to read from
  242. a help file a brief explanation of the functionality of the command.
  243. If necessary, a pointer to other sources of information is
  244. given to fully explain a concept.
  245. .PP
  246. In line mode, typing `?' as a command displays a list of possible commands.
  247. In the curses mode, the `?' key displays help message, which explains
  248. how to obtain a list of the current key-to-command bindings; a keystroke
  249. or set of keystrokes correspond directly to a command.
  250. .PP
  251. In the tool mode, this is
  252. also available, but more extensive help is provided in the pop-up menus.
  253. Press the RIGHT mouse button (the \*Qmenu button\*U) when pointing to any
  254. panel button and a number of items appear in a menu.
  255. The last command in the menu list is often one labeled \*Qhelp\*U.
  256. If a button does not have a menu or has no help item, check the
  257. menu of the \*QHelp\*U button for related topics.
  258. Selecting any help item opens a new scrollable window with help text.
  259. .I "Note:  The limited number of file descriptors in SunOS 3.5 forces"
  260. Mush
  261. .I "to display help information in the"
  262. .IR "message window in the main frame" .
  263. .\" Some nroffs can't handle long .IR arguments
  264. .SH INITIALIZATION
  265. After the command line arguments have been interpreted
  266. .I Mush
  267. reads commands from one or more
  268. .B "initialization files"
  269. that (typically) set variable values, aliases, command line aliases,
  270. and so forth.
  271. Any file specified by the \-I option is read first.
  272. Next, if neither \-I! nor \-n was given, a default system initialization
  273. file is read.
  274. The system default file
  275. is set up by the system administrator and may contain commands that
  276. should be set system-wide.
  277. Finally, if \-n! was not given,
  278. .I Mush
  279. reads the user's personal initialization file.
  280. .PP
  281. The user's file is determined by first looking for the environment variables
  282. .I MUSHRC
  283. or
  284. .IR MAILRC .
  285. If neither of those environment variables is set, then the file
  286. .I .mushrc
  287. is searched for in the home directory of the user.
  288. If that file cannot be found,
  289. .I Mush
  290. attempts to read the file
  291. .I .mailrc
  292. from the same directory.
  293. Finally, if that file cannot be read, no initialization is done
  294. and the default values are in effect.
  295. .PP
  296. If the user has no home directory, or permissions prevent read/write access
  297. to $HOME, /tmp is used as the home directory.
  298. See the
  299. .B home
  300. variable under the VARIABLES section.
  301. .PP
  302. Once in the shell, the
  303. .B source
  304. command may be used to specify a file if you want to read commands
  305. from a file other than the default.
  306. The command
  307. .B saveopts
  308. saves all variable settings, aliases, and all other
  309. .I Mush
  310. settable attributes, to aid in creating an initialization file.
  311. If no filename is given on the command line,
  312. the
  313. .B source
  314. and
  315. .B saveopts
  316. commands choose a file in the manner described above.
  317. .B Saveopts
  318. does not overwrite the file if it exists.
  319. In such cases, you are prompted to confirm overwrite.
  320. If you confirm overwriting the existing file, remember that existing \*Qif\*U
  321. expressions or other manually entered comments or non variable-setting type
  322. commands that previously existed in the file are lost.
  323. .PP
  324. No interactive commands should be called from any initialization file.
  325. These commands are not prevented because it is impossible to trace which
  326. commands are actually
  327. .IR UNIX (TM)
  328. commands that are interactive.
  329. The responsibility of not running interactive commands is left to the user.
  330. Because the initialization file is read
  331. .I before
  332. any messages are read into the program,
  333. message filtering commands should not be placed in this file unless you know
  334. you're going to
  335. .IB re- source
  336. the file later as a command.
  337. .PP
  338. .IR "Initialization File Format" .
  339. When reading the initialization file,
  340. .I Mush
  341. recognizes the `#' character as a comment character.
  342. It may be anywhere on a line in the file.
  343. When that character is encountered,
  344. processing of that line is discontinued to the end of the line.
  345. If the `#' is enclosed in quotes (single or double), then it is not
  346. considered a comment.
  347. Examples:
  348. .sp
  349. .ti +2
  350. set shell = /bin/csh  # set the shell variable
  351. .ti +2
  352. # this entire line has been commented out.
  353. .ti +2
  354. set prompt = "Message #%m: "  # The `#' is within quotes
  355. .PP
  356. The
  357. .B exit
  358. command has special meaning in the initialization file.
  359. If the command is found,
  360. .I Mush
  361. does not exit, but rather, discontinues reading from the file immediately.
  362. .PP
  363. There may be \*Qif\*U expressions within the initialization file to determine
  364. certain runtime states of
  365. .IR Mush .
  366. No parentheses are allowed and only one boolean expression may be
  367. evaluated per line; that is, no \*Q&&\*U or \*Q|\||\*U may be used in
  368. expressions.
  369. An \*Qelse\*U on a line by itself may precede alternative
  370. actions.
  371. \&\*QIf\*U expressions may be nested to any reasonable depth, but
  372. there must always be an \*Qendif\*U matching each \*Qif\*U expression.
  373. The statements associated with an \*Qif\*U expression are never on the
  374. same line with the conditional expression.
  375. .PP
  376. Conditional expressions understood include the internal variables
  377. .IR istool ,
  378. .IR iscurses ,
  379. .IR is_shell ,
  380. .IR hdrs_only ,
  381. .IR is_sending ,
  382. and
  383. .IR redirect .
  384. These are internal variables whose values cannot be referenced using the
  385. \*Q$variable\*U method of variable expansion.
  386. If
  387. .I istool
  388. is true, the program is going to run in the tool mode.
  389. If
  390. .I iscurses
  391. is true, the program is in or is going to run in the curses mode even
  392. though the screen package may not yet have been started.
  393. If
  394. .I is_shell
  395. is true, then
  396. .I Mush
  397. has entered the shell;
  398. .I is_shell
  399. is always false at startup when initialization files are read,
  400. and is always true when files are sourced after initialization with the
  401. .B source
  402. command or the \-F option.
  403. .PP
  404. If
  405. .I hdrs_only
  406. is true, then the -H flag on the command line has been given.
  407. If
  408. .I is_sending
  409. is true, then the user is sending mail to another user.
  410. This does not imply
  411. that the user is not going to be running a shell after the mail is sent.
  412. If
  413. .I redirect
  414. is true, then input to the program is redirected.
  415. The test for redirection tells whether input, not output, has been
  416. redirected to the program.
  417. The
  418. .B \-i
  419. option on the command line is required to run the shell if redirect is on.
  420. If \-i is specified, the value for
  421. .I redirect
  422. is set to false.
  423. Note that any time
  424. .I Mush
  425. runs when not connected to a terminal, it
  426. believes that input has been redirected.
  427. See the MUSH SCRIPTS section for more details.
  428. .PP
  429. The `!' operator may be used to negate expressions, thus,
  430. .sp
  431. .nf
  432. .in +2
  433. if !istool
  434. .ti +4
  435. exit
  436. else
  437. .ti +4
  438. set autoprint
  439. endif
  440. .in -2
  441. .fi
  442. .sp
  443. means that if you are not running as a tool, stop reading commands from this
  444. file.
  445. Otherwise, set the autoprint variable.
  446. .sp
  447. .in +2
  448. .nf
  449. set hdr_format = "%25f %7d (%l/%c) %25s"
  450. if hdrs_only
  451. .ti +4
  452. exit
  453. endif
  454. .in -2
  455. .fi
  456. .sp
  457. This tells the program to set the hdr_format variable and check to see if
  458. we're running the program to read headers only.
  459. If so, stop reading this file (exit) and continue on with the program.
  460. This speeds up runtime quite a bit for those who have lengthy initialization
  461. files, because no other shell variables are necessary.
  462. .sp
  463. .in +2
  464. .nf
  465. if !iscurses
  466. .ti +4
  467. set crt = 24 screen = 18
  468. endif
  469. .in -2
  470. .fi
  471. .sp
  472. This segment checks to see that we're not running in curses mode, and if not
  473. it sets our crt and screen sizes.
  474. This is mostly because the curses mode sets those values for us by looking
  475. at the size of the screen.
  476. See the CURSES INTERFACE section for configuring your
  477. environment so you enter curses mode each time you run the shell.
  478. .PP
  479. String evaluation is allowed in \*Qif\*U expressions, and the operators
  480. \*Q==\*U and \*Q!=\*U may be used to determine equality or inequality,
  481. and \*Q=~\*U and \*Q!~\*U may be used for pattern-matching.
  482. Usually, variables are compared with constants for evaluation.
  483. .PP
  484. Note that it is not possible to compare variables to an empty string, and
  485. variables that evaluate to an empty string may cause errors.
  486. It is possible to test whether a variable is set by using the syntax
  487. \*Q$?variable\*U (as in
  488. .IR csh )
  489. but there is not currently any way to test for an empty string value.
  490. .sp
  491. .in +2
  492. .nf
  493. if $TERM == adm3a
  494. .ti +4
  495. set pager = more
  496. else
  497. .ti +4
  498. set pager = less
  499. endif
  500. .in -2
  501. .fi
  502. .sp
  503. This segment tests to see if the user's terminal type is \*Qadm3a\*U.
  504. If it is, then it sets the pager variable to be the 
  505. .I more
  506. program.
  507. Note that the variable TERM is obtained from the user's environment if a
  508. shell variable is not set already.
  509. Otherwise, the pager variable is set to \*Qless\*U.
  510. This exemplifies the fact that
  511. .I less
  512. frequently fails to function correctly
  513. for the terminal type \*Qadm3a\*U so we don't use it.
  514. .sp
  515. Also supported in \*Qif\*U expressions are the test flags \*Q-e\*U
  516. and \*Q-z\*U.  These flags test to see if a file exists (\*Q-e\*U) or
  517. if it is zero-length (\*Q-z\*U).
  518. These are most useful in command files that are to be read after the
  519. shell has started; see the examples in the MUSH SCRIPTS section.
  520. .PP
  521. After sourcing the initialization file,
  522. .I Mush
  523. reads all the mail out of the specified folder (the system spool directory
  524. if no folder is given) and creates a list of messages.
  525. The current maximum number of messages the user
  526. can load is set to 1000 by default.
  527. The system administrator who configures the program can reset this
  528. value higher or lower if you ask nicely.
  529. If the user has the
  530. .B sort
  531. variable set, then when the current folder's messages have all been read,
  532. the messages are sorted according to the value of the
  533. variable (see the
  534. .B sort
  535. entry under the VARIABLES heading for more information).
  536. Each message has a number of message header lines that contain information
  537. about whom the mail is from, the subject of the message, the date it was
  538. received, and other information about the letter.
  539. This information is then compiled into a one-line summary for
  540. each message and is printed out in an appropriate manner
  541. depending on the interface you're using.
  542. .PP
  543. At this point, commands may be input by the user.
  544. Lengthy or complex commands can be placed in a file and then executed via the
  545. .B source
  546. command.
  547. Such files use the same format as the initialization files and may use all
  548. the same tests in \*Qif\*U expressions.
  549. Sourcing of a file of filter commands such as those in the example above
  550. can be automated by using the \-F option when \fIMush\fR is started.
  551. Also see the MUSH SCRIPTS section for other uses.
  552. .SH "LINE-MODE INTERFACE"
  553. In the line-mode, the user is given a prompt to which commands are issued
  554. and arguments are passed to commands.
  555. When the user types at the prompt, each line is parsed and words (or
  556. arguments) are separated into an array of strings.
  557. This array, also called an
  558. .IR "argument vector" ,
  559. is then modified by expanding history references, command line aliases,
  560. and variable references.
  561. A command line ends when the end of the line is encountered or a pipe (|)
  562. or semicolon (;) character is encountered, separating discrete commands.
  563. .PP
  564. When a command line has been parsed and placed in an argument vector, the
  565. first argument in the vector (the \*Qcommand\*U) is searched for in a list
  566. of legal
  567. .I Mush
  568. commands.
  569. If found, the function associated with that command is called and
  570. the rest of the line is passed to that function as
  571. .IR "command line arguments" .
  572. .PP
  573. Before commands are called, however, the input the user gives is preprocessed
  574. in a style reminiscent of the C-shell
  575. .RI ( csh ).
  576. .I Mush
  577. also supports a subset from each of the following aspects of
  578. .IR csh :
  579. .in +2
  580. \(bu Command history.
  581. .br
  582. \(bu Command line aliasing.
  583. .br
  584. \(bu \*QPiping\*U mechanism to
  585. redirect \*Qinput\*U and \*Qoutput\*U of commands.
  586. .br
  587. \(bu Filename metacharacters.
  588. .in -2
  589. .PP
  590. .BR "Command history" .
  591. .PP
  592. .I Mush
  593. supports a history mechanism similar to that supplied by
  594. .IR csh .
  595. A subset of
  596. .I csh
  597. history modifiers are supported to reference previously
  598. issued commands and to extract specified arguments from these commands.
  599. .PP
  600. The history mechanism remembers a list of past commands whose length is
  601. bounded by the value of the
  602. .B history
  603. variable.
  604. If this variable is not set, only the most recent command is remembered.
  605. To reference previously typed commands, the `!' character
  606. is used in the same manner as in
  607. .IR csh .
  608. There is a limited implementation of history modification;
  609. supported are the argument selectors that reference
  610. command line arguments and \*Q:p\*U (echo, but don't execute the command).
  611. .sp
  612. Examples:
  613. .nf
  614. .in +2
  615. .ta 1i
  616. !-2:$    two commands ago, last argument.
  617. !3:2-4    the third command, arguments two through four.
  618. !!:p    print the last command in its entirety.
  619. .in -2
  620. .fi
  621. .PP
  622. During the sourcing of initialization files (.mushrc), history is not
  623. in effect and therefore the `!' character does not cause history expansion.
  624. This includes startup of the program and when the command
  625. .I source
  626. is issued.
  627. UUCP style addresses that contain the `!' character may be given in the
  628. initialization file without the need to be preceded by a backslash.
  629. However, `!' does need to be escaped if
  630. .BR cmd 's
  631. are used to reference command line arguments.
  632. .PP
  633. .BR "Command line aliasing" .
  634. .PP
  635. Command aliases are different from mail aliases in that they are used
  636. to expand to commands.
  637. This feature enables command substitution similar to
  638. .IR csh .
  639. To be backwards compatible with UCB Mail, the
  640. .B alias
  641. command is used for address aliasing.
  642. Thus, the command
  643. .B cmd
  644. is introduced in place of
  645. .BR alias .
  646. .PP
  647. Examples:
  648. .nf
  649. .in +2
  650. cmd d delete
  651. cmd t type
  652. cmd dt 'd ; t'
  653. cmd - previous
  654. cmd r 'reply \\!* -e -i'
  655. .in -2
  656. .fi
  657. .sp
  658. In the last example, if the user types \*Qr 5\*U,
  659. .I Mush
  660. replies to sender of the fifth message and pass all the other
  661. arguments along to the
  662. .B reply
  663. command.
  664. Note the escaping of the `!' character.
  665. This must also be done if set in the initialization file (.mushrc).
  666. Had the user not specified a message number on the `r' command line,
  667. .B reply
  668. would respond to the \*Qcurrent message\*U rather than the fifth message.
  669. .PP
  670. .BR "Piping commands" .
  671. .PP
  672. .I Mush
  673. commands can be \*Qpiped\*U to one another so as to provide output of
  674. one command to be used as input to the next command in the pipeline.
  675. However, the output of commands is not the \*Qtext\*U that is returned
  676. (as it is in
  677. .I sh
  678. and
  679. .IR csh ),
  680. but instead is a
  681. .B "message list"
  682. of the messages that were affected.  A
  683. .B "message list"
  684. is defined as the set of messages that the user specifies in a command or
  685. the messages a command affects after it is through executing.
  686. When one command is piped to another, the effect is that the second command
  687. considers only those messages affected by the first command.
  688. In most cases,
  689. .I Mush
  690. is smart enough to know when piping is occurring and may suppress text output
  691. that a command might produce.
  692. .PP
  693. Examples:
  694. .sp
  695. .ti +2
  696. pick -f fred | save fred_mail
  697. .sp
  698. This finds all the messages from \*Qfred\*U
  699. and saves them all in the file named fred_mail.
  700. .sp
  701. .ti +2
  702. lpr 4-8 | delete
  703. .sp
  704. This sends messages 4, 5, 6, 7, and 8 to the printer and then deletes them.
  705. .sp
  706. .ti +2
  707. headers :o | delete
  708. .sp
  709. Deletes all old (already read) mail.
  710. .PP
  711. Because action is taken on mail messages, not files,
  712. metacharacters such as `*' and `?' are not expanded to file names as
  713. .I csh
  714. does.
  715. Instead,
  716. .I Mush
  717. commands take
  718. .I "message lists"
  719. as arguments (a list references one or messages) to take action upon.
  720. When referencing message numbers,
  721. .I Mush
  722. understands the following special syntax:
  723. .sp
  724. .in +2
  725. .nf
  726. .ta 1.0i
  727. *    All messages
  728. ^    The first message
  729. $    The last message
  730. \&.    The current message
  731. N\-M    A range of messages between N and M, inclusive
  732. .sp
  733. .fi
  734. .in -2
  735. In the last case, N and M may be * ^ $ . or digits referencing
  736. explicit message numbers.
  737. The range must be in ascending order.
  738. .sp
  739. You can also negate messages by placing the message list inside
  740. braces, `{' `}' \*- thus, the expression \*Q2-19 {11-14}\*U references
  741. messages 2 through 19 except for messages 11 through 14.
  742. .sp
  743. Note that message lists are parsed left to right.
  744. Negated messages may be reset by turning them on
  745. again later in the argument list.
  746. A common error new users make is to specify a negated list without
  747. specifying any beginning messages.
  748. .sp
  749. .ti +2
  750. delete { 6 }
  751. .sp
  752. In this example, the user attempted to delete all messages
  753. except for number 6.
  754. He should have specified `*' beforehand.
  755. A correct example:
  756. .sp
  757. .ti +2
  758. preserve ^-. { 3 }
  759. .sp
  760. Here, the user specifies a valid message list and causes
  761. .I Mush
  762. to preserve all messages from the beginning of the list (message 1)
  763. to the current message, excluding message 3.
  764. .PP
  765. As discussed, after the command line is parsed, the command given is
  766. called and the rest of the arguments on the command line are passed to it.
  767. If no
  768. .I Mush
  769. command has been found that matches the one given, then the variable
  770. .B unix
  771. is checked.
  772. If it is set,
  773. .I Mush
  774. attempts to run the command line as a
  775. .IR UNIX (TM)
  776. command.
  777. .PP
  778. If
  779. .B unix
  780. is not set, or if the command could not be found in the user's PATH
  781. environment, a message is printed indicating that the command was
  782. not found.
  783. .PP
  784. Since no \*Qmessages\*U are affected by \fIUNIX\fR
  785. commands, those that appear within \fIMush\fR
  786. pipelines are executed by the \fBpipe\fR command.
  787. A \fIUNIX\fR command may never be the first command in a pipeline
  788. unless the \fBpipe\fR command is used explicitly.
  789. If the user wishes to execute \fIUNIX\fR
  790. commands that are to be piped to one another (or use any sort of redirection),
  791. the command \fBsh\fR is provided for such purposes.
  792. Since \fIMush\fR parses the entire command line, caution should be
  793. taken to enclose questionable shell variables or metacharacters with
  794. quotes to prevent \fIMush\fR from expanding them.
  795. See the COMMANDS heading below for more detail.
  796. .PP
  797. This shell-like quality is for the convenience of the user and is not
  798. intended to replace the functionality of
  799. .IR sh ,
  800. .IR csh ,
  801. or any other command interpreter.
  802. .PP
  803. .BR "Filename metacharacters" .
  804. .PP
  805. .IR Mush "'s"
  806. command interpreter does not normally pre-expand metacharacters in the
  807. manner of other shells, because the metacharacters may refer to either
  808. messages or files.
  809. Instead, those commands that deal with file names do any necessary
  810. metacharacter expansion.
  811. Two metacharacters are nearly always recognized:  `~' refers to the user's
  812. home directory, and `+' refers to the user's folder directory (\*Q~/Mail\*U
  813. or the value of the variable
  814. .BR folder ).
  815. Another user's home directory can also be referenced as \*Q~username\*U,
  816. and for this reason files in the user's home directory must be referenced
  817. as \*Q~/filename\*U.
  818. However, the `/' character is optional when referring to folders;
  819. that is, \*Q+filename\*U and \*Q+/filename\*U both refer
  820. to the same file in the folder directory.
  821. .PP
  822. If filename completion is enabled by setting the variable
  823. .BR complete ,
  824. the command interpreter expands
  825. .IR csh -style
  826. metacharacters when completing filenames.
  827. A completion containing metacharacters expands to all the files matching
  828. the pattern when the completion key is pressed (defaults to ESC, `^[').
  829. See the description of
  830. .B complete
  831. for limitations of this facility.
  832. .SH "CURSES INTERFACE"
  833. The curses interface utilizes the curses routines intrinsic to most
  834. .I UNIX
  835. systems.
  836. This interface is screen oriented rather
  837. than line oriented and allows the user to access commands and messages
  838. more quickly at the cost of history, piping, and a few commands.
  839. .PP
  840. Many users who prefer the curses interface might want to always start
  841. all their mail sessions in the curses interface.
  842. Putting the
  843. .B curses
  844. command in your initialization file is allowed, but you can also create
  845. an alias or function in your login shell to always use the -C option.
  846. .I Mush
  847. attempts to know not to run a shell if you're just sending mail to
  848. someone, so the
  849. .I csh
  850. command sequences:
  851. .sp
  852. .ti +2
  853. % alias mail 'mush -C'
  854. .ti +2
  855. % mail fred
  856. .sp
  857. sends mail to fred but does not enter the shell.
  858. However, if you just said \*Qmail\*U
  859. with no arguments, you enter the shell in curses mode if you have mail.
  860. If you have no mail, you are told so, and the shell does not start.
  861. If you want to enter curses mode even if
  862. you don't have mail, use the \-S option on the command line.
  863. .PP
  864. In curses mode, the user's terminal has its \*Qecho\*U turned off so commands
  865. that are issued are not echoed on the screen.
  866. Certain commands cause the mode
  867. to return to normal for typing purposes (sending mail, for example).
  868. In normal operation, the screen displays the current set of message
  869. headers, the current message number is in the top left corner, the
  870. mail status on the top line, and the cursor is placed on the current
  871. message.
  872. The number of message headers displayed is set by the variable
  873. .BR screen .
  874. If the user does not have that variable set, the baud rate is checked and
  875. the size of the screen is set according to optimal refresh time.
  876. Usually, 300 baud gives 7 lines, 1200 gives 14, 2400 gives 22 lines, and all
  877. higher baud rates give the size of the screen, whatever that may be.
  878. Note that the top line is reserved for \*Qstatus\*U and the bottom line is
  879. for user interaction should it be required.
  880. .PP
  881. The user may now type commands via key sequences that are not echoed
  882. to the screen.
  883. Thus, function keys may be bound to \*Qcommands\*U by using the 
  884. .B bind
  885. command.
  886. A list of key-to-command bindings can be found at runtime by typing `?'
  887. in curses mode or by using the
  888. .B bind
  889. command in line mode.
  890. .PP
  891. The commands to which you can map sequences are intended to be as self
  892. explanatory as possible, but admittedly, it might be easier to figure out
  893. via trial and error than to try to wade through this documentation.
  894. A list of the legal curses commands can be obtained when executing the
  895. bind command.
  896. Regular tty line-mode commands are not issued from
  897. the curses interface; only special curses mode commands are understood.
  898. The current list of valid curses commands is:
  899. .sp
  900. .ta 2i 4i
  901. .in +4
  902. .nf
  903. alias    last-msg    saveopts    
  904. back-msg    line-mode    screen-back    
  905. bind    lpr    screen-next    
  906. bind-macro    mail    search-again    
  907. bottom-page    mail-flags    search-back    
  908. chdir    map    search-next    
  909. copy    map!    shell-escape    
  910. copy-list    mark    sort    
  911. delete    my-hdrs    sort-reverse    
  912. delete-list    next-msg    source    
  913. display    preserve    top    
  914. display-next    quit    top-page    
  915. exit    quit!    unbind    
  916. exit!    redraw    undelete    
  917. first-msg    reply    undelete-list    
  918. folder    reply-all    update    
  919. goto-msg    reverse-video    variable    
  920. help    save    write    
  921. ignore    save-list    write-list    
  922. .fi
  923. .in -4
  924. .sp
  925. .PP
  926. The following is a list of default key-command bindings.
  927. If you specify bind commands in your initialization file that conflict with
  928. these defaults, your settings override the defaults.
  929. The default settings given in this manual
  930. use the ^-character method to indicate control characters
  931. (mostly because nroff makes printing the backslash
  932. character so amazingly difficult).
  933. Thus, `^X' means control-X even
  934. though you have to type \*Q\\CX\*U to set
  935. the binding and actually use the control key and the `X' key simultaneously
  936. to really
  937. .I do
  938. a Control-X.
  939. .TP
  940. \&., t, p, T=top, n=next
  941. Display (type/print) message.
  942. Top displays the first
  943. .B crt
  944. lines of a message.
  945. Next prints the next message.
  946. If the current message is deleted, the next undeleted message is found.
  947. You might notice this is different from the line mode, which returns
  948. an error message that the current message is marked as deleted.
  949. .TP
  950. +, j, J, RETURN
  951. Go to next message.
  952. .TP
  953. -, k, K, ^K
  954. Go to previous message.
  955. .TP
  956. ^, $
  957. Go to first/last message.
  958. .TP
  959. {, }
  960. Go to top/bottom of screen.
  961. .TP
  962. a
  963. Set aliases.
  964. .TP
  965. b, B
  966. Set/unset bindings.
  967. .TP
  968. d, D, u, U
  969. Delete/undelete messages (capitals prompt for message list).
  970. .TP
  971. f
  972. Change folder.
  973. If current folder has changed, verification for update is requested.
  974. .TP
  975. g, 0-9
  976. Go directly to a specified message.
  977. When the \*Qgoto\*U command
  978. is selected, a prompt at the bottom of the window prompts for a
  979. .BR "message list" .
  980. Anything that describes a message list may be used.
  981. Since
  982. .I Mush
  983. commands return message lists, a legal
  984. .I Mush
  985. command enclosed in backquotes may be used to go to a particular message.
  986. The new current message pointer points to the next
  987. message, returned by the command, that is below the old current message.
  988. An example:
  989. .sp
  990. .ti +2
  991. goto msg: `pick \-f argv`
  992. .sp
  993. This causes the current message to move to the first message
  994. in the current folder from the user \*Qargv\*U that comes after the
  995. message pointed to when the \*Qgoto\*U was issued.
  996. So, if messages 1 and 5
  997. are from the user \*Qargv\*U and the current message the user was on
  998. was message 3, then the new current message is message 5, since it
  999. is the first message found after message 3 that is from \*Qargv\*U.
  1000. If none of the messages are found after the current message, the new
  1001. current message is the first one returned by the command.
  1002. .TP
  1003. h
  1004. Set personal headers.
  1005. .TP
  1006. i
  1007. Set ignored headers.
  1008. .TP
  1009. m, M
  1010. Send mail (capital prompts for mail flags).
  1011. .TP
  1012. o, O
  1013. Order messages (sort; capital reverses order).
  1014. A prompt requests the sort constraints.
  1015. .TP
  1016. q, Q, x, X
  1017. Quit/exit.
  1018. \&`q' tests to see if the current folder has been updated and prompt
  1019. the user to verify updating.
  1020. \&`x' does not update mail, but quits the program.
  1021. \&`Q' does not prompt for update verification; if changes were
  1022. made, updating is automatic.
  1023. \&`Q' (quit!) and `X' (exit!) works even when typed at the
  1024. \*Q...continue...\*U prompt, whereas `q' and `x' do not.
  1025. .TP
  1026. r, R
  1027. Reply/reply all.
  1028. .TP
  1029. s, S, c, C, w, W
  1030. Save, copy, or write messages (capitals prompt for message lists).
  1031. .TP
  1032. v
  1033. Set regular variables (as opposed to environment variables).
  1034. .TP
  1035. V
  1036. Print version number.
  1037. .TP
  1038. z, Z
  1039. Print next/previous screenful of message headers.
  1040. .TP
  1041. ^L
  1042. Redraw the screen.
  1043. .TP
  1044. ^P
  1045. Preserve current message (toggle).
  1046. .TP
  1047. ^U
  1048. Update folder.
  1049. A prompt requests confirmation.
  1050. .TP
  1051. ^R
  1052. Toggle reverse video mode (current message is in reverse video).
  1053. .TP
  1054. *
  1055. Toggle mark for this message (see the \*Qmark\*U command).
  1056. .TP
  1057. |
  1058. Send message to printer
  1059. .TP
  1060. !
  1061. Shell Escape.
  1062. Prompts for command; RETURN invokes a shell.
  1063. .TP
  1064. %
  1065. Change directory.
  1066. .TP
  1067. (, )
  1068. Source/saveopts.
  1069. Prompts for file name.
  1070. .TP
  1071. /, ^/, ^N
  1072. Forward, backward, continue search for patterns.
  1073. Entire messages are not searched for here.
  1074. Only the text available on the screen is searched for.
  1075. Note that some terminals use `^_' (control-underscore) for `^/',
  1076. so you may wish to re-bind this key.
  1077. .TP
  1078. &&
  1079. Create a curses mode macro.
  1080. .TP
  1081. &:
  1082. Create a line mode macro.
  1083. .TP
  1084. &!
  1085. Create a composition mode macro.
  1086. .TP
  1087. :[cmd]
  1088. Enter line mode for one command.
  1089. History is not recorded for this escape,
  1090. and line mode macros are not available.
  1091. If no command is given, curses mode
  1092. is exited and the session continues in line mode
  1093. (in which case history and macros become available).
  1094. .PP
  1095. When setting new key sequences to be bound to commands, the user may
  1096. use control keys and the ESCAPE character for extended commands.
  1097. Exceptions are control-C, control-\\, and possibly other control characters
  1098. depending on your system's configuration or your current tty mode settings.
  1099. .PP
  1100. When assigning key sequences to commands, the user enters the
  1101. .B bind
  1102. command and prompting is done.
  1103. If the
  1104. user wishes to have control characters or the escape character in a key
  1105. sequence while still using ASCII format, a special notation for control
  1106. characters is provided.
  1107. This sequence is used primarily for the use of
  1108. binding control character sequences in the initialization file.
  1109. This format
  1110. is also used to display the current key-command mappings by the program.
  1111. .PP
  1112. To specify control characters in ASCII format for the bind command, the
  1113. sequence \*Q\\Cc\*U is used where `c' is the
  1114. character that the control key translates to and must be in upper case.
  1115. The sequence \*Q\\CP\*U maps to control-P.
  1116. If the user wishes to indicate the RETURN key, this is specified
  1117. with the string \*Q\\n\*U and
  1118. the tab key is specified by the string \*Q\\t\*U.
  1119. As a more complex example, on a Wyse-50 terminal, the 8th function key
  1120. outputs the three characters: control-A, H, line-feed.
  1121. To map this function key to a command, the
  1122. user must enter the sequence \*Q\\CAH\\n\*U as the key sequence,
  1123. then follow up with a valid curses command.  From then on, if the user
  1124. presses that function key,
  1125. the command mapped to it is executed.
  1126. .PP
  1127. The ESCAPE key is signified by the sequence, \*Q\\E\*U.
  1128. On a Sun-3 workstation,
  1129. the R1 key outputs the character sequence: ESC, [, 2, 0, 8, z.
  1130. The corresponding
  1131. .B bind
  1132. key sequence is \*Q\\E[208z\*U.
  1133. Restrictions are that key sequences may not contain the space character
  1134. unless bound in line mode, and can never begin with a digit.
  1135. .PP
  1136. Whenever a command is entered, other than `^L'
  1137. .RB ( redraw ),
  1138. which causes the screen to scroll or be refreshed in any way,
  1139. .I Mush
  1140. is left in the
  1141. .I continue
  1142. mode.
  1143. When in this mode, the user is given his line-mode prompt followed
  1144. by \*Q...continue...\*U indicating that he may issue a new command or
  1145. return to the top level where the current message headers are displayed
  1146. on the screen.
  1147. Remember that this is still the curses mode, but much time
  1148. is saved by avoiding redrawing the screen after each command.
  1149. The user may move up and down messages using the appropriate commands
  1150. (j/k by default) or anything else the curses mode allows.
  1151. Only the exit and quit commands return to the top level.
  1152. Because of this, there are 2 additional
  1153. ways to \*Qquit\*U from curses mode and return to the login shell.
  1154. The \*Qexit\*U and \*Qquit\*U commands quit from the top level, but
  1155. the commands
  1156. .B exit!
  1157. and 
  1158. .B quit!
  1159. are used to exit from the \*Qcontinue\*U level in the curses interface as well
  1160. as from the top level.
  1161. .PP
  1162. Note that the best way to understand the curses interface is to just use it.
  1163. In line mode, the command \*Qcurses\*U puts you into curses mode.
  1164. .SH "GRAPHICS TOOL INTERFACE"
  1165. When running the window-based tool interface, there are be five
  1166. subwindows:
  1167. a panel for folder-related commands and general options,
  1168. a scrollable display of message header summaries,
  1169. another panel of message manipulation commands,
  1170. a four-line scrollable window for warnings and output from certain commands,
  1171. and a larger window which is used for displaying messages.
  1172. The message display and command output windows can be scrolled with
  1173. the up and down cursor keys (function keys R8 and R14 by default),
  1174. and also recognize \*Qvi\*U movements (j, k, ^U, ^D, etc.),
  1175. in addition to having scrollbars.
  1176. .PP
  1177. In the header summary window, pressing the LEFT mouse button while pointing
  1178. at a message header displays that message in the large message window at the
  1179. bottom of the frame.
  1180. Pressing the middle button deletes the message, and pressing the RIGHT mouse
  1181. button displays a menu of actions that affect the message.
  1182. Possible actions are to display the message, delete or undelete it, reply to
  1183. it, save it, preserve it
  1184. (see the
  1185. .B preserve
  1186. command), or print it (hardcopy).
  1187. .PP
  1188. All panel items in the frame have labels describing their functionality.
  1189. Selecting
  1190. a panel item with the LEFT mouse button causes the action to be executed.
  1191. The RIGHT mouse button displays a menu of options that the command may
  1192. branch to.
  1193. For example, the
  1194. .B Save
  1195. panel item by default saves messages to the file \*Qmbox\*U, but the
  1196. RIGHT mouse button causes a menu to be displayed, and the choices of
  1197. where to save the message increase to include the items in the menu.
  1198. These typically include the files in the user's folder directory (see the
  1199. .B folder
  1200. variable below).
  1201. .PP
  1202. At the end of most lists of menu entries for panel items is an item
  1203. labeled \*Qhelp\*U.
  1204. When this item is chosen, an new window is opened where help for that
  1205. command is displayed.
  1206. The help windows can be scrolled in the same ways as the message
  1207. display window.
  1208. .I "Note:  The limited number of file descriptors in SunOS 3.5 forces"
  1209. Mush
  1210. .I "to display help information in the"
  1211. .IR "message window in the main frame" .
  1212. .\" Some nroffs can't handle long .IR arguments
  1213. .PP
  1214. When composing letters,
  1215. a separate frame is created which includes a panel of command items,
  1216. a four-line scrollable window,
  1217. and a large window for editing the letter.
  1218. Panel items for including messages, editing (via your usual text editor),
  1219. sending, aborting the message, and various other manipulations are supplied.
  1220. See the section on \*QSending mail\*U, under the summary of tilde escapes,
  1221. for more details of composition frame command items.
  1222. As long as the composition frame is open, all
  1223. .I Mush
  1224. command output is
  1225. redirected from the small window in the main frame to the small window here.
  1226. \fINote:  This subwindow is not present in SunOS 3.5 due
  1227. to the limited number of file descriptors; command output stays in the
  1228. main frame in that case\fR.
  1229. The SunView
  1230. .I textsw
  1231. interface is used by default in the large window for paging and editing.
  1232. Cursor movement with the function keys (R8, R10, R12, and R14 by default)
  1233. is supported.
  1234. .SH COMMANDS
  1235. Described below are legal commands understood by
  1236. .I Mush
  1237. that you can type at the line mode prompt.
  1238. Most commands have abbreviations
  1239. (given in parentheses) and can be followed by message lists.
  1240. In most cases,
  1241. whitespace is not necessary to separate commands from message lists.
  1242. For example, \*Qd*\*U deletes all messages, and \*Qu1-7 {4}\*U undeletes
  1243. messages 1 through 7 except for message number 4.
  1244. .B NOTE:
  1245. \fIThis \*Qtoken splitting\*U may have unexpected side effects, especially
  1246. for \fRUNIX\fI commands whose names contain digits.\fR
  1247. .PP
  1248. The ability to customize commands using the
  1249. .B cmd
  1250. facility allows users to customize
  1251. .I Mush
  1252. to resemble other mailers.
  1253. However, efforts have already been made to include commands that are backwards
  1254. compatible with other line-mode mailers.
  1255. Users of the graphics tool mode of
  1256. .I Mush
  1257. may have little need for the command line mode because the icon based
  1258. interface allows interaction with many commands.
  1259. The tool mode is much more restrictive in favor of a simpler, user
  1260. friendly interface, but most useful commands may be achieved anyway.
  1261. .PP
  1262. The following is a list of all recognized commands.
  1263. Since most commands accept a
  1264. .I "message list"
  1265. as an argument, arguments are noted only when they differ from a message list.
  1266. .TP
  1267. .B about
  1268. Gives information about the authors of this wonderful software.
  1269. .TP
  1270. .BR alias " [name] [address-list]"
  1271. .ns
  1272. .TP
  1273. .BR unalias " name"
  1274. The
  1275. .B alias
  1276. command defines a name to stand for a list of addresses.
  1277. The defined name can then be substituted for the entire list when
  1278. sending mail.
  1279. For example,
  1280. .sp
  1281. .nf
  1282. .ti +2
  1283. alias dan dheller@cory.berkeley.edu argv@zipcode.com
  1284. .fi
  1285. .sp
  1286. This defines the name \*Qdan\*U to be shorthand for two addresses,
  1287. both of which happen to be Dan Heller.
  1288. .sp
  1289. The command
  1290. .B unalias
  1291. can be used to remove an alias definition.
  1292. .sp
  1293. With no arguments,
  1294. .B alias
  1295. prints out all the current aliases.
  1296. With one argument, it prints the list associated with that name,
  1297. and with more than one argument, it creates a new alias.
  1298. .\" Note: .TP may use @ as delimiter for some computations.
  1299. .\" Can't have "user@host" in the line, so use "address".  Bleah.
  1300. .TP
  1301. .BR alternates " [host-list] [*[user]] [address] [!path!user]"
  1302. .RB ( alts )
  1303. This command
  1304. is useful if you have accounts on several machines.
  1305. It can be used to inform
  1306. .I Mush
  1307. that your login name at each of the listed hosts is really you.
  1308. When you
  1309. .B reply
  1310. to messages,
  1311. .I Mush
  1312. does not send a copy of the message to your login name at any of the
  1313. hosts listed on the
  1314. .B alternates
  1315. list.  If the special symbol \*Q*\*U is used, then your login name is
  1316. matched against all pathnames and local addresses.
  1317. A user name may be appended to the \*Q*\*U, in which case that name is
  1318. matched instead of your login name.
  1319. .sp
  1320. If you have another login name on the local or remote machine, then
  1321. that login may be specified either as \*Quser@machine\*U or
  1322. by preceding the login name or a UUCP path to the login name by a `!'
  1323. character.
  1324. .sp
  1325. For example,
  1326. .sp
  1327. .nf
  1328. .ti +2
  1329. alts zipcode maui1 dheller@cory.berkeley.edu !root
  1330. .fi
  1331. .sp
  1332. are all either hostnames or pathnames to accounts owned by the same user.
  1333. The last item, \*Q!root\*U matches mail to \*Qroot\*U only if it is
  1334. destined for the local machine, e.g. a workstation.
  1335. Root accounts elsewhere are not considered to be equivalent.
  1336. The address \*Qdheller@cory.berkeley.edu\*U indicates that at the machine
  1337. \*Qcory.berkeley.edu\*U the user \*Qdheller\*U is the same person as the
  1338. current user at the local machine.
  1339. This could also have been specified in UUCP format:
  1340. .sp
  1341. .nf
  1342. .ti +2
  1343. alts !cory.berkeley.edu!dheller
  1344. .fi
  1345. .sp
  1346. The leading `!' character is required to differentiate paths ending in a
  1347. login name from those to which the user's login name should be appended.
  1348. .sp
  1349. If the
  1350. .B alternates
  1351. command is given with no arguments, the current set of alternate
  1352. names is displayed.
  1353. Names entered in \*Quser@machine\*U form are displayed in UUCP format.
  1354. Note that
  1355. .B alternates
  1356. is not cumulative; any arguments given to the
  1357. .B alternates
  1358. command removes the current list and replace it.
  1359. .TP
  1360. .BR await " [\-T timeout]"
  1361. Directs the shell to wait for the arrival of new mail.
  1362. New mail is checked approximately every 30 seconds, or every
  1363. .I timeout
  1364. seconds as specified by the \-T option.
  1365. This command does not return until new mail arrives
  1366. or until a keyboard interrupt (^C) is typed.
  1367. Unless the string \*Qawait\*U appears in the value of the variable
  1368. .BR quiet ,
  1369. the terminal bell rings when
  1370. .B await
  1371. reads in a new message (see the VARIABLES section for details).
  1372. .TP
  1373. .BR bind " [string [command [parameters]]]"
  1374. .ns
  1375. .TP
  1376. .BR unbind " string"
  1377. .rs
  1378. Bind the sequence of keystrokes specified by
  1379. .I string
  1380. to the curses-mode function,
  1381. .IR command .
  1382. The
  1383. .I string
  1384. is usually one or two characters, or a sequence sent by
  1385. one of the \*Qfunction keys\*U of a particular terminal.
  1386. See the CURSES INTERFACE section for a complete list of curses-mode
  1387. functions; this interface is not available on all systems.
  1388. The
  1389. .I parameters
  1390. are currently recognized only for the special
  1391. .B macro
  1392. function; see the
  1393. .B bind-macro
  1394. command for details.
  1395. .sp
  1396. If no arguments are given to
  1397. .BR bind ,
  1398. the current set of curses bindings are listed;
  1399. if only a
  1400. .I string
  1401. argument is given, the binding for that string is listed;
  1402. and if both a
  1403. .I string
  1404. and a
  1405. .I command
  1406. are given, a curses binding is created such that when the
  1407. .I string
  1408. is typed in curses mode, the function specified by
  1409. .I command
  1410. is executed.
  1411. .sp
  1412. Bindings can be removed by using the
  1413. .B unbind
  1414. command.
  1415. .TP
  1416. .BR bind-macro " [string [expansion]]"
  1417. This command is an abbreviation, which invokes the
  1418. .B bind
  1419. command with the special function
  1420. .B macro
  1421. as the second argument.
  1422. The effect of binding a curses macro is that whenever the
  1423. .I string
  1424. is typed in curses mode, the effect is the same as if the
  1425. .I expansion
  1426. had been typed instead.
  1427. A special syntax is provided for including non-printing (control)
  1428. characters in both the
  1429. .I string
  1430. and the
  1431. .IR expansion ;
  1432. see the CURSES INTERFACE section and the MACROS section for details.
  1433. .sp
  1434. If no arguments are given,
  1435. .B bind-macro
  1436. lists the current curses mode macros.
  1437. It is otherwise identical to
  1438. .in +4
  1439. .B bind
  1440. .I string
  1441. .B macro
  1442. .IR expansion .
  1443. .in -4
  1444. .TP
  1445. .B cd
  1446. Change the working directory to that specified, if given.
  1447. If no directory is given, then changes to the user's home directory.
  1448. .TP
  1449. .BR cmd " [name [command]]"
  1450. .ns
  1451. .TP
  1452. .BR uncmd " name"
  1453. .rs
  1454. Command line aliases are set and unset using these commands.
  1455. More extensive information is given in the LINE-MODE INTERFACE section.
  1456. .B Uncmd
  1457. may take `*' as an argument to uncmd everything set.
  1458. .TP
  1459. .BR curses " [off]"
  1460. The
  1461. .B curses
  1462. command causes
  1463. .I Mush
  1464. to change from the line-oriented mode to the screen-oriented (curses)
  1465. mode, as described above in the CURSES INTERFACE section.
  1466. This command may not be given when curses mode is already active.
  1467. When used in an initialization file (such as
  1468. .IR .mushrc )
  1469. this command is the same as giving the \-C (\-curses) switch on the
  1470. .B mush
  1471. command line.
  1472. .sp
  1473. The argument
  1474. .I off
  1475. may be used
  1476. .I only
  1477. in initialization files, including those read with \-I (\-init),
  1478. and has the effect of turning off the \-C switch.
  1479. .I Off
  1480. is ignored at all other times, even in files read with \-F (\-source).
  1481. .TP
  1482. .BR debug " [N]"
  1483. Set debugging level to N (1 by default).
  1484. When in debug mode, the user can see some of the flow of
  1485. control the program makes while executing.
  1486. The intent of the debug level is for tracking down
  1487. bugs with the program at specific locations.
  1488. Occasionally, the program may segmentation fault and core dump.
  1489. When this happens, the user can reenter the program,
  1490. set the debugging level and recreate the problem.
  1491. .sp
  1492. If the user suspects memory allocation problems, a debugging
  1493. level of 5 or higher prevents memory from being freed so that
  1494. memory bounds won't get overwritten.
  1495. .sp
  1496. If the user suspects Mail Transport Agent errors,
  1497. a debugging level of 3 or higher prevents the MTA from starting
  1498. and outgoing mail is directed to the standard output instead of actually
  1499. being sent.
  1500. .TP
  1501. .BR delete / undelete
  1502. .RB ( d / u )
  1503. Takes a message list as argument and marks them all as deleted.
  1504. Deleted messages are not saved in
  1505. .IR mbox ,
  1506. nor are they be available for most other commands.
  1507. If the folder has not been updated, deleted messages can be recovered
  1508. with
  1509. .BR undelete .
  1510. .TP
  1511. .B dp
  1512. .R (also
  1513. .BR dt )
  1514. Deletes the current message and prints (types) the next message.
  1515. .TP
  1516. .BR echo " [-n] [-h | -p] arguments"
  1517. Echoes all the arguments given on the command line, expanding variables
  1518. and history references.  If the -n flag is given, then no newline is appended.
  1519. If the -h flag is given, then echo looks for formatting parameters
  1520. as if the "from" command were given on the "current" message.
  1521. If the -p flag is given, then echo looks for formatting parameters
  1522. as if your prompt were changed temporarily.
  1523. .sp
  1524. Examples:
  1525. .sp
  1526. .nf
  1527. .ti +2
  1528. echo -h This message is from %a and is dated %d.
  1529. .br
  1530. might produce:
  1531. .ti +2
  1532. This message is from zipcode!argv and is dated Dec 14, 1988.
  1533. .sp
  1534. .ti +2
  1535. echo -p There are %n new messages to read in %F.
  1536. .br
  1537. might produce:
  1538. .ti +2
  1539. There are 5 new messages to read in /usr/spool/mail/argv.
  1540. .fi
  1541. .sp
  1542. Note that -h and -p cannot be specified together.
  1543. .TP
  1544. .B edit\ \ 
  1545. .RB ( e ,
  1546. .BR v )
  1547. This function lets you edit messages in your folder.  When editing messages,
  1548. be careful not to remove certain message headers such as Date or From or
  1549. any others that looks important.  If you remove or change something you
  1550. shouldn't have, you are notified and the temporary file used to edit
  1551. the message is not removed.
  1552. .TP
  1553. .BR eval " [\-h | \-p] arg ..."
  1554. As in most shells, the list of arguments to
  1555. .B eval
  1556. is re-parsed and then executed as a command.
  1557. This is useful primarily for causing multiple levels of variable expansion.
  1558. .sp
  1559. If the \-h option is given,
  1560. .B eval
  1561. expands header format strings in the argument list before executing the
  1562. command.
  1563. Similarly, the \-p option expands prompt format strings in the argument
  1564. list before executing.
  1565. These formats are expanded \fIlast\fR, after all history and variable
  1566. expansion is completed, and are implicitly quoted, so embedded quotes,
  1567. spaces, tabs, `!'s, etc. are handled correctly.
  1568. Header formats are expanded using the 
  1569. .I current
  1570. message.
  1571. For example,
  1572. .sp
  1573. .ti +2
  1574. eval \-h pick \-f %a
  1575. .sp
  1576. finds all messages from the same author as the current message.
  1577. See the the entries for
  1578. .I hdr_format
  1579. and
  1580. .I prompt
  1581. in the VARIABLES section for more details.
  1582. .sp
  1583. Note that -h and -p cannot be specified together.
  1584. .TP
  1585. .B exit\ \ 
  1586. .RB ( x )
  1587. Terminates
  1588. .I Mush
  1589. immediately without modifying the current folder or system spool directory.
  1590. In scripts and initialization files,
  1591. .B exit
  1592. is handled specially and discontinues the file without leaving the program.
  1593. However,
  1594. .I x
  1595. terminates the program as usual.
  1596. .TP
  1597. .BR expand " alias-list"
  1598. Aliases, given as arguments, are expanded as they are when you
  1599. send mail to each.
  1600. Nested alias references are fully expanded.
  1601. .TP
  1602. .BR flags " [ [ + | \- ] [ D f N O P p R r S U ] ] [msg-list]"
  1603. This command modifies the flag bits set on the listed messages.
  1604. SHAR_EOF
  1605. true || echo 'restore of mush.1 failed'
  1606. fi
  1607. echo 'End of  part 15'
  1608. echo 'File mush.1 is continued in part 16'
  1609. echo 16 > _shar_seq_.tmp
  1610. exit 0
  1611. exit 0 # Just in case...
  1612. -- 
  1613. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1614. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1615. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1616. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1617.