home *** CD-ROM | disk | FTP | other *** search
/ ftp.freefriends.org / ftp.freefriends.org.tar / ftp.freefriends.org / arnold / Source / mush.rstevens.tar.gz / mush.tar / cmd_help < prev    next >
Text File  |  1991-05-16  |  44KB  |  1,203 lines

  1. /* @(#)cmd_help    10/24/88 (Dan Heller) */
  2.  
  3. %about%
  4. Mush, the Mail User's Shell was conceived, written and performed by
  5.  
  6. Dan Heller                                            Bart Schaefer
  7. argv@zipcode.com                               schaefer@zipcode.com
  8. argv@ora.com                                   schaefer@cse.ogi.edu
  9. argv@monet.berkeley.edu
  10. argv@uunet.uu.net
  11.  
  12. Mush is copyright (c) 1986, 1987, 1988, 1989, 1990, 1991 by Dan Heller.
  13.                      All Rights Reserved.
  14.  
  15. This software is not in the public domain.  It is freely available
  16. under the restrictions discussed in the README file accompanying
  17. this distribution.
  18.  
  19. Dan Heller is currently working on his second book, The Motif
  20. Programmer's Manual for O'Reilly && Associates.  Bart Schaefer
  21. recently completed his Ph.D. in Computer Science and Engineering
  22. at the Oregon Graduate Institute.  Bart and Dan have co-founded
  23. Z-Code Software Corporation to produce, among other things, Z-Mail,
  24. the successor to Mush.  If you like Mush, talk to us about Z-Mail :-).
  25.  
  26. History:
  27.     Mush was created as a friendlier and more versatile replacement
  28. for the commonly available UNIX mail utilities.  It originated in
  29. 1985 as "frankenmail", with strictly a SunWindows interface, but
  30. soon expanded to line and curses modes under the demands of excited
  31. users.  Bart climbed aboard on version 6.0 in October 1987.  The
  32. current version, 7.2, is the culmination of efforts by Dan, Bart,
  33. and numerous contributors from around UseNet:
  34.  
  35.     Don Lewis                           Rich Burridge
  36.     Bill Randle                         Bill Petro
  37.     Marc Rouleau (MMDF support)         Akkana
  38.     James Bohem                         Michael Berman
  39.     Mike O'Carroll (DOS ports)          David St. Pierre
  40.     Kevin Sheehan
  41.  
  42. and many others who may have been lost or weren't listed for fear
  43. of misspelling.
  44.  
  45. Discussion and support of Mush is available via the newsgroup
  46. comp.mail.mush or mailing list mush-users@apple.com, which are
  47. one and the same in content.  If you cannot get the newsgroup
  48. at your site, you can request to join mush-users by sending such
  49. a request to mush-users-request@apple.com.
  50. %%
  51.  
  52. %?%
  53.       ? [command]
  54.  
  55. The `?' command gives you a list of legal commands.  Most commands
  56. accept -? as an option.  This provides you with specialized help for
  57. that particular command.
  58.  
  59. If the optional argument is given, help for that command is shown.
  60. %%
  61.  
  62. %ignore%
  63.       ignore/unignore [headers]
  64.  
  65. Use this command to set the message headers you would like not
  66. to be printed when you read a message. If no header specified,
  67. then a list of all headers currently being ignored is printed.
  68. You must specify a header for unignore.
  69.  
  70. You can set the variable $alwaysignore to force normally
  71. ignored headers to be ignored while saving messages, forwarding
  72. messages or including messages into message buffers.
  73.  
  74. See also the variable $show_hdrs.
  75. %%
  76.  
  77. %set%
  78.       set/unset [variable [= value]]
  79.  
  80. With no parameters, set lists all variables and their values.
  81. To set a boolean variable (on or off), use:
  82.         set variable
  83. To set a variable's value to a string, use:
  84.         set variable = value
  85.  
  86. If you want double-quotes or white-space embedded in a string,
  87. encase the string in single quotes.  If you want single quotes
  88. in a string, encase the string in double quotes.
  89.  
  90. For a list of all variables with special meanings, use:
  91.         set ?all
  92. For help on a particular one of these variables, use:
  93.         set ?variable_name
  94. %%
  95.  
  96. %readmsg%
  97.       print [msg_list]
  98.       type [msg_list]
  99.       top [msg_list]
  100.       next [msg_list]
  101.       previous [msg_list]
  102.  
  103. You can read messages in different ways.  "type" and "print" display
  104. the current message.  "top" displays the first N lines of the current
  105. message where N is the value of the variable "toplines", or "crt" if
  106. "toplines" is not set.  "next" advances to the next unread message and
  107. print that.  "previous" moves back to read the first unread message
  108. before the current message.  "^" displays the first message, "$"
  109. displays the last.
  110.  
  111. Any of these commands can be followed by a message list, and each
  112. message in that list is displayed (or piped to other commands).
  113.  
  114. See also "help msg_list" and the variable $autoprint.
  115. %%
  116.  
  117. %alts%
  118.       alts [hostnames] [*[user]] [!path!user] [user@host]
  119.  
  120. The alts command sets a list of hostnames on which you have an
  121. account.  Normally, when you respond to all recipients of mail,
  122. your account name is listed as if you wished to send yourself mail.
  123. If you don't have metoo set, then your name is removed from the
  124. mailing list if the host specified is in the alternates list.
  125. Hostnames may be given either as a single name or as a UUCP path
  126. (separated by `!' characters).
  127.  
  128. The special parameter `*' instructs alts to match all hostnames;
  129. in that case, only your login name is tested.  A user name may be
  130. appended to the `*', in which case that name is tested instead of
  131. your local login name.  A user name at a specific host machine
  132. may be specified either with the syntax "user@host" or by beginning
  133. the UUCP path to the host with a `!' character.  The leading `!'
  134. is used to differentiate paths that already end in a user name from
  135. those to which your local login name should be appended.
  136. %%
  137.  
  138. %source%
  139.       source/saveopts [file]
  140.  
  141. The source/saveopts commands load/save all variable settings,
  142. options, aliases, cmd's, ignored headers ...  everything you can set,
  143. it loads or saves.  The file read or written follows these rules:
  144.  
  145. 1) If a filename is given, that file is used
  146. 2) The file described by the environment variable MAILRC
  147. 3) In the user's home directory: .mushrc (if it exists)
  148. 4) In the user's home directory: .mailrc (if it exists)
  149.  
  150. If saveopts is used and the file exists, confirmation is requested
  151. before the file is overwritten.
  152. %%
  153.  
  154. %help%
  155.       help [item]
  156.  
  157. Type "help" with no arguments for a list of valid items.
  158. %%
  159.  
  160. %general%
  161. This is the general help message.  To get help on a specific
  162. command, try "command -?".  Extended help is given by typing
  163. "help item" where item is one of:
  164.     path, msg_list, prompt, hdr_format
  165. Help with msg_list is highly advisable!
  166.  
  167. Type "?" to get a list of available commands.  Try "? command"
  168. to get help on the particular command that you specify.
  169.  
  170. Use "set ?variable" to get help with specific variables.
  171. %%
  172.  
  173. %path%
  174. Whenever "path" is specified, the following syntax is legal
  175. besides the normal path addressing scheme used by unix:
  176.  ~[user]   -- the home directory of specified user (yours by default)
  177.  %[user]   --/usr/spool/mail/login_name [user_name] (yours by default)
  178.  +file     --the directory described by `set folder'; file is `file'
  179. %%
  180.  
  181. %msg_list%
  182. A "msg_list" references one or more messages.  The user
  183. specifies a group of messages according to a special syntax.
  184.  
  185.  *      All messages.
  186.  ^      The first message.
  187.  $      The last message.
  188.  .      The current message.
  189.  N-M    A range of messages between N and M, inclusive.
  190.  
  191. In the last case, N and M may be * ^ $ . or digits referencing
  192. explicit message numbers.  The range must be in ascending order.
  193.  
  194. You can also negate messages by placing the message list inside
  195. braces, `{' `}' -- thus, the expression "2-19 {11-14}"
  196. references messages 2 through 19 except for those from 11
  197. through 14.
  198.  
  199. Commands can be "piped" to one another, because the return value
  200. of a command is a msg_list, not text.  For example,
  201.         pick -f fred | lpr
  202. finds all messages "from fred" and send them to the printer.
  203.  
  204. Commands dealing with more than one message process them in numeric
  205. order -- not necessarily the order specified.  Thus, the command
  206. "save 1-5 9 7 6 file" saves the messages in ascending order, not in
  207. the order given.
  208. %%
  209.  
  210. %hdr_format%
  211. This variable controls the display of message headers.  Use:
  212.         set hdr_format="string"
  213. to change the header display.  The string uses printf style
  214. formatting and follows these conventions:
  215.     %a  address of the author
  216.     %c  number of characters (bytes) in the message
  217.     %d  entire date of the message (see "date_received" variable)
  218.     %f  "From" field (author name and address)
  219.     %i  the message-id (may or may not be present)
  220.     %l  number of lines in the message
  221.     %M  month name of the message
  222.     %N  day of the month (number)
  223.     %n  name of the author
  224.     %s  subject of the message
  225.     %t  "To" field (recipients)
  226.     %T  time of the message (see "mil_time" variable)
  227.     %u  user name (login) of the author
  228.     %W  day of the week (Sun, Mon, etc.)
  229.     %Y  year of the message 
  230.     %y  year (last 2 digits only)
  231.     \n  a newline
  232.     \t  a tab
  233.  
  234. A field specifier may be used in any % expansion.  Thus, "%20s"
  235. displays the first 20 characters of the Subject.  No matter
  236. what the formatting string, the message number, the status of
  237. the message and a '>' (if this is the "current" message) is
  238. before any user defined format is printed.
  239. %%
  240.  
  241. %prompt%
  242. This variable controls the prompt that mush displays.
  243.         set prompt = "string"
  244. The "string" follows printf style formatting conventions:
  245.     %F  full path of the current working folder
  246.     %f  name (path tail) of the current folder
  247.     %m  current message number
  248.     %n  number of new messages
  249.     %u  number of unread messages
  250.     %d  number of deleted messages
  251.     %t  total number of messages
  252.     %T  current time
  253.     %N  day of the month (number) (today)
  254.     %W  weekday name (today)
  255.     %M  month name (this month)
  256.     %Y  year (this year)
  257.     %y  year (last 2 digits only)
  258.     %$  introduces variable name 
  259.     \n  newline
  260.     \t  tab
  261.  
  262. The special sequence %$ must be followed by the name of a variable.
  263. The value of that variable is inserted into the prompt at the time
  264. the prompt is displayed.  When setting a %$variable sequence in your
  265. prompt, be sure to enclose the string in single quotes ('') to
  266. prevent the shell from expanding the variable at that time.
  267. %%
  268.  
  269. %preserve%
  270.       preserve [msg_list]
  271.  
  272. The "preserve" command marks messages to be saved in your system
  273. mailbox.  Unless explicitly preserved, all mail that you read is
  274. saved at quit time in ~/mbox (or the file specified by $mbox).
  275. Deleted messages are preserved only if first undeleted (see
  276. "delete -?").  When a message is preserved, the `P' status bit
  277. appears in the header summary display for that message.
  278.  
  279. The "unpreserve" command reverses the effect of "preserve".
  280.  
  281. Setting the boolean variable $hold is equivalent to preserving
  282. each message as you read it, except that no `P' status is set.
  283. %%
  284.  
  285. %mark%
  286.       mark [-[A|B|C|D|E]] [msg_list]
  287.       unmark [msg_list]
  288.  
  289. The "mark" command places a tag on messages that you wish to
  290. reference later.  If no argument or a msg_list only is given, the
  291. mark is temporary and is not saved when the folder is updated.  
  292. The command "headers -H:m" (abbreviated as ":m") can be used to
  293. reference all messages having this temporary mark.
  294.  
  295. A "priority" may be set on messages by specifying a `-' followed
  296. by a letter in the range A through E.  The "sort" and "pick" commands
  297. can be used to order or select messages according to their priorities.
  298. Message priority is saved across folder updates.
  299.  
  300. Messages may have both a temporary mark and a priority, but may not
  301. have more than one priority.  The presence of a temporary mark is
  302. shown by a `+' character immediately following the message number
  303. in the "headers" command display, while the priority letter is
  304. displayed in the same place if the message unmarked but prioritized.
  305.  
  306. The "unmark" command removes temporary marks only.  To remove the
  307. priority of a message, do not specify a priority:
  308.  
  309.     mark - [msg_list]
  310.  
  311. See also the commands "set", "sort", "pick" and "headers".
  312. %%
  313.  
  314. %save%
  315.       save/write/copy [-s|-S|-a|-A] [-f] [msg_list] [filename]
  316.  
  317. If no filename is specified, ~/mbox (or the value of the variable
  318. "mbox") is used.  Save and write append the message to the file if
  319. it already exists.  Specifying -f overwrites the file (e.g., erasing
  320. it first).
  321.  
  322. To save messages to a filename beginning with a digit, escape
  323. the filename with a backslash (\).
  324.  
  325. The "write" command writes message without the headers (message
  326. body only).  Save and write both mark messages for deletion unless
  327. $keepsave is set.  The "copy" command is identical to "save" except
  328. that messages are not marked for deletion (identical to having the
  329. variable "keepsave" set).
  330.  
  331. The -s and -S options save messages to files named by the
  332. subject of the message.  If more than one message is specified,
  333. then the message subject of each message is used.  If -S is
  334. specified, then the subject of the first message is used for all
  335. messages.  Spaces and forward slashes (/) are converted to
  336. underscores (_).
  337.  
  338. The -a and -A options save messages by author's login name.
  339. %%
  340.  
  341. %lpr%
  342.       lpr [-n] [-h] [msg_list]
  343.  
  344. Send a message to the printer.  The options are:
  345.   -n      print body of message only (no headers)
  346.   -h      do not print ignored headers
  347.   -Pxx    print on printer xx
  348.  
  349. The variable $printer can be used to specify a default printer;
  350. for example, "set printer=lp" is the same as always using "-Plp".
  351. The variable $print_cmd can be used to specify a program other
  352. than "lpr" to use for printing.
  353.  
  354. NOTE:  Some systems require that the printer name be introduced
  355. by "-d" rather than "-P".  Mush may have been configured so that
  356. both -P and -d will produce the correct result, but if an error
  357. occurs, try the other option.
  358.  
  359. See also the variable $alwaysignore.
  360. %%
  361.  
  362. %mail%
  363.       mail [mail-flags] [recipients]
  364.  
  365. Compose and send a mail message.  The possible flags are:
  366.   -b bcc-addrs    set blind-carbon-copy recipients
  367.   -c cc-addrs     set carbon-copy recipients
  368.   -e              immediately enter editor (autoedit)
  369.   -E              edit outgoing headers
  370.   -f [msg-list]   forward msg-list (not indented)
  371.   -F              add fortune to the end of message
  372.   -h file         read file as prepared draft (with headers)
  373.   -H file         read file as prepared text (without headers)
  374.   -i [msg-list]   include msg-list in letter
  375.   -I [msg-list]   include msg-list with headers in letter
  376.   -s [subject]    prompt for or set subject
  377.   -u              do not append signatures and fortunes
  378.   -U              send draft immediately (use with -h or -H)
  379.   -v              verbose (not available on some systems)
  380.  
  381. The -f option adds new headers and automatically sends the
  382. indicated messages to the list of recipients unless -E or -e
  383. is also given.  The -I and -i options copies the indicated
  384. messages into the text of your letter, surrounded by the text
  385. of variables pre_indent_str, indent_str, and post_indent_str.
  386.  
  387. The -h option reads a draft file, which should already include
  388. message headers.  The -H option reads a text file, which should
  389. NOT include headers.  If the -U option is also given, the draft
  390. is sent immediately.
  391.  
  392. See also the variables $ask, $askcc, $autoedit, $autoinclude,
  393. $autosign, $autosign2, $dot, $edit_hdrs, $escape, $fortune,
  394. $fortunates, $logfile, $record, $no_expand, $no_hdrs, $realname,
  395. $sendmail, $verbose, $verify, and $wrapcolumn.
  396. %%
  397.  
  398. %respond%
  399.       replysender/replyall [msg-list] [-r path] [mail-flags] [recipients]
  400.  
  401. The "replysender" command replies only to the sender of a
  402. message, whereas "replyall" responds to everyone on the To: and
  403. Cc: lines of the message.
  404.  
  405. The command "reply" is identical to "replysender".
  406.  
  407. If a message list is indicated, then each message on the list is
  408. replied to in the same manner.  If -r is specified with a host or
  409. path (uucp-style), then each address in the list is routed via
  410. this path.  This overrides the value of auto_route (see man page).
  411.  
  412. The address of the author is obtained from certain headers in his
  413. message to you.  Unless you specify otherwise, mush searches for the
  414. headers Reply-To: Return-Path: and From:.  You can override these
  415. values by setting the variable reply_to_hdr.
  416.  
  417.     set reply_to_hdr = "sender reply-to return-path from_"
  418.  
  419. This example shows that mush searches (in order) for the headers
  420. listed in the reply_to_hdr variable.  If one header isn't found, then
  421. mush looks for the next in the list.  If none of the headers in the
  422. list are found, the default headers (mentioned above) are searched.
  423. The last header listed in the example is the special "From " header.
  424. See the man page for more details.
  425.  
  426. Type "mail -?" for information on legal mail flags.
  427.  
  428. See also the variables $auto_route, $domain_route, $in_reply_to,
  429. $known_hosts, $metoo, $reply_to_hdr, and those listed by "mail -?".
  430. %%
  431.  
  432. %sort%
  433.       sort [-i] [-r|a|d|l|R|s|S]
  434.  
  435.   -i         ignore case in alphabetical sorts
  436.   -r         reverse order of next criteria
  437.  
  438.   -a         by author (alphabetical)
  439.   -d         according to date
  440.   -l         by length (size in characters, not lines)
  441.   -p         by priority (marks)
  442.   -R         by subject including Re:
  443.   -s         by subject ignoring Re: (alphabetical)
  444.   -S         by status
  445.  
  446. Any combination of the options can be given.  Each comparison
  447. proceeds from left to right through the list of criteria,
  448. stopping when an ordering has been determined or no criteria
  449. remain.  The optional -r flag reverses the order of the next
  450. comparison specified.  Example:
  451.  
  452.       sort -i -a -r -d
  453.  
  454. The above sorts by author first, ignoring case, and then sorts by
  455. reverse date (most recent first) for each author.  The -r option can
  456. be given once for each criterion and applies only to the first
  457. criterion that follows it.  Giving -r twice in succession (-r -r)
  458. does NOT negate the reversal!  Whatever option follows the rightmost
  459. -r has its sense reversed.
  460.  
  461. Unlike -r, the -i option is recognized at most once and applies
  462. to all alphabetical sorts in the list of criteria.
  463.  
  464. By default (no parameters), sort orders messages by status:
  465. New, unread messages are first, followed by preserved messages
  466. and finally the deleted messages are placed at the end.  If -r
  467. is the only flag given, the status order is reversed.
  468.  
  469. If the $date_received variable is set, sorting by date is
  470. done using the date you received the message.  Otherwise,
  471. messages are sorted by date sent by the original author.
  472.  
  473. See also the variable $sort.
  474. %%
  475.  
  476. %pick%
  477.       pick [+<num>] [-<num>] [-r msg_list] [-x] [-i] [-h hdr] [-f|s|t]
  478.         [-d [-][date]] [-ago [+|-] [n days] [n weeks] [n months]]
  479.         [-p priority] [[-e] <pat>]
  480.  
  481. Search for patterns within messages.  Entire messages are
  482. searched for <pattern> unless -f, -h, -s, or -t is specified.
  483. Only one of -d, -f, -h, -s, -t and -ago can be specified; no
  484. pattern is used with -d and -ago; and -x may not be used in
  485. conjunction with +<num> and/or -<num>.
  486.  
  487.   +<num>        return only the first <num>ber messages matched
  488.   -<num>        return only the last <num>ber messages matched
  489.   -x            return all the messages which do NOT match
  490.   -e            remaining arguments are the <pat> (`e'xpression)
  491.   -f            match pattern in the "From:" field (author) only
  492.   -s            match pattern in the "Subject:" header only
  493.   -t            match pattern in the "To:" field only
  494.   -h hdr        match pattern in specified header field only
  495.   -i            ignore case of letters in when matching
  496.   -r msg_list   restrict the range of messages search to msg_list
  497.   -d            select messages sent on [+ after] [- before] date
  498.         A "date" is of the form:  [+-][month]/[date[/year]]
  499.         Omitted fields default to today's values.  Examples:
  500.           pick -d 4/20     messages on Apr 20, this year
  501.           pick -d -/2/85   on or before the 2nd, this month, 1985
  502.           pick -d +5/4     on or after May 4, this year
  503.           pick -d /        finds today's messages only
  504.         At least one `/' char must be used in a date.  There is
  505.         no strong date checking; 2/30 would be considered valid.
  506.   -ago          select messages relative to the current date
  507.         Date formats for "ago" are more verbose than for -d; see
  508.         the manual page for details.
  509.   -p [A-E]      select messages with specified priority
  510.         Multiple -p flags may be used to search for several
  511.         priorities at once.
  512.  
  513. Examples:
  514.     Find the first 5 messages with the subject "Telephone Message":
  515.         pick +5 -s Telephone Message
  516.     Find the first 2 messages of the last 4 that are to "mush-users":
  517.         pick -4 +2 -t mush-users
  518.     Find those among messages 1 to 10 that are 2 months or more old:
  519.         pick -r 1-10 -ago -2m
  520.     Find messages that are 1 week old or newer:
  521.         pick -ago +1w
  522.     Find messages that contain "-request" in the Resent-From field:
  523.         pick -h resent-from -e -request
  524.  
  525. A description of the pick operation is printed before the search
  526. is performed, unless the value of the variable $quiet contains the
  527. field "pick", or pick is piped to another mush command.
  528. %%
  529.  
  530. %alias%
  531.       alias [name [namelist]]
  532.  
  533. Options for alias:
  534.  alias                       print all namelists
  535.  alias name                  print namelist associated with name
  536.  alias name namelist         set "name" to the value of namelist
  537.  unalias namelist            unalias names in namelist
  538.  
  539. A "namelist" consists of one or more addresses.  An address may
  540. be a name already set to another list, a valid user, a file or
  541. a program.  Filenames must be full pathnames, i.e., they must
  542. begin with a '/' (or with a ~, which expands to some home dir).
  543. A "program" must start with a pipe symbol and be encased in
  544. quotes:
  545.  
  546.     "|program_name"
  547.  
  548. The command "expand" fully expands addresses (including sublists)
  549. associated with the given alias.
  550.  
  551. See also the variable $no_expand.
  552. %%
  553.  
  554. %from%
  555.       from [+|-] [msg-list] [pattern]
  556.  
  557. With no parameters, "from" displays the current message's header
  558. line.  If given a message list, "from" displays the headers of the
  559. listed messages.
  560.  
  561. The special parameters `-' and `+' can be given to move the
  562. current message pointer to the previous or next message
  563. respectively, while also printing that message's header.
  564.  
  565. If a message list was given in addition to `-' or `+', then
  566. the current message pointer is set to the first or last
  567. message, respectively, in the message list given.
  568.  
  569. If a pattern is given, that pattern is searched for in the From:
  570. header of the message.  If both a message list and a pattern are
  571. given, the pattern search is restricted to the listed messages.
  572.  
  573. Examples:
  574.  
  575.         from - 10-30 {16}
  576. displays the headers of messages 10 through 30 except for
  577. message 16 and set the current message pointer to 10.
  578.  
  579.         from + Dan
  580. displays the headers of all messages that contain "Dan" in the
  581. author's name and set the current message pointer to the last
  582. one of that kind in the list.
  583.  
  584.         from +
  585. displays the header of the message after the current message
  586. and increment the current message pointer to that message.
  587.  
  588. See also the "headers" command and "help hdr_format".
  589. %%
  590.  
  591. %my_hdr%
  592.       my_hdr [header[: string]]
  593.  
  594. This command is used to set, unset or view your personalized
  595. message headers.  These headers are included in all your
  596. outgoing mail.
  597.  
  598. Options for my_hdr:
  599.   my_hdr                        show all headers
  600.   my_hdr header                 show value of header
  601.   my_hdr header: string         set header to string
  602.   un_hdr header                 unset header
  603.  
  604. Note that there is no space between the header name and the
  605. colon in the third form of the command.
  606. %%
  607.  
  608. %fkey%
  609.       fkey [<sequence> [command]]
  610.       unfkey <sequence>
  611.  
  612. This command is used to make function key settings in Suntools
  613. (graphics) mode.  When run as a tool (-t on command line),
  614. choose the Options item, and the "function key" menu option.
  615.  
  616. The unfkey command removes the setting for a given string.
  617. %%
  618.  
  619. %cmd%
  620.       cmd [name [value]]
  621.  
  622. This function is used to establish command aliases; cmd's are
  623. just like aliases in the C-shell.  Options are:
  624.   cmd                       view all commands
  625.   cmd command               show value of command
  626.   cmd command value         set command to value
  627.   uncmd command             unset command
  628.  
  629. The value must be quoted if it is to contain command separators
  630. such as `;' or `|'.
  631.  
  632. If you want to reference history commands within a cmd,
  633. escape the ! with a backslash.  For example:
  634.  
  635.         cmd r 'replysender \!* ; delete -t'
  636.  
  637. causes "r" to reply using whatever parameters you have given on
  638. the command line and then delete that message and print the next
  639. message (-t parameter to "delete").
  640. %%
  641.  
  642. %headers%
  643.       headers [+|-|N] [[-H]:c]
  644.   +     print the next screenful (or use the 'z' command).
  645.   -     print the previous screenful (or use 'z-' ).
  646.   N     print a screenful starting at message number N.
  647.   -H:c  where `c' is one of
  648.      a  all messages (mostly for the mush startup option -H:c)
  649.      d  deleted messages
  650.      m  marked messages
  651.      n  new messages
  652.      o  old messages
  653.      p  preserved messages
  654.      r  replied-to messages
  655.      s  saved messages
  656.      u  unread messages
  657.  
  658. The "headers" command prints out a screenful of headers.
  659. Deleted messages are not normally shown; set "show_deleted" to
  660. include deleted messages.
  661.  
  662. The command ":c" is equivalent to "headers -H:c".  The -H can be
  663. omitted, i.e., "headers :c" also works.
  664.  
  665. See also "help hdr_format".
  666. %%
  667.  
  668. %folder%
  669.       folder [-N] [-n] [-r] [%[user]|#|&|file]
  670.  
  671.   -N       do not display the list of headers
  672.   -n       do not update the current folder before changing
  673.   -r       read only mode (cannot write changes to new folder)
  674.   %[user]  change to /usr/spool/mail/[user] (you by default)
  675.   #        change to folder accessed previous to current folder
  676.   &        change to "mbox" -- default is $mbox or ~/mbox
  677.  
  678. The "folder" command changes the current folder; with no parameters,
  679. it prints the name of the current folder.  For compatibility with
  680. older versions, the single character `!' is equivalent to -n.
  681.  
  682. "Folder" treats the characters `+' and `~' as metacharacters when
  683. they are the first character of a file name.  `~' is expanded to the
  684. name of the user's home directory, or to another user's home if it
  685. is given as "~username" (no `/' between the `~' and the name).  `+'
  686. is expanded to the user's folder directory ("~/Mail" or the value of
  687. $folder); no `/' is required between `+' and the file name, so both
  688. "+file" and "+/file" refer to the same file.
  689.  
  690. The "update" command updates the current folder.  In this case, only
  691. the -N and -r options are recognized; "update -r" changes the current
  692. folder to read only mode AFTER updating it.
  693.  
  694. See also the variable $folder.
  695. %%
  696.  
  697. %quit%
  698.       quit/exit
  699.  
  700. These commands end a mush session.  "quit" updates your mailbox; if
  701. new mail has come in, you are told so and given an option whether to
  702. really quit or not.  "exit" terminates mush neither updating your
  703. mailbox nor checking for new mail.
  704. %%
  705.  
  706. %ls%
  707.       ls [options]
  708.  
  709. The "ls" command is exactly like the UNIX command "ls".  All
  710. parameters are the same.  The "folders" command is equivalent
  711. to doing "ls -FR $folder" from the Mush prompt.
  712. %%
  713.  
  714. %shell%
  715.       sh [command]
  716.  
  717. If a "command" is given, that UNIX command is executed under the
  718. Bourne shell.  If no command is specified, then an interactive shell
  719. is started. The environment variable SHELL or the local mail shell
  720. variable $shell describes the shell to invoke.  If none is set, then
  721. the default shell is defined by the system administrator (currently
  722. set to csh).
  723.  
  724. Users on systems with job control probably have little use for the
  725. sh command.
  726. %%
  727.  
  728. %stop%
  729.       stop
  730.  
  731. The stop command sends a stop signal to the mail shell.  It is
  732. equivalent to your tty job-control stop character (often ^Z).
  733. Since the mush shell never needs to be exited, the command 'q'
  734. may be "cmd"ed to "stop;await" and csh users may have
  735.         alias mail %mush
  736. to bring mush into the foreground rather than having to invoke
  737. it again.  New mail is then read into the shell automatically
  738. and much time and energy is saved.
  739. %%
  740.  
  741. %curses%
  742.       curses
  743.  
  744. The curses-based interface for Mush does not require a graphics
  745. display, but does require a terminal which can handle upline
  746. cursor movement capabilities.  All commands are one or two
  747. keystroke commands and are executed as soon as the key is typed.
  748.  
  749. For a list of current key-to-command bindings, use the "bind"
  750. command (defaults to 'b' in curses mode).
  751.  
  752. See also the variable $curses_help.
  753. %%
  754.  
  755. %bind%
  756.       bind [<sequence> <curses-command> [<parameters>]]
  757.       unbind <sequence>
  758.  
  759. Binding is done for the curses interface only.  It allows the
  760. user to bind keystrokes or key sequences to curses-interface
  761. commands.  You cannot bind keystrokes to regular mush commands
  762. using bind.
  763.  
  764. A bound key-sequence (input by the user) is converted into
  765. the curses command it is bound to.  For a list of all curses
  766. commands, issue the "bind" command and follow the instructions
  767. to get a list.  Currently, parameters are ignored for all curses
  768. commands except the special command "macro".
  769.  
  770. When specifying sequences, you may enter almost anything at the
  771. keyboard that you want to type.  This includes most control
  772. characters.  A special syntax is provided to specify control
  773. characters if you wish to set up default key bindings in your
  774. initialization file without using real control characters.
  775.  
  776. To bind keystrokes that are control characters in the
  777. initialization file, you must use the notation "\CX" where "X"
  778. is an upper-case letter representing the control key you want to
  779. use. "\CN" would be control-N; "\n" is carriage return.  You may
  780. not bind keyboard generated signals; for most users, those key
  781. sequences are control-C and control-\.  For users with job
  782. control, the suspend characters (usually control-Z and
  783. control-Y) are also ignored.
  784.  
  785. Trying to bind a key sequence which prefixes another sequence is
  786. an error and the user is warned that the longer binding does not
  787. work.  The binding does take place, however, because it is
  788. possible to unbind the shorter sequence, thus validating the
  789. longer sequence.
  790.  
  791. The special curses command "macro" allows a string to be
  792. executed just as if the user typed it directly.  Issue the
  793. "bind-macro" command for more details.
  794.  
  795. Bindings are removed with the "unbind" command.
  796. %%
  797.  
  798. %msg_flags%
  799.       flags [[+|-] [flag-bits]] [msg-list]
  800.  
  801. Any sensible combination of these flag-bits may be used:
  802.   D    deleted
  803.   f    forwarded
  804.   N    new
  805.   O    old
  806.   P    preserved
  807.   p    printed
  808.   R    read
  809.   r    replied-to
  810.   S    saved
  811.   U    unread
  812.  
  813. This command displays the status of messages by default.  If a
  814. msg-list is specified, it tells which bits of the message are set.
  815. If any (one or more) of the bits are given and no + or - modifier is
  816. specified, then the status of each message in the list is set to that
  817. status absolutely (other status flags are lost).  However, if a +
  818. or - is specified, then the status is modified for that bit to on (+)
  819. or off (-).
  820.  
  821. If no list is given, the current message is used.
  822. %%
  823.  
  824. %setenv%
  825.       setenv VARIABLE [value]
  826.  
  827. Variable names may be any string, but traditionally environment
  828. variables are all upper case.  If no "value" is specified, then
  829. the variable name is set to an empty string.  If the value contains
  830. spaces, you should enclose the string in quotation marks.  Use
  831. printenv to print a list of all your environment variables.
  832. %%
  833.  
  834. %unsetenv%
  835.       unsetenv VARIABLE
  836.  
  837. You must specify one and only one variable to unset in your
  838. environment variable settings.  Use printenv to print a list of
  839. all your environment variables.
  840. %%
  841.  
  842. %printenv%
  843.       printenv [VARIABLE]
  844.  
  845. Display the entire current environment, or the value of the
  846. specified environment variable.
  847.  
  848. Also see "setenv" and "unsetenv".
  849. %%
  850.  
  851. %edit_msg%
  852.       edit [msg_list]
  853.  
  854. The "edit" command lets you edit messages in your folder.  The
  855. editor used is determined by the variable $editor, the environment
  856. variable EDITOR, the variable $visual and the environment variable
  857. VISUAL in that order.  If none of those variables are set, the
  858. default visual editor is used.  The "v" command is the same as "edit"
  859. but tests only $visual and VISUAL.
  860.  
  861. When editing messages, be careful not to remove certain message
  862. headers such as Date:, From:, or any others that look important.
  863. If you remove or change something you shouldn't have, you are
  864. notified and the temporary file used to edit the message is
  865. not removed.
  866. %%
  867.  
  868. %bind-macro%
  869.       bind-macro [<sequence> [<expansion>]]
  870.  
  871. The "bind-macro" command allows you to set macros in curses
  872. mode, so that one keystroke (or a few) acts as though you
  873. had typed a longer sequence.  Using "bind-macro" is equivalent
  874. to specifying the "macro" special command as a parameter to
  875. the "bind" command.
  876.  
  877. Given no parameters, "bind-macro" lists all current curses
  878. mode macros.  Given only a <sequence>, it shows the current
  879. binding for that sequence.  Given both a <sequence> and an
  880. <expansion>, it creates a macro such that, when the
  881. <sequence> is typed in curses mode, the effect is the same
  882. as if the <expansion> had been typed instead.
  883.  
  884. The same format for control characters that is used for the
  885. "bind" command may be used in both the <sequence> and the
  886. <expansion>, i.e.,
  887.     \Cx     control-x (where x is a capital letter)
  888.     \E      the escape character (\C[ does NOT work!)
  889.     \n      a newline (other C-style escapes also work)
  890.  
  891. Example:
  892.     bind-macro F [folder]+record\n
  893.  
  894. If you are in curses mode and hit the F key, then the curses
  895. mode command "folder" executes and +record (followed by
  896. a carriage return) is entered as if you typed it.
  897.  
  898. Macros are removed with the "unbind" command, see "bind -?".
  899.  
  900. Also see the "map" and "map!" commands.
  901. %%
  902.  
  903. %map%
  904.       map [<sequence> [<expansion>]]
  905.       unmap <sequence>
  906.  
  907. The "map" command allows you to use one keystroke (or a few) and
  908. have it act as though you had typed a longer sequence.
  909.  
  910. Given no parameters, "map" lists all current line mode
  911. macros.  Given only a <sequence>, it shows the current
  912. binding for that sequence.  Given both a <sequence> and an
  913. <expansion>, it creates a macro such that, when the
  914. <sequence> is typed in line mode, the effect is the same
  915. as if the <expansion> had been typed instead.
  916.  
  917. The same format for control characters that is used for the
  918. "bind" command may be used in both the <sequence> and the
  919. <expansion>, i.e.,
  920.     \Cx     control-x (where x is a capital letter)
  921.     \E      the escape character (\C[ does NOT work!)
  922.     \n      a newline (other C-style escapes also work)
  923.  
  924. Example:
  925.     map & print\n
  926.  
  927. If you are not in curses mode and hit the & key, then mush acts
  928. as if you typed the word "print" and hit carriage return.
  929.  
  930. To type a character without having the mapping expanded, precede
  931. the character with a backslash (\).
  932.  
  933. Mappings are removed with the "unmap" command.
  934.  
  935. Also see the "map!" and "bind" commands.
  936. %%
  937.  
  938. %map!%
  939.       map! [<sequence> [<expansion>]]
  940.       unmap! <sequence>
  941.  
  942. The "map!" command allows you to set macros in message
  943. composition mode, so that one keystroke (or a few) acts
  944. as though you had typed a longer sequence.  map!'s take
  945. effect regardless of whether you started the letter from
  946. curses mode or line mode.
  947.  
  948. Given no parameters, "map!" lists all composition mode
  949. macros.  Given only a <sequence>, it shows the current
  950. binding for that sequence.  Given both a <sequence> and an
  951. <expansion>, it creates a macro such that, when the
  952. <sequence> is typed in message composition mode, the effect
  953. is the same as if the <expansion> had been typed instead.
  954.  
  955. The same format for control characters that is used for the
  956. "bind" command may be used in both the <sequence> and the
  957. <expansion>, i.e.,
  958.     \Cx     control-x (where x is a capital letter)
  959.     \E      the escape character (\C[ does NOT work!)
  960.     \n      a newline (other C-style escapes also work)
  961.  
  962. Example:
  963.     map! ! <BANG>
  964.  
  965. If you are typing in a letter regardless of which interface you
  966. use and you hit the ! key, then mush reacts as if you typed the
  967. keys "<BANG>".
  968.  
  969. To type a character without having the mapping expanded, precede
  970. the character with a backslash (\).
  971.  
  972. Mappings are removed with the "unmap!" command.
  973.  
  974. Also see the "bind" and "map" commands.
  975. %%
  976.  
  977. %eval%
  978.       eval [-h|-p] args ...
  979.  
  980. This command causes its arguments to be re-parsed and then
  981. executed as a mush command.  Example:
  982.  
  983.     set initprompt='"$hostname:$cwd "'
  984.     eval set prompt=$initprompt
  985.  
  986. If the -h flag is given, then eval looks for formatting parameters
  987. as defined for the variable $hdr_format, and expands the formats
  988. for the "current" message before executing the command.  Example:
  989.  
  990.     eval -h pick -f %f
  991.  
  992. finds all messages from the same author as the current message.
  993.  
  994. If the -p flag is given, then eval expands formatting parameters as
  995. as defined for the variable $prompt.  The -h and -p flags may not be
  996. used together in the same eval.
  997. %%
  998.  
  999. %pipe_msg%
  1000.       pipe [-p pattern] [msg-list] [unix-command] [cmd-args]
  1001.  
  1002. This command is used to send a message to a unix command.  The
  1003. command takes its input from the message(s) passed to the pipe
  1004. command.  By default, the entire message (including headers) is
  1005. sent.  Ignored headers (see "ignore -?" and "set ?show_hdrs") can
  1006. be suppressed by setting the variable $alwaysignore.
  1007.  
  1008. You can pipe (|) messages to this command rather than give a
  1009. msg-list, but if no msg-list is given and there is no pipe, the
  1010. current message is used.  The unix-command is executed via "sh",
  1011. so csh aliases may not be used.
  1012.  
  1013. If invoked with a capital letter (Pipe), only the bodies of the
  1014. messages are fed to the unix-command -- all headers are omitted.
  1015.  
  1016. A pattern can be specified to indicate which line should start
  1017. the lines that are sent to the unix command.  The pattern must
  1018. match literally (no regular-expressions) at the beginning of a
  1019. line.  Once the pattern is found, that line and all succeeding
  1020. lines are sent to the unix command.
  1021.  
  1022. If the unix-command is omitted, then /bin/sh is used and the 
  1023. pattern searched for is "#!".  Therefore, "pipe" with no arguments
  1024. can be used to treat a message as a shell script.
  1025.  
  1026. Examples:
  1027.     pipe patch         -- send the current message to "patch"
  1028.     pipe -p %! lpr     -- send the message to a postscript printer
  1029.     pipe 2 7 more      -- send messages 2 and 7 through "more"
  1030.     1 | Pipe nroff     -- send the body of message 1 to "nroff"
  1031. %%
  1032.  
  1033. %merge%
  1034.       merge [-N] folder-name
  1035.  
  1036. The contents of the specified folder are read into the current
  1037. folder.  If -N is not specified, a header summary is printed
  1038. for each message read (see "headers -?").
  1039.  
  1040. A list of all the merged messages is returned for use in pipes.
  1041. %%
  1042.  
  1043. %echo%
  1044.     echo [-n] [-h | -p] args
  1045.  
  1046. Echo simply echoes the parameters to the command back to the user.
  1047.  
  1048. If the -n flag is given, then no newline is appended.
  1049. If the -h flag is given, then echo looks for formatting parameters
  1050. as if the "from" command were given on the "current" message.
  1051. If the -p flag is given, then echo looks for formatting parameters
  1052. as if your prompt were changed temporarily.
  1053.  
  1054. Examples:
  1055.     echo -h This message is from %a and is dated %d
  1056. might produce:
  1057.     This message is from island!argv and is dated Dec 14, 1988.
  1058.  
  1059.     echo -p There are %n new messages to read in %f.
  1060. might produce:
  1061.     There are 5 new messages to read in /usr/spool/mail/argv.
  1062.  
  1063. Note that -h and -p cannot be specified together.
  1064. %%
  1065.  
  1066. %undigest%
  1067.     undigest [-m] [-p pattern] [msg_list] [filename]
  1068.  
  1069. A "digest" is a mail message which is a collection of other mail messages
  1070. mailed to a "moderator" by other users.  The moderator compiles all the
  1071. messages into a folder and sends the result to all the subscribers of the
  1072. mailing list.  The undigest command disassembles the entries into the set
  1073. of messages which comprises the digest.
  1074.  
  1075. The -m option merges these messages into the current folder.  Otherwise,
  1076. if a filename is specified, a new folder is created and the user can change
  1077. folders to read the messages separately.
  1078.  
  1079. The -p option specifies an alternate pattern to use as the digest article
  1080. separator.  The pattern must match literally at the beginning of a line.
  1081. The default pattern is "--------" (eight hyphens).
  1082.  
  1083. If a message list is specified, each digest is disassembled to the same
  1084. filename (if given).  If no filename is given and the user did not request
  1085. a merge, then a folder is created based on the subject of the digest.
  1086. %%
  1087.  
  1088. %await%
  1089.     await [-T delay]
  1090.  
  1091. Instructs the shell to wait for new mail to arrive.  New mail is checked
  1092. every 30 seconds by default; a different delay can be specified by using
  1093. the -T option.
  1094.  
  1095. If this command is used in a pipe, its output is its input plus the list
  1096. of new messages that have arrived.  For example, to show the headers of
  1097. all new messages, and set the current message to the first new message:
  1098.  
  1099.     await | from -
  1100.  
  1101. The await command terminates only when new mail arrives or a keyboard
  1102. interrupt is generated.
  1103. %%
  1104.  
  1105. %cd%
  1106.       cd [directory]
  1107.  
  1108. Change the current working directory to the specified directory,
  1109. or to the user's home directory if none was given.
  1110.  
  1111. If the variable $cdpath is set to a list of directory names, and the
  1112. argument directory is not an absolute path, mush searches the cdpath
  1113. directories in the order given for the new directory and changes to
  1114. the first one found.  NOTE:  The current directory "." is always
  1115. searched first, before any directory in $cdpath.
  1116. %%
  1117.  
  1118. %pwd%
  1119.       pwd
  1120.  
  1121. Prints the current working directory.  The variable $cwd also
  1122. holds the current working directory unless reset by the user.
  1123. %%
  1124.  
  1125. %delete%
  1126.       delete/undelete [msg-list]
  1127.  
  1128. The "delete" command marks the listed messages as deleted.  If
  1129. no message list is given, the current message is deleted.
  1130.  
  1131. Deleted messages are not shown in the header summary display
  1132. except in curses mode and when the variable $show_deleted is set.
  1133. Deleted messages are ignored by the "pipe" command and by the
  1134. commands that display messages (see "print -?"), but most other
  1135. commands include all messages whether deleted or not.
  1136.  
  1137. Deleted messages are lost forever when the folder is updated (by
  1138. the "update" command, by changing folders without the "!" flag,
  1139. or by exiting with "quit").  Messages can be recovered by the
  1140. "undelete" command at any time BEFORE the folder is updated.
  1141.  
  1142. See also the variable $show_deleted.
  1143. %%
  1144.  
  1145. %history%
  1146.       history [-h] [-r] [number]
  1147.  
  1148. Display the command history that mush has recorded, as in csh.
  1149. Option -h suppresses the history numbers, and option -r shows
  1150. the history in reverse order (most recent first).  If a number
  1151. is given, that many commands of history are displayed.
  1152.  
  1153. The number of commands that mush records is controlled by the
  1154. variable $history.  If $history is not set, mush saves only
  1155. the previous command (equivalent to history=1).
  1156.  
  1157. The basic forms of history reference are (N is a number and
  1158. str is any string):
  1159.  
  1160.   !str      most recent command beginning with str
  1161.   !?str?    most recent command containing str
  1162.   !N        command N from the history list
  1163.   !-N       command N previous to the current one
  1164.   !!        previous command (same as !-1)
  1165.   !$        last word of previous command
  1166.   !*        all arguments of previous command
  1167.  
  1168. Modifiers (H can be str, ?str?, N or -N, n is a number or $):
  1169.  
  1170.   !H:$      last word of referenced command
  1171.   !H:n      n'th word of referenced command
  1172.   !H:n-m    n'th through m'th words of command
  1173.   !H:-n     word 0 (command name) through n of command
  1174.   !H:*      all arguments of command (same as !H:1-$)
  1175.   !H:n-     word n through next-to-last word
  1176.   !H:p      print but don't execute command
  1177.  
  1178.   !{R}str   append str to reference R (R is any form above)
  1179.  
  1180. It is not currently possible to combine :p with any of the
  1181. other modifiers.
  1182.  
  1183. Also see the variable $nonobang.
  1184. %%
  1185.  
  1186. %folders%
  1187.       folders
  1188.  
  1189. List the files in the directory described by the variable $folder.
  1190. These files are assumed to be folders of mail messages that can
  1191. be read in by the "folder" command (see "folder -?").
  1192.  
  1193. Also see the "ls" command.
  1194. %%
  1195.  
  1196. %stty%
  1197.       stty [options]
  1198.  
  1199. The "stty" command is equivalent to the UNIX command "stty".  All
  1200. options are the same.  Some settings are temporarily changed
  1201. while mush is running, but are restored when mush exits.
  1202. %%
  1203.