home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / mush.lzh / mush.2 < prev    next >
Encoding:
Text File  |  1990-05-06  |  55.0 KB  |  1,722 lines

  1.  
  2. #! /bin/sh
  3. # This is a shell archive.  Remove anything before this line, then feed it
  4. # into a shell via "sh file" or similar.  To overwrite existing files,
  5. # type "sh file -c".
  6. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  7. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  8. # If this archive is complete, you will see the following message at the end:
  9. #        "End of archive 2 (of 19)."
  10. # Contents:  mush/makefile.sun mush/mush.1.a
  11. # Wrapped by argv@turnpike on Wed May  2 13:59:19 1990
  12. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  13. if test -f 'mush/makefile.sun' -a "${1}" != "-c" ; then 
  14.   echo shar: Will not clobber existing file \"'mush/makefile.sun'\"
  15. else
  16. echo shar: Extracting \"'mush/makefile.sun'\" \(2253 characters\)
  17. sed "s/^X//" >'mush/makefile.sun' <<'END_OF_FILE'
  18. X# makefile.sun    (c) copyright 1986    (Dan Heller)
  19. X#
  20. XHDRS= mush.h config.h-dist strings.h bindings.h options.h version.h glob.h
  21. X
  22. XSRCS= addrs.c bind.c commands.c curs_io.c curses.c dates.c doproc.c \
  23. X      execute.c expr.c file.c fkeys.c folders.c glob.c hdrs.c init.c lock.c \
  24. X      loop.c macros.c mail.c main.c malloc.c misc.c misc_frame.c msgs.c \
  25. X      options.c panels.c pick.c print.c hdr_sw.c setopts.c signals.c sort.c \
  26. X      strings.c tool.c tooledit.c viewopts.c
  27. X
  28. XOBJS= addrs.o bind.o commands.o curs_io.o curses.o dates.o doproc.o \
  29. X      execute.o expr.o file.o fkeys.o folders.o glob.o hdrs.o init.o lock.o \
  30. X      loop.o macros.o mail.o main.o malloc.o misc.o misc_frame.o msgs.o \
  31. X      options.o panels.o pick.o print.o hdr_sw.o setopts.o signals.o sort.o \
  32. X      strings.o tool.o tooledit.o viewopts.o
  33. X
  34. XIMAGES= mail.icon.1 mail.icon.2
  35. X
  36. XHELP_FILES= README README-7.0 README-7.1 mush.1 cmd_help tool_help \
  37. X            Mushrc Mailrc Gnurc advanced.mushrc sample.mushrc digestify
  38. X
  39. XMAKES= makefile.sun makefile.bsd makefile.sys.v makefile.xenix makefile.hpux
  40. X
  41. X# If your SunOS version is 3.5, add -DSUN_3_5 to CFLAGS.
  42. X# If your SunOS version is 4.1, add -DSUN_4_1 to CFLAGS.
  43. X# If you are not using SUNTOOL, use makefile.bsd and add one of
  44. X#    -DSUN_3_5, -DSUN_4_0, or -DSUN_4_1 to CFLAGS there.
  45. XCFLAGS= -O -DSUNTOOL -DCURSES -DBSD
  46. XLDFLAGS=
  47. XLIBES= -lcurses -ltermlib -lsuntool -lsunwindow -lpixrect
  48. XOTHERLIBS=
  49. X# Use some variant of this one if you #define MMDF in config.h
  50. X#OTHERLIBS=/usr/src/mmdf/lib/libmmdf.a
  51. XLINTFLAGS= -bxah -Dlint
  52. X
  53. Xmush: $(OBJS)
  54. X    @echo loading...
  55. X    @cc $(LDFLAGS) $(OBJS) $(LIBES) $(OTHERLIBS) -o mush
  56. X
  57. X$(OBJS): config.h mush.h
  58. Xloop.o: version.h
  59. X
  60. Xlint:
  61. X    lint $(LINTFLAGS) $(SRCS) -DSUNTOOL -DCURSES -DBSD
  62. X
  63. Xclean:
  64. X    rm -f *.o core mush
  65. X
  66. XBINDIR= /usr/local/bin
  67. XLIBDIR= /usr/local/lib
  68. XMRCDIR= /usr/lib
  69. XMANDIR= /usr/local/man/man1
  70. XMANEXT= 1
  71. X
  72. Xinstall: mush
  73. X    mv mush $(BINDIR)
  74. X    strip $(BINDIR)/mush
  75. X    chmod 0755 $(BINDIR)/mush
  76. X    rm -f $(BINDIR)/mushtool
  77. X    ln -s $(BINDIR)/mush $(BINDIR)/mushtool
  78. X    cp mush.1 $(MANDIR)/mush.$(MANEXT)
  79. X    chmod 0644 $(MANDIR)/mush.$(MANEXT)
  80. X    cp tool_help $(LIBDIR)
  81. X    chmod 0644 $(LIBDIR)/tool_help
  82. X    cp cmd_help $(LIBDIR)
  83. X    chmod 0644 $(LIBDIR)/cmd_help
  84. X    cp Mushrc $(MRCDIR)/Mushrc
  85. X    chmod 0644 $(MRCDIR)/Mushrc
  86. END_OF_FILE
  87. if test 2253 -ne `wc -c <'mush/makefile.sun'`; then
  88.     echo shar: \"'mush/makefile.sun'\" unpacked with wrong size!
  89. fi
  90. # end of 'mush/makefile.sun'
  91. fi
  92. if test -f 'mush/mush.1.a' -a "${1}" != "-c" ; then 
  93.   echo shar: Will not clobber existing file \"'mush/mush.1.a'\"
  94. else
  95. echo shar: Extracting \"'mush/mush.1.a'\" \(50598 characters\)
  96. sed "s/^X//" >'mush/mush.1.a' <<'END_OF_FILE'
  97. X.\" Mush Man Page: Copyright (c) 1987, 1989, 1990 Dan Heller
  98. X.\" Cleaned up January 1988 by Bart Schaefer <schaefer@cse.ogc.edu>
  99. X.\" Patched again December 1989 by Bart Schaefer <schaefer@cse.ogi.edu>
  100. X.\" 1990 updates also by Bart Schaefer <schaefer@cse.ogi.edu>
  101. X.\"
  102. X.if n .ds Q \&"
  103. X.if n .ds U \&"
  104. X.if t .ds Q \&``
  105. X.if t .ds U \&''
  106. X.if n .ds - --
  107. X.if t .ds - \(em
  108. X.nh
  109. X.TH MUSH 1 "Apr 25, 1990" "Version 7.1.0"
  110. X.UC 4
  111. X.SH NAME
  112. XThe Mail User's Shell \- Shell for electronic mail.
  113. X.SH SYNOPSIS
  114. X.B mush
  115. X[
  116. X.B \-n
  117. X]
  118. X[
  119. X.B \-v
  120. X]
  121. X[
  122. X.B \-s
  123. Xsubject
  124. X]
  125. X[
  126. X.B \-c
  127. Xcc-list
  128. X]
  129. X[
  130. X.B \-b
  131. Xbcc-list
  132. X]
  133. X[
  134. Xaddress-list
  135. X]
  136. X.br
  137. X.B mush
  138. X[
  139. X.B \-n
  140. X]
  141. X[
  142. X.B \-v
  143. X]
  144. X[
  145. X.BR \-U [ ! ]
  146. X]
  147. X.B \-h
  148. Xdraft-file
  149. X.br
  150. X.B mush
  151. X[
  152. Xmode-options
  153. X]
  154. X[
  155. Xfile-options
  156. X]
  157. X.SH INTRODUCTION
  158. XThe Mail User's Shell (Mush) is an interface for sending and manipulating
  159. Xa database of electronic mail messages under the
  160. X.IR UNIX (TM)
  161. Xenvironment.
  162. XThere are three user interfaces that allow the user to interact with
  163. X.I Mush.
  164. XThe default interface is the conventional tty-based line mode
  165. Xsimilar to command line interpreters such as
  166. X.I csh
  167. Xas well as other mailers, such as University of California, Berkeley's
  168. X.I Mail
  169. Xand Bell Lab's System V
  170. X.I mailx
  171. Xinterface.
  172. XThis mode requires nothing from the terminal in terms of screen
  173. Xcapability and may be run on many different versions of the
  174. X.IR UNIX (TM)
  175. Xoperating system.
  176. X.PP
  177. XThe text-graphics
  178. X.RI ( curses )
  179. Xinterface is reminiscent of the
  180. X.I vi
  181. Xvisual editor, but is user-configurable to simulate other editors.
  182. XThis interface does not require graphics capabilities of
  183. Xthe computer or the terminal on which it is run, but the terminal must
  184. Xhave the minimum capabilities required by any visual screen editor.
  185. X.PP
  186. XThe
  187. X.I window
  188. Xinterface for the Sun Workstation utilizes the icon and
  189. Xmenu based (mouse selectable) windowing system.
  190. XThis
  191. X.I tool
  192. X(graphics) mode is highly subject to the version of operating system
  193. Xyour Sun may be running.
  194. XIt is intended to be run on Sun versions 3.5 and higher (those that have the
  195. XSunView window system).
  196. X.PP
  197. XSee the corresponding sections for more information on the user
  198. Xinterface desired.
  199. XMost of this manual deals with commands, variables
  200. Xand actions that are common to all three interfaces although
  201. Xsome attention is paid to individual characteristics of each interface.
  202. X.PP
  203. XThe following command line arguments are understood by
  204. X.I Mush
  205. X(full word forms in parentheses):
  206. X.TP
  207. X\-b bcc-list
  208. X(\-blindcarbon, \-blind)
  209. XThe list of Blind Carbon Copy recipients is set on the command line.
  210. XIf more than one address or an address containing spaces is specified, the
  211. Xentire list should be enclosed in quotes.
  212. XThis option applies when sending mail only.
  213. XIf you are entering the shell, curses mode, or the tool mode, this option is
  214. Xignored.
  215. X.TP
  216. X\-C
  217. X(\-curses)
  218. XEnter the mailer in curses mode upon startup.
  219. X.TP
  220. X\-c cc-list
  221. X(\-carbon, \-copy)
  222. XThe list of Carbon Copy recipients is set on the command line.
  223. XIf more than one address or an address containing spaces is specified, the
  224. Xentire list should be enclosed in quotes.
  225. XThis option applies when sending mail only.
  226. XIf you are entering the shell, curses mode, or the tool mode, this option is
  227. Xignored.
  228. X.TP
  229. X\-d
  230. X(\-debug)
  231. XTurns on the debugging level to 1.
  232. XYou can change debugging levels from within the shell using the
  233. X.B debug
  234. Xcommand.
  235. X.TP
  236. X\-e
  237. X(\-echo)
  238. XNormally, the program runs with the local echo off and each character
  239. Xtyped is processed individually so as to process certain macros and
  240. Xkeyboard mappings.
  241. XThis option will suppress this from taking place
  242. Xand the program will only process input after a carriage return has
  243. Xbeen hit.
  244. XUnder normal circumstances, this action is transparent to
  245. Xthe user and the use of this option is discouraged except when using
  246. Xa debugger with the program.
  247. XNote that if this option is specified,
  248. Xany key sequence set by map or map! will not take place.
  249. XThis option is ignored for curses mode.
  250. X.TP
  251. X\-F[!] filename
  252. X(\-source)
  253. XThis file is the same type as the initialization file read on startup
  254. X(see INITIALIZATION) with the exception that commands that manipulate
  255. Xor search messages may be given.
  256. XNormally, such commands may not appear in the initialization file since
  257. Xthat file is read before the folder is scanned.
  258. XThe file specified by \-F is read after the folder is scanned, so
  259. Xcommands that affect messages are allowed.
  260. XThe optional `!' argument prevents the shell from running after the
  261. Xfile has been sourced.
  262. XOtherwise,
  263. X.I Mush
  264. Xcontinues into whatever interface has been specified.
  265. X.TP
  266. X\-f [ filename ]
  267. X(\-folder)
  268. XThe optional filename argument specifies a folder containing mail messages.
  269. XWith no argument,
  270. X.B mbox
  271. Xin the current directory (or the variable
  272. X.BR mbox )
  273. Xis used.
  274. XIf no filename is given, this option must be last on the command line.
  275. X.TP
  276. X\-H[:c]
  277. X(\-headers)
  278. XHave
  279. X.I Mush
  280. Xdisplay mail headers without entering the shell.
  281. XSee the
  282. X.B headers
  283. Xcommand for information on the
  284. X.B :c
  285. Xargument.
  286. XNo colon modifier is equivalent to \*Q\-H:a\*U.
  287. XThis option prevents the shell from running, so this option will turn off the
  288. X\-S and \-C flags.
  289. XThis option is ignored if the tool mode is in effect.
  290. X.TP
  291. X\-h draft-file
  292. X(-draft)
  293. XThis option specifies a previously prepared message file (called a draft)
  294. Xwhich will be read in as a new message to be sent.
  295. XThe current implementation requires that the draft file must contain all the
  296. Xmessage headers;
  297. X.I Mush
  298. Xwill add only a new \*QDate:\*U and a \*QFrom:\*U header if there is none.
  299. XIf there is no \*QTo:\*U header, the draft will not be sent.
  300. XSee the
  301. X.B mail
  302. Xcommand and the section on \*QSending mail\*U for more information.
  303. X.TP
  304. X\-I[!] filename
  305. X(\-init)
  306. XThis option specifies an initialization file to be read
  307. X.I before
  308. Xany of the other
  309. X.I Mush
  310. Xinitialization is done.
  311. XThe file specified by \-I is read before the default system initialization
  312. Xfile is read (see the INITIALIZATION section for details).
  313. XThe optional `!' argument prevents
  314. X.I Mush
  315. Xfrom reading the default system file, so \-I! can be used to specify a
  316. Xsubstitute default file.
  317. XThe user's personal initialization file is read normally.
  318. X.TP
  319. X\-i
  320. X(\-interact)
  321. XForces interactive mode even if input has been redirected to the program.
  322. XThis is intended for remote host mail sessions (with -e) but also allows
  323. Xthe user to redirect input from a \*Qscript\*U of
  324. X.I Mush
  325. Xcommands.
  326. XSee the INITIALIZATION and MUSH SCRIPTS sections for information on how to
  327. Xwrite scripts that deal with mail.
  328. XNote that this flag is different from the \*Qignore\*U flag of UCB Mail.
  329. X.TP
  330. X\-m mailbox-path
  331. X(\-mailbox)
  332. XThe mailbox specified will be interpreted as if it were the user's main
  333. X(system) mailbox in place of /usr/spool/mail/$USER (or whatever path is
  334. Xapplicable for your system and Mail Transport Agent).
  335. X.TP
  336. X\-N
  337. X(\-noheaders)
  338. XEnter
  339. X.I Mush
  340. Xwithout displaying any message headers.
  341. XThis argument is passed to the
  342. X.B folder
  343. Xcommand.
  344. X.TP
  345. X\-n[!]
  346. X(\-noinit)
  347. XNo initialization is done on start up.
  348. XThat is, do not source the default system initialization files.
  349. XIf the `!' argument is given, reading of the user's personal
  350. X.I .mushrc
  351. Xor
  352. X.I .mailrc
  353. Xfiles is also suppressed.
  354. XSee the INITIALIZATION section for more information on
  355. Xstartup and the significance of these files.
  356. X.TP
  357. X\-r
  358. X(\-readonly)
  359. XInitialize the folder in Read-Only mode; no modification of the folder is
  360. Xpermitted.
  361. XThis argument is passed on to the
  362. X.B folder
  363. Xcommand.
  364. X.TP
  365. X\-S
  366. X(\-shell)
  367. XThis flag allows the user to enter the shell even if the system
  368. Xmailbox or specified folder is empty or doesn't exist.
  369. X.TP
  370. X\-s subject
  371. X(\-subject)
  372. XThe subject is set on the command line using this flag.
  373. XIf the subject has
  374. Xany spaces or tabs, the entire subject should be enclosed in quotes.
  375. XThis applies when sending mail only.
  376. XIf you are entering the shell,
  377. Xcurses mode, or the tool mode, this option is ignored.
  378. X.TP
  379. X\-T timeout
  380. X(\-timeout)
  381. XIn the tool mode (Sun only),
  382. X.I timeout
  383. Xspecifies the length of time (seconds) to wait between each check for new mail.
  384. X30 seconds is the smallest time allowed for performance reasons;
  385. X60 seconds is the default value.
  386. XThis option should be used either in place of \-t or immediately after it.
  387. X.TP
  388. X\-t
  389. X(\-tool)
  390. XUse the graphics tool mode (Sun only).
  391. XThis option must be the first one on the command line, before any Sun window
  392. Xsystem flags or other \fIMush\fR options.
  393. X.sp
  394. X.I
  395. XNOTE:  The \-t option is obsolete and may be eliminated in future revisions.
  396. XThe preferred way to run the tool mode of \fIMush\fR is to use the command
  397. X.BR mushtool ,
  398. Xwhich is a link to
  399. X.BR mush .
  400. X.TP
  401. X\-u [ user ]
  402. X(\-user)
  403. XThe mailbox to use is /usr/spool/mail/\fBuser\fR.
  404. XIf the login name for user is not specified, then root is used.
  405. X.TP
  406. X\-U[!]
  407. X(-send)
  408. XThis option may be used only with \-h (\-draft).
  409. XIt causes the draft file to be sent immediately without further editing
  410. X(\*Qunedited\*U, hence \-U).
  411. XIf the optional `!' is appended, signatures and fortunes are suppressed.
  412. XSee the
  413. X.B mail
  414. Xcommand and the section on \*QSending mail\*U for more information.
  415. X.TP
  416. X\-v
  417. X(\-verbose)
  418. XVerbose mode is turned on.
  419. XThis option is passed to the actual mail delivery
  420. Xsubsystem internal to your version of
  421. X.IR UNIX (TM).
  422. XSome mailers do not have a verbose option, so this flag may not apply
  423. Xto your system (System V, for example).
  424. XThis applies when sending mail only.
  425. XIf you are entering the shell,
  426. Xcurses mode, or the tool mode, this option is ignored.
  427. X.SH "GENERAL USAGE"
  428. XBecause there are three different interfaces available to the user,
  429. Xthe tty characteristics (backspace, kill-word, kill-line, redraw line)
  430. Xare simulated identically in all interfaces.
  431. XWhen the user has to type something, the 4.2BSD style of tty driver interface
  432. Xis simulated whether you're in the window system, the curses mode, or
  433. Xthe tty-line
  434. Xmode, and even on System-V machines.
  435. XThis means that backspacing causes a
  436. Xbackspace-space-backspace effect (erasing the character backspaced over).
  437. XThe user may reset his tty characteristics using the
  438. X.B stty
  439. Xcommand.
  440. X.PP
  441. X.IR "New mail" .
  442. X.PP
  443. XIf during a
  444. X.I Mush
  445. Xsession, new mail arrives for you, it is automatically incorporated into
  446. Xyour system mailbox and you are told that new mail has arrived.
  447. X.PP
  448. XIn the default line mode, new mail is checked between each command
  449. Xissued.
  450. XIn the curses mode, new mail is checked on each
  451. Xcommand and is displayed in the bottom line of the screen.
  452. XIn the tool based graphics mode, new mail is checked approximately
  453. Xevery minute or the number of seconds specified by the
  454. X.B -T
  455. Xoption on the command line.
  456. X.PP
  457. XIf you are using your system mailbox as your \*Qcurrent folder,\*U then the
  458. Xnew mail is added immediately to your current
  459. Xlist of messages and information similar to the following example is
  460. Xdisplayed, to tell you whom the mail is from:
  461. X.sp
  462. X.ti +2
  463. XNew mail: (#15) argv@zipcode.com (Dan Heller)
  464. X.sp
  465. XIf you are not in your system mailbox, then the new mail will not be added
  466. Xto your list of messages, but you will instead be informed of the new arrival.
  467. X.sp
  468. XIf you are using the tool based mode and
  469. X.I Mush
  470. Xis closed to an iconic state, then the number of messages in the current
  471. Xfolder is displayed on the mailbox icon and the flag on the mailbox will go up.
  472. X.PP
  473. X.IR "Displaying messages" .
  474. X.PP
  475. XDepending on the interface you use, you can display any message in your
  476. Xlist of messages as long as the message is not marked for deletion.
  477. XIf the message is marked as deleted, then use the 
  478. X.B undelete
  479. Xcommand supplied by the interface you are using.
  480. XTo display a message in line mode, specify the message using
  481. X.BR print ,
  482. X.BR type ,
  483. X.BR p ,
  484. X.BR t ,
  485. Xor type a message number to display that message on the screen.
  486. X.PP
  487. XIn curses mode, move the cursor over the message you want and type
  488. Xa `t' or `p' to read the message.
  489. XYou may \*Qbind\*U other keys to call
  490. Xthe function that displays messages if `t' and `p' are uncomfortable.
  491. X.PP
  492. XIn the tool mode, move the cursor over the header summary of the
  493. Xmessage you wish to be displayed and select the LEFT mouse button.
  494. XThe MIDDLE mouse button will delete the message, and the RIGHT button
  495. Xwill bring up a menu of additional options, including help.
  496. XIf the message you want is not visible (in the header subwindow), you may type
  497. Xthe number of the message in the \*QRange:\*U item, and press return.
  498. XThat message number will be displayed.
  499. XFinally, the \*QNext\*U item in the panel below the header display
  500. Xcan be used to step through the folder, one message at a time.
  501. X.PP
  502. XIn the line or curses mode, if the message has more lines than the variable
  503. X.BR crt ,
  504. Xthen a
  505. X.I pager
  506. Xwill be invoked to allow the user to page through the message without
  507. Xhaving it scroll off the screen.
  508. XThe pager used is determined by the variable
  509. X.BR pager .
  510. XIf that variable is unset, then a default pager will be used.
  511. XNote that if pager is set, but not to a value, or is set to the value
  512. Xof \*Qinternal\*U, then the internal pager is used.
  513. XThe internal pager
  514. Xis very simple; the spacebar displays the next
  515. X.B crt
  516. Xlines, carriage return prints the next line, and \*Qq\*U quits the pager.
  517. X.PP
  518. XIn the tool mode, if a message is larger than the size of the message
  519. Xsubwindow, the scrollbar at the left side of the window may be used to
  520. Xpage the message forwards and backwards.
  521. XThe variable
  522. X.B crt_win
  523. Xmay be set in an initialization file to preset the size of the
  524. Xmessage display subwindow.
  525. X.PP
  526. XAn alternative to displaying messages is the
  527. X.B top
  528. Xcommand.
  529. XThis command will print just the top few lines of a message.
  530. XThe number of lines is determined by the variable
  531. X.BR toplines .
  532. XIf this variable isn't set,
  533. X.B top
  534. Xwill print a number of lines equal to the value of the variable
  535. X.BR crt .
  536. X.PP
  537. X.IR "Sorting mail" .
  538. X.PP
  539. X.I Mush
  540. Xallows you to sort your mail according to various constraints such
  541. Xas time, size, status (new, unread, deleted, etc.), author and subject.
  542. XSee the
  543. X.B sort
  544. Xcommand in the COMMANDS section for more information on sorting.
  545. XSorting has a panel item in the tool mode, and is bound by default
  546. Xto the `o' (sort) and `O' (sort reverse) keys in curses mode.
  547. X.PP
  548. X.IR "Picking specific messages" .
  549. X.PP
  550. XYou can select messages that contain unique information, or from
  551. Xmessages that have special attributes.
  552. XYou have the option of restricting your search to messages between dates,
  553. Xmessage numbers, author names and other constraints.
  554. XSee the
  555. X.B pick
  556. Xcommand in the COMMANDS section for complete details.
  557. XThis feature is not directly accessible from the tool mode, and is
  558. Xavailable only as a search action in curses mode (see, however, the
  559. XCURSES INTERFACE section for temporary escapes to line mode).
  560. X.PP
  561. X.IR "Sending mail" .
  562. X.PP
  563. XYou can send mail by listing addresses on the command line when
  564. X.I Mush
  565. Xis started, by using the
  566. X.B mail
  567. Xcommand from within
  568. X.IR Mush ,
  569. Xor by responding to other mail.
  570. XIn curses mode, the `m' key invokes mail, and the `r' key begins a response.
  571. XIn the tool mode, selecting the \*QCompose\*U or \*QReply\*U items on the main
  572. Xpanel will open a separate frame for message composition.
  573. XThe message replied-to is either the current message or one specified in
  574. Xthe \*QRange:\*U item.
  575. X.PP
  576. XWhen you are sending mail, you are in a mode where everything
  577. Xyou type is added to the contents of the message.
  578. XWhen you are done typing your message in line or curses modes,
  579. Xyou can type `^D' (control-D) to signify the end of the message.
  580. XIf you have the variable
  581. X.B dot
  582. Xset, then you can end a message with a `.' on a line by itself.
  583. XIn the tool mode, select the \*QSend\*U item in the composition frame
  584. Xto finish and send the message.
  585. X.PP
  586. XWhile you are composing a message,
  587. X.I Mush
  588. Xtreats lines beginning with the character `~' specially.
  589. XThis is called a
  590. X.BR "tilde escape" .
  591. XFor instance, typing \*Q~i\*U (alone on a line) will place a copy
  592. Xof the \*Qcurrent message\*U into your message body.
  593. XIt will not include the message headers of the message, just the body of text
  594. Xthat comprises the message.
  595. XA subset of these escapes are available in the tool mode, and others are
  596. Xprovided as panel items or as menu selections from the \*QInclude\*U item.
  597. XTilde escapes which alter message headers are not usable when the variable
  598. X.B edit_hdrs
  599. Xis set or when the \-E option was passed to the
  600. X.B mail
  601. Xcommand.
  602. X.PP
  603. XThe tool mode composition window uses header editing at all times, but
  604. Xprovides some of these escapes anyway; see the descriptions below, and the
  605. Xdescription of the
  606. X.B edit_hdrs
  607. Xvariable, for complete details.
  608. X.PP
  609. XAvailable
  610. X.BR "tilde escapes" :
  611. X[OPTIONAL arguments in square brackets]
  612. X.TP
  613. X~a file
  614. XAppend message buffer to file name.
  615. XAccessed via the \*QExport\*U panel item in tool mode.
  616. X.TP
  617. X~b [bcc-list]
  618. XModify blind carbon recipients; otherwise identical to ~t.
  619. XIn tool mode, moves the cursor to the Bcc: header, adding one if necessary.
  620. X.TP
  621. X~c [cc-list]
  622. XModify carbon copy recipients; otherwise identical to ~t.
  623. XIn tool mode, moves the cursor to the Cc: header, adding one if necessary.
  624. X.TP
  625. X~E[!]
  626. XErase message buffer; not available in tool mode.
  627. XSaves the contents of the letter to \*Qdead.letter\*U
  628. X(unless the `!' is specified) and then clears the message buffer; the user
  629. Xremains in editing mode.
  630. XIf the variable
  631. X.B nosave
  632. Xis set, then `!' need not be specified.
  633. X.TP
  634. X~e [editor]
  635. XEnter the editor.
  636. XDefaults to variable
  637. X.BR editor ,
  638. Xenvironment EDITOR, or
  639. X.IR vi ,
  640. Xexcept in tool mode, where ~e is equivalent to ~v.
  641. X.TP
  642. X~F[!]
  643. XAdd a fortune [don't add] at end of message.
  644. XAccessed via the \*QFortune\*U panel item in tool mode.
  645. X.TP
  646. X~f [msg-list]
  647. XForward mail.
  648. XThe included messages are not indented,
  649. Xbut are marked as \*Qforwarded mail\*U.
  650. XAccessed via the \*QInclude\*U panel item in tool mode.
  651. X.TP
  652. X~h
  653. XModify all message headers.
  654. XEach header is displayed one by one and each may be edited.
  655. XIn tool mode, moves to the To: header; typing a carriage return will
  656. Xadvance the input cursor to each of the other headers in turn.
  657. XThe mouse cursor will change to a \*Qbent arrow\*U when automatic
  658. Xinput cursor advance is active.
  659. X.TP
  660. X~I [msg-list]
  661. XSame as ~i, but also include the message headers.
  662. XAccessed via the \*QInclude\*U panel item in tool mode.
  663. X.TP
  664. X~i [msg-list]
  665. XInclude the body of the current message (or listed messages).
  666. XAccessed via the \*QInclude\*U panel item in tool mode.
  667. XSee the descriptions of the variables
  668. X.BR indent_str ,
  669. X.BR pre_indent_str ,
  670. Xand
  671. X.BR post_indent_str .
  672. X.TP
  673. X~p [pager]
  674. XPage the message body; not available in tool mode.
  675. XDefaults to variable
  676. X.BR pager ,
  677. Xenvironment PAGER, or the default pager set up by the system administrator.
  678. XThis may be the internal pager.
  679. X.TP
  680. X~q
  681. XQuit message; save in ~/dead.letter if
  682. X.B nosave
  683. Xis not set.
  684. XNot available in tool mode.
  685. X.TP
  686. X~r file
  687. XRead filename into message buffer.
  688. XAccessed via the \*QImport\*U panel item in tool mode.
  689. X.TP
  690. X~S[!]
  691. XInclude [don't include] signature at end of message.
  692. XThe variables
  693. X.B autosign
  694. Xand
  695. X.B autosign2
  696. Xdescribe the file or string to append to the message.
  697. XSee the VARIABLES section for more information on these variables.
  698. XAccessed via the \*QAutosign\*U panel item in tool mode.
  699. X.TP
  700. X~s [subject]
  701. XModify the subject header.
  702. XIn tool mode, moves to the Subject: header, adding one if necessary.
  703. XIn other modes,
  704. Xif an argument is given (a new subject), then the subject line is
  705. X.I replaced
  706. Xby the new subject line.
  707. XIf none is given, then the subject line is
  708. Xdisplayed for editing just as in the ~t command.
  709. X.TP
  710. X~t [list]
  711. XChange list of recipients (\*QTo\*U list).
  712. XIn tool mode, moves the cursor to the To: header.
  713. XIn other modes,
  714. Xif a list is given, this list is
  715. X.B appended
  716. Xto the current list.
  717. XIf no list is given, then the current list
  718. Xis displayed and the cursor placed at the end of the list.
  719. XYou can backspace over the stuff in the list or you can append more
  720. Xaddresses onto the end of the list as desired.
  721. X.TP
  722. X~u
  723. XUp one line; not available in tool mode.
  724. XIf the user made a mistake typing a letter and he
  725. Xhas already hit carriage return, he may avoid entering the editor
  726. Xand edit the previous line using ~u.
  727. XThe line is retyped and
  728. Xthe cursor is placed at the end allowing the user to backspace
  729. Xover it and retype the line.
  730. XSystem-V users should note that if
  731. Xthe new line is shorter than it was before the ~u command, the
  732. Xline is padded with blanks to the previous length of the file.
  733. X.TP
  734. X~v [editor]
  735. XEnter the visual editor; works in tool mode.
  736. XAlso accessible through the \*QEdit\*U button in tool mode.
  737. XDefaults to variable
  738. X.BR visual ,
  739. Xenvironment VISUAL, or
  740. X.IR vi .
  741. X.TP
  742. X~w file
  743. XWrite message buffer to the indicated file.
  744. XAccessible in tool mode via the \*QExport\*U panel item.
  745. XWhen the header editing is in use (the variable
  746. X.B edit_hdrs
  747. Xor the \-E option of
  748. X.BR mail ),
  749. Xthis tilde-command can be used to create a \fIdraft file\fR.
  750. XDraft files are partially completed letters that you wish to save for
  751. Xediting and eventually sending later.
  752. XSee the
  753. X.B mail
  754. Xcommand for a description of rereading and sending drafts.
  755. X.TP
  756. X~x
  757. XExit message; don't save in dead.letter.
  758. XAccessible in tool mode via the \*QAbort\*U panel item.
  759. X.TP
  760. X~$variable
  761. XInsert the string value for variable into message; not available in tool mode.
  762. XIf a boolean variable is listed, nothing is appended regardless of its value.
  763. X.TP
  764. X~:command
  765. XRun the
  766. X.I Mush
  767. Xcommand specified by \*Qcommand\*U; not available in tool mode.
  768. XYou may not run any command that sends mail.
  769. XIt is inadvisable to change folders at this time
  770. Xsince the current message list may be corrupted, but the action is
  771. Xallowed nonetheless to provide flexibility for experienced users.
  772. X.TP
  773. X~~
  774. XA line beginning with two escape characters will be unaffected by
  775. X.I Mush
  776. Xexcept that only a single tilde will be inserted into the letter.
  777. X.PP
  778. XThe variable
  779. X.B escape
  780. Xmay be set to describe a character other than `~' to be used as the
  781. Xescape character.
  782. XHowever,
  783. X.I "tilde escapes are normally NOT interpreted when"
  784. XMush
  785. X.IR "is started with redirected input" .
  786. XIf tilde-interpretation is desired, use the \-i option when starting
  787. X.IR mush .
  788. X.PP
  789. X.IR "Mail Aliases" .
  790. X.PP
  791. XMail aliases are shorthand names for long mail addresses.
  792. XThese are supported in the same manner as UCB Mail supports them.
  793. XBecause
  794. X.I Mush
  795. Xhas command line history reminiscent of
  796. X.IR csh ,
  797. Xcommands that use UUCP's `!' character for user-host and host-host
  798. Xseparation should be escaped (preceded by a backslash).
  799. XThis is not necessary in the initialization file (.mushrc) because history
  800. Xreferencing is ignored while these files are being sourced.
  801. XSee the INITIALIZATION and LINE-MODE INTERFACE sections for more
  802. Xinformation on initialization file format and the history mechanism.
  803. X.PP
  804. XAliases reference normal mailing addresses as well as other aliases.
  805. XIf a loop is detected, then the user will be notified and the message will
  806. Xbe forced into the file
  807. X.B dead.letter
  808. Xin the user's home directory.
  809. XThe
  810. X.B unalias
  811. Xcommand is used to reverse the effects of the
  812. X.B alias
  813. Xcommand.
  814. XFrom the tool mode, aliases can be set and unset in an
  815. X.IR "aliases subwindow" .
  816. XPress the RIGHT mouse button on the \*QOptions\*U item in the main
  817. Xframe, and select \*QAliases\*U from the menu.
  818. X.PP
  819. X.IR Help .
  820. X.PP
  821. X.I Mush
  822. Xwas designed so that each command or action should not be a mystery.
  823. XHelping the user understand what to do and how to do whatever he wishes
  824. Xis the goal behind the help facility.
  825. XFor this reason, the
  826. X.B help
  827. Xcommand gives information on both general usage and a few specific help
  828. Xcategories.
  829. X.PP
  830. XIn text mode, most help is gotten by typing \-? as an argument to a
  831. Xcommand.
  832. XAlmost every command has the \-? option.
  833. XWhen this option is specified, most commands will attempt to read from
  834. Xa help file a brief explanation of the functionality of the command.
  835. XIf necessary, a pointer to other sources of information will
  836. Xbe given to fully explain a concept.
  837. X.PP
  838. XIn line mode, typing `?' as a command will display a list of possible commands.
  839. XIn the curses mode, the `?' key will display help message, which explains
  840. Xhow to obtain a list of the current key-to-command bindings; a keystroke
  841. Xor set of keystrokes correspond directly to a command.
  842. X.PP
  843. XIn the tool mode, this is
  844. Xalso available, but more extensive help is provided in the pop-up menus.
  845. XPress the RIGHT mouse button (the \*Qmenu button\*U) when pointing to any
  846. Xpanel button and a number of items will appear in a menu.
  847. XThe last command in the menu list will often be one labelled \*Qhelp\*U.
  848. XIf a button does not have a menu or has no help item, check the
  849. Xmenu of the \*QHelp\*U button for related topics.
  850. XSelecting any help item will open a new scrollable window with help text.
  851. X.I "Note:  The limited number of file descriptors in SunOS 3.5 forces"
  852. XMush
  853. X.I "to display help information in the"
  854. X.IR "message window in the main frame" .
  855. X.\" Some nroffs can't handle long .IR arguments
  856. X.SH INITIALIZATION
  857. XAfter the command line arguments have been interpreted
  858. X.I Mush
  859. Xwill read commands from one or more
  860. X.B "initialization files"
  861. Xthat (typically) set variable values, aliases, command line aliases,
  862. Xand so forth.
  863. XAny file specified by the \-I option is read first.
  864. XNext, if neither \-I! nor \-n was given, a default system initialization
  865. Xfile is read.
  866. XThe system default file
  867. Xis set up by the system administrator and may contain commands that
  868. Xshould be set system-wide.
  869. XFinally, if \-n! was not given,
  870. X.I Mush
  871. Xreads the user's personal initialization file.
  872. X.PP
  873. XThe user's file is determined by first looking for the environment variables
  874. X.I MUSHRC
  875. Xor
  876. X.IR MAILRC .
  877. XIf neither of those environment variables is set, then the file
  878. X.I .mushrc
  879. Xis searched for in the home directory of the user.
  880. XIf that file cannot be found,
  881. X.I Mush
  882. Xwill attempt to read the file
  883. X.I .mailrc
  884. Xfrom the same directory.
  885. XFinally, if that file cannot be read, no initialization is done
  886. Xand the default values will be in effect.
  887. X.PP
  888. XIf the user has no home directory, or permissions prevent read/write access
  889. Xto $HOME, /tmp is used as the home directory.
  890. XSee the
  891. X.B home
  892. Xvariable under the VARIABLES section.
  893. X.PP
  894. XOnce in the shell, the
  895. X.B source
  896. Xcommand may be used to specify a file if you want to read commands
  897. Xfrom a file other than the default.
  898. XThe command
  899. X.B saveopts
  900. Xwill save all variable settings, aliases, and all other
  901. X.I Mush
  902. Xsettable attributes, to aid in creating an initialization file.
  903. XIf no filename is given on the command line,
  904. Xthe
  905. X.B source
  906. Xand
  907. X.B saveopts
  908. Xcommands choose a file in the manner described above.
  909. X.B Saveopts
  910. Xwill not overwrite the file if it exists.
  911. XIn such cases, you will be prompted to confirm overwrite.
  912. XIf you confirm overwriting the existing file, remember that existing \*Qif\*U
  913. Xexpressions or other manually entered comments or non variable-setting type
  914. Xcommands that previously existed in the file will be lost.
  915. X.PP
  916. XNo interactive commands should be called from any initialization file.
  917. XThese commands are not prevented because it is impossible to trace which
  918. Xcommands are actually
  919. X.IR UNIX (TM)
  920. Xcommands that will be interactive.
  921. XThe responsibility of not running interactive commands is left to the user.
  922. XBecause the initialization file is read
  923. X.I before
  924. Xany messages are read into the program,
  925. Xmessage filtering commands should not be placed in this file unless you know
  926. Xyou're going to
  927. X.IB re- source
  928. Xthe file later as a command.
  929. X.PP
  930. X.IR "Initialization File Format" .
  931. XWhen reading the initialization file,
  932. X.I Mush
  933. Xwill recognize the `#' character as a comment character.
  934. XIt may be anywhere on a line in the file.
  935. XWhen that character is encountered,
  936. Xprocessing of that line is discontinued to the end of the line.
  937. XIf the `#' is enclosed in quotes (single or double), then it is not
  938. Xconsidered a comment.
  939. XExamples:
  940. X.sp
  941. X.ti +2
  942. Xset shell = /bin/csh  # set the shell variable
  943. X.ti +2
  944. X# this entire line has been commented out.
  945. X.ti +2
  946. Xset prompt = "Message #%m: "  # The `#' is within quotes
  947. X.PP
  948. XThe
  949. X.B exit
  950. Xcommand has special meaning in the initialization file.
  951. XIf the command is found,
  952. X.I Mush
  953. Xwill not exit, but rather, discontinue reading from the file immediately.
  954. X.PP
  955. XThere may be \*Qif\*U expressions within the initialization file to determine
  956. Xcertain runtime states of
  957. X.IR Mush .
  958. XNo parentheses are allowed and only one boolean expression may be
  959. Xevaluated per line; that is, no \*Q&&\*U or \*Q|\||\*U may be used in
  960. Xexpressions.
  961. XAn \*Qelse\*U on a line by itself may precede alternative
  962. Xactions.
  963. X\&\*QIf\*U expressions may be nested to any reasonable depth, but
  964. Xthere must always be an \*Qendif\*U matching each \*Qif\*U expression.
  965. XThe statements associated with an \*Qif\*U expression are never on the
  966. Xsame line with the conditional expression.
  967. X.PP
  968. XConditional expressions understood include the internal variables
  969. X.IR istool ,
  970. X.IR iscurses ,
  971. X.IR is_shell ,
  972. X.IR hdrs_only ,
  973. X.IR is_sending ,
  974. Xand
  975. X.IR redirect .
  976. XThese are internal variables whose values cannot be referenced using the
  977. X\*Q$variable\*U method of variable expansion.
  978. XIf
  979. X.I istool
  980. Xis true, the program is going to run in the tool mode.
  981. XIf
  982. X.I iscurses
  983. Xis true, the program is in or is going to run in the curses mode even
  984. Xthough the screen package may not yet have been started.
  985. XIf
  986. X.I is_shell
  987. Xis true, then
  988. X.I Mush
  989. Xhas entered the shell;
  990. X.I is_shell
  991. Xis always false at startup when initialization files are read,
  992. Xand is always true when files are sourced after initialization with the
  993. X.B source
  994. Xcommand or the \-F option.
  995. X.PP
  996. XIf
  997. X.I hdrs_only
  998. Xis true, then the -H flag on the command line has been given.
  999. XIf
  1000. X.I is_sending
  1001. Xis true, then the user is sending mail to another user.
  1002. XThis does not imply
  1003. Xthat the user is not going to be running a shell after the mail is sent.
  1004. XIf
  1005. X.I redirect
  1006. Xis true, then input to the program is redirected.
  1007. XThe test for redirection tells whether input, not output, has been
  1008. Xredirected to the program.
  1009. XThe
  1010. X.B \-i
  1011. Xoption on the command line is required to run the shell if redirect is on.
  1012. XIf \-i is specified, the value for
  1013. X.I redirect
  1014. Xwill be set to false.
  1015. XNote that any time
  1016. X.I Mush
  1017. Xruns when not connected to a terminal, it will
  1018. Xbelieve that input has been redirected.
  1019. XSee the MUSH SCRIPTS section for more details.
  1020. X.PP
  1021. XThe `!' operator may be used to negate expressions, thus,
  1022. X.sp
  1023. X.nf
  1024. X.in +2
  1025. Xif !istool
  1026. X.ti +4
  1027. Xexit
  1028. Xelse
  1029. X.ti +4
  1030. Xset autoprint
  1031. Xendif
  1032. X.in -2
  1033. X.fi
  1034. X.sp
  1035. Xmeans that if you are not running as a tool, stop reading commands from this
  1036. Xfile.
  1037. XOtherwise, set the autoprint variable.
  1038. X.sp
  1039. X.in +2
  1040. X.nf
  1041. Xset hdr_format = "%25f %7d (%l/%c) %25s"
  1042. Xif hdrs_only
  1043. X.ti +4
  1044. Xexit
  1045. Xendif
  1046. X.in -2
  1047. X.fi
  1048. X.sp
  1049. XThis tells the program to set the hdr_format variable and check to see if
  1050. Xwe're running the program to read headers only.
  1051. XIf so, stop reading this file (exit) and continue on with the program.
  1052. XThis speeds up runtime quite a bit for those who have lengthy initialization
  1053. Xfiles, because no other shell variables are necessary.
  1054. X.sp
  1055. X.in +2
  1056. X.nf
  1057. Xif !iscurses
  1058. X.ti +4
  1059. Xset crt = 24 screen = 18
  1060. Xendif
  1061. X.in -2
  1062. X.fi
  1063. X.sp
  1064. XThis segment checks to see that we're not running in curses mode, and if not
  1065. Xit will set our crt and screen sizes.
  1066. XThis is mostly because the curses mode will set those values for us by looking
  1067. Xat the size of the screen.
  1068. XSee the CURSES INTERFACE section for configuring your
  1069. Xenvironment so you enter curses mode each time you run the shell.
  1070. X.PP
  1071. XString evaluation is allowed in \*Qif\*U expressions, and the operators
  1072. X\*Q==\*U and \*Q!=\*U may be used to determine equality or inequality,
  1073. Xand \*Q=~\*U and \*Q!~\*U may be used for pattern-matching.
  1074. XUsually, variables are compared with constants for evaluation.
  1075. X.PP
  1076. XNote that it is not possible to compare variables to an empty string, and
  1077. Xvariables that evaluate to an empty string may cause errors.
  1078. XIt is possible to test whether a variable is set by using the syntax
  1079. X\*Q$?variable\*U (as in
  1080. X.IR csh )
  1081. Xbut there is not currently any way to test for an empty string value.
  1082. X.sp
  1083. X.in +2
  1084. X.nf
  1085. Xif $TERM == adm3a
  1086. X.ti +4
  1087. Xset pager = more
  1088. Xelse
  1089. X.ti +4
  1090. Xset pager = less
  1091. Xendif
  1092. X.in -2
  1093. X.fi
  1094. X.sp
  1095. XThis segment tests to see if the user's terminal type is \*Qadm3a\*U.
  1096. XIf it is, then it sets the pager variable to be the 
  1097. X.I more
  1098. Xprogram.
  1099. XNote that the variable TERM will be gotten from the user's environment if a
  1100. Xshell variable is not set already.
  1101. XOtherwise, the pager variable is set to \*Qless\*U.
  1102. XThis exemplifies the fact that
  1103. X.I less
  1104. Xfrequently fails to function correctly
  1105. Xfor the terminal type \*Qadm3a\*U so we don't use it.
  1106. X.sp
  1107. XAlso supported in \*Qif\*U expressions are the test flags \*Q-e\*U
  1108. Xand \*Q-z\*U.  These flags test to see if a file exists (\*Q-e\*U) or
  1109. Xif it is zero-length (\*Q-z\*U).
  1110. XThese are most useful in command files that are to be read after the
  1111. Xshell has started; see the examples in the MUSH SCRIPTS section.
  1112. X.PP
  1113. XAfter sourcing the initialization file,
  1114. X.I Mush
  1115. Xreads all the mail out of the specified folder (the system spool directory
  1116. Xif no folder is given) and creates a list of messages.
  1117. XThe current maximum number of messages the user
  1118. Xcan load is set to 1000 by default.
  1119. XThe system administrator who configures the program can reset this
  1120. Xvalue higher or lower if you ask nicely.
  1121. XIf the user has the
  1122. X.B sort
  1123. Xvariable set, then when the current folder's messages have all been read,
  1124. Xthe messages are sorted according to the value of the
  1125. Xvariable (see the
  1126. X.B sort
  1127. Xentry under the VARIABLES heading for more information).
  1128. XEach message has a number of message header lines that contain information
  1129. Xabout whom the mail is from, the subject of the message, the date it was
  1130. Xreceived, and other information about the letter.
  1131. XThis information is then compiled into a one-line summary for
  1132. Xeach message and is printed out in an appropriate manner
  1133. Xdepending on the interface you're using.
  1134. X.PP
  1135. XAt this point, commands may be input by the user.
  1136. XLengthy or complex commands can be placed in a file and then executed via the
  1137. X.B source
  1138. Xcommand.
  1139. XSuch files use the same format as the initialization files and may use all
  1140. Xthe same tests in \*Qif\*U expressions.
  1141. XSourcing of a file of filter commands such as those in the example above
  1142. Xcan be automated by using the \-F option when \fIMush\fR is started.
  1143. XAlso see the MUSH SCRIPTS section for other uses.
  1144. X.SH "LINE-MODE INTERFACE"
  1145. XIn the line-mode, the user is given a prompt to which commands are issued
  1146. Xand arguments are passed to commands.
  1147. XWhen the user types at the prompt, each line is parsed and words (or
  1148. Xarguments) are separated into an array of strings.
  1149. XThis array, also called an
  1150. X.IR "argument vector" ,
  1151. Xis then modified by expanding history references, command line aliases,
  1152. Xand variable references.
  1153. XA command line ends when the end of the line is encountered or a pipe (|)
  1154. Xor semicolon (;) character is encountered, separating discrete commands.
  1155. X.PP
  1156. XWhen a command line has been parsed and placed in an argument vector, the
  1157. Xfirst argument in the vector (the \*Qcommand\*U) is searched for in a list
  1158. Xof legal
  1159. X.I Mush
  1160. Xcommands.
  1161. XIf found, the function associated with that command is called and
  1162. Xthe rest of the line is passed to that function as
  1163. X.IR "command line arguments" .
  1164. X.PP
  1165. XBefore commands are called, however, the input the user gives is preprocessed
  1166. Xin a style reminiscent of the C-shell
  1167. X.RI ( csh ).
  1168. X.I Mush
  1169. Xalso supports a subset from each of the following aspects of
  1170. X.IR csh :
  1171. X.in +2
  1172. X\(bu Command history.
  1173. X.br
  1174. X\(bu Command line aliasing.
  1175. X.br
  1176. X\(bu \*QPiping\*U mechanism to
  1177. Xredirect \*Qinput\*U and \*Qoutput\*U of commands.
  1178. X.br
  1179. X\(bu Filename metacharacters.
  1180. X.in -2
  1181. X.PP
  1182. X.BR "Command history" .
  1183. X.PP
  1184. X.I Mush
  1185. Xsupports a history mechanism similar to that supplied by
  1186. X.IR csh .
  1187. XA subset of
  1188. X.I csh
  1189. Xhistory modifiers are supported to reference previously
  1190. Xissued commands and to extract specified arguments from these commands.
  1191. X.PP
  1192. XThe history mechanism remembers a list of past commands whose length is
  1193. Xbounded by the value of the
  1194. X.B history
  1195. Xvariable.
  1196. XIf this variable is not set, only the most recent command is remembered.
  1197. XTo reference previously typed commands, the `!' character
  1198. Xis used in the same manner as in
  1199. X.IR csh .
  1200. XThere is a limited implementation of history modification;
  1201. Xsupported are the argument selectors that reference
  1202. Xcommand line arguments and \*Q:p\*U (echo, but don't execute the command).
  1203. X.sp
  1204. XExamples:
  1205. X.nf
  1206. X.in +2
  1207. X.ta 1i
  1208. X!-2:$    two commands ago, last argument.
  1209. X!3:2-4    the third command, arguments two through four.
  1210. X!!:p    print the last command in its entirety.
  1211. X.in -2
  1212. X.fi
  1213. X.PP
  1214. XDuring the sourcing of initialization files (.mushrc), history is not
  1215. Xin effect and therefore the `!' character does not cause history expansion.
  1216. XThis includes startup of the program and when the command
  1217. X.I source
  1218. Xis issued.
  1219. XUUCP style addresses that contain the `!' character may be given in the
  1220. Xinitialization file without the need to be preceded by a backslash.
  1221. XHowever, `!' does need to be escaped if
  1222. X.BR cmd 's
  1223. Xare used to reference command line arguments.
  1224. X.PP
  1225. X.BR "Command line aliasing" .
  1226. X.PP
  1227. XCommand aliases are different from mail aliases in that they are used
  1228. Xto expand to commands.
  1229. XThis feature enables command substitution similar to
  1230. X.IR csh .
  1231. XTo be backwards compatible with UCB Mail, the
  1232. X.B alias
  1233. Xcommand is used for address aliasing.
  1234. XThus, the command
  1235. X.B cmd
  1236. Xis introduced in place of
  1237. X.BR alias .
  1238. X.PP
  1239. XExamples:
  1240. X.nf
  1241. X.in +2
  1242. Xcmd d delete
  1243. Xcmd t type
  1244. Xcmd dt 'd ; t'
  1245. Xcmd - previous
  1246. Xcmd r 'reply \\!* -e -i'
  1247. X.in -2
  1248. X.fi
  1249. X.sp
  1250. XIn the last example, if the user types \*Qr 5\*U,
  1251. X.I Mush
  1252. Xwill reply to sender of the fifth message and pass all the other
  1253. Xarguments along to the
  1254. X.B reply
  1255. Xcommand.
  1256. XNote the escaping of the `!' character.
  1257. XThis must also be done if set in the initialization file (.mushrc).
  1258. XHad the user not specified a message number on the `r' command line,
  1259. X.B reply
  1260. Xwould respond to the \*Qcurrent message\*U rather than the fifth message.
  1261. X.PP
  1262. X.BR "Piping commands" .
  1263. X.PP
  1264. X.I Mush
  1265. Xcommands can be \*Qpiped\*U to one another so as to provide output of
  1266. Xone command to be used as input to the next command in the pipeline.
  1267. XHowever, the output of commands is not the \*Qtext\*U that is returned
  1268. X(as it is in
  1269. X.I sh
  1270. Xand
  1271. X.IR csh ),
  1272. Xbut instead is a
  1273. X.B "message list"
  1274. Xof the messages that were affected.  A
  1275. X.B "message list"
  1276. Xis defined as the set of messages that the user specifies in a command or
  1277. Xthe messages a command affects after it is through executing.
  1278. XWhen one command is piped to another, the effect is that the second command
  1279. Xwill consider only those messages affected by the first command.
  1280. XIn most cases,
  1281. X.I Mush
  1282. Xis smart enough to know when piping is occurring and may suppress text output
  1283. Xthat a command might produce.
  1284. X.PP
  1285. XExamples:
  1286. X.sp
  1287. X.ti +2
  1288. Xpick -f fred | save fred_mail
  1289. X.sp
  1290. XThis will find all the messages from \*Qfred\*U
  1291. Xand save them all in the file named fred_mail.
  1292. X.sp
  1293. X.ti +2
  1294. Xlpr 4-8 | delete
  1295. X.sp
  1296. XThis will send messages 4, 5, 6, 7, and 8 to the printer and then delete them.
  1297. X.sp
  1298. X.ti +2
  1299. Xheaders :o | delete
  1300. X.sp
  1301. XDeletes all old (already read) mail.
  1302. X.PP
  1303. XBecause action is taken on mail messages, not files,
  1304. Xmetacharacters such as `*' and `?' are not expanded to file names as
  1305. X.I csh
  1306. Xwould do.
  1307. XInstead,
  1308. X.I Mush
  1309. Xcommands take
  1310. X.I "message lists"
  1311. Xas arguments (a list references one or messages) to take action upon.
  1312. XWhen referencing message numbers,
  1313. X.I Mush
  1314. Xunderstands the following special syntax:
  1315. X.sp
  1316. X.in +2
  1317. X.nf
  1318. X.ta 1.0i
  1319. X*    All messages
  1320. X^    The first message
  1321. X$    The last message
  1322. X\&.    The current message
  1323. XN\-M    A range of messages between N and M, inclusive
  1324. X.sp
  1325. X.fi
  1326. X.in -2
  1327. XIn the last case, N and M may be * ^ $ . or digits referencing
  1328. Xexplicit message numbers.
  1329. XThe range must be in ascending order.
  1330. X.sp
  1331. XYou can also negate messages by placing the message list inside
  1332. Xbraces, `{' `}' \*- thus, the expression \*Q2-19 {11-14}\*U references
  1333. Xmessages 2 through 19 except for messages 11 through 14.
  1334. X.sp
  1335. XNote that message lists are parsed left to right.
  1336. XNegated messages may be reset by turning them on
  1337. Xagain later in the argument list.
  1338. XA common error new users make is to specify a negated list without
  1339. Xspecifying any beginning messages.
  1340. X.sp
  1341. X.ti +2
  1342. Xdelete { 6 }
  1343. X.sp
  1344. XIn this example, the user attempted to delete all messages
  1345. Xexcept for number 6.
  1346. XHe should have specified `*' beforehand.
  1347. XA correct example:
  1348. X.sp
  1349. X.ti +2
  1350. Xpreserve ^-. { 3 }
  1351. X.sp
  1352. XHere, the user specifies a valid message list and causes
  1353. X.I Mush
  1354. Xto preserve all messages from the beginning of the list (message 1)
  1355. Xto the current message, excluding message 3.
  1356. X.PP
  1357. XAs discussed, after the command line is parsed, the command given is
  1358. Xcalled and the rest of the arguments on the command line are passed to it.
  1359. XIf no
  1360. X.I Mush
  1361. Xcommand has been found that matches the one given, then the variable
  1362. X.B unix
  1363. Xis checked.
  1364. XIf it is set,
  1365. X.I Mush
  1366. Xattempts to run the command line as a
  1367. X.IR UNIX (TM)
  1368. Xcommand.
  1369. X.PP
  1370. XIf
  1371. X.B unix
  1372. Xis not set, or if the command could not be found in the user's PATH
  1373. Xenvironment, a message will be printed indicating that the command was
  1374. Xnot found.
  1375. X.PP
  1376. XSince no \*Qmessages\*U are affected by \fIUNIX\fR
  1377. Xcommands, those that appear within \fIMush\fR
  1378. Xpipelines are executed by the \fBpipe\fR command.
  1379. XA \fIUNIX\fR command may never be the first command in a pipeline
  1380. Xunless the \fBpipe\fR command is used explicitly.
  1381. XIf the user wishes to execute \fIUNIX\fR
  1382. Xcommands that are to be piped to one another (or use any sort of redirection),
  1383. Xthe command \fBsh\fR is provided for such purposes.
  1384. XSince \fIMush\fR will parse the entire command line, caution should be
  1385. Xtaken to enclose questionable shell variables or metacharacters with
  1386. Xquotes to prevent \fIMush\fR from expanding them.
  1387. XSee the COMMANDS heading below for more detail.
  1388. X.PP
  1389. XThis shell-like quality is for the convenience of the user and is not
  1390. Xintended to replace the functionality of
  1391. X.IR sh ,
  1392. X.IR csh ,
  1393. Xor any other command interpreter.
  1394. X.PP
  1395. X.BR "Filename metacharacters" .
  1396. X.PP
  1397. X.IR Mush "'s"
  1398. Xcommand interpreter does not normally pre-expand metacharacters in the
  1399. Xmanner of other shells, because the metacharacters may refer to either
  1400. Xmessages or files.
  1401. XInstead, those commands that deal with file names do any necessary
  1402. Xmetacharacter expansion.
  1403. XTwo metacharacters are nearly always recognized:  `~' refers to the user's
  1404. Xhome directory, and `+' refers to the user's folder directory (\*Q~/Mail\*U
  1405. Xor the value of the variable
  1406. X.BR folder ).
  1407. XAnother user's home directory can also be referenced as \*Q~username\*U,
  1408. Xand for this reason files in the user's home directory must be referenced
  1409. Xas \*Q~/filename\*U.
  1410. XHowever, the `/' character is optional when referring to folders;
  1411. Xthat is, \*Q+filename\*U and \*Q+/filename\*U both refer
  1412. Xto the same file in the folder directory.
  1413. X.PP
  1414. XIf filename completion is enabled by setting the variable
  1415. X.BR complete ,
  1416. Xthe command interpreter will expand
  1417. X.IR csh -style
  1418. Xmetacharacters when completing filenames.
  1419. XA completion containing metacharacters expands to all the files matching
  1420. Xthe pattern when the completion key is pressed (defaults to ESC, `^[').
  1421. XSee the description of
  1422. X.B complete
  1423. Xfor limitations of this facility.
  1424. X.SH "CURSES INTERFACE"
  1425. XThe curses interface utilizes the curses routines intrinsic to most
  1426. X.I UNIX
  1427. Xsystems.
  1428. XThis interface is screen oriented rather
  1429. Xthan line oriented and allows the user to access commands and messages
  1430. Xmore quickly at the cost of history, piping, and a few commands.
  1431. X.PP
  1432. XMany users who prefer the curses interface might want to always start
  1433. Xall their mail sessions in the curses interface.
  1434. XPutting the
  1435. X.B curses
  1436. Xcommand in your initialization file is allowed, but you can also create
  1437. Xan alias or function in your login shell to always use the -C option.
  1438. X.I Mush
  1439. Xwill attempt to know not to run a shell if you're just sending mail to
  1440. Xsomeone, so the
  1441. X.I csh
  1442. Xcommand sequences:
  1443. X.sp
  1444. X.ti +2
  1445. X% alias mail 'mush -C'
  1446. X.ti +2
  1447. X% mail fred
  1448. X.sp
  1449. Xwill mail to fred and not enter the shell.
  1450. XHowever, if you just said \*Qmail\*U
  1451. Xwith no arguments, you'll enter the shell in curses mode if you have mail.
  1452. XIf you don't, you'll be told so, and the shell will not start.
  1453. XIf you want to enter curses mode even if
  1454. Xyou don't have mail, use the \-S option on the command line.
  1455. X.PP
  1456. XIn curses mode, the user's terminal has its \*Qecho\*U turned off so commands
  1457. Xthat are issued are not echoed on the screen.
  1458. XCertain commands cause the mode
  1459. Xto return to normal for typing purposes (sending mail, for example).
  1460. XIn normal operation, the screen will display the current set of message
  1461. Xheaders, the current message number is in the top left corner, the
  1462. Xmail status on the top line, and the cursor will be placed on the current
  1463. Xmessage.
  1464. XThe number of message headers displayed is set by the variable
  1465. X.BR screen .
  1466. XIf the user does not have that variable set, the baud rate is checked and
  1467. Xthe size of the screen is set according to optimal refresh time.
  1468. XUsually, 300 baud gives 7 lines, 1200 gives 14, 2400 gives 22 lines, and all
  1469. Xhigher baud rates give the size of the screen, whatever that may be.
  1470. XNote that the top line is reserved for \*Qstatus\*U and the bottom line is
  1471. Xfor user interaction should it be required.
  1472. X.PP
  1473. XThe user may now type commands via key sequences that are not echoed
  1474. Xto the screen.
  1475. XThus, function keys may be bound to \*Qcommands\*U by using the 
  1476. X.B bind
  1477. Xcommand.
  1478. XA list of key-to-command bindings can be found at runtime by typing `?'
  1479. Xin curses mode or by using the
  1480. X.B bind
  1481. Xcommand in line mode.
  1482. X.PP
  1483. XThe commands to which you can map sequences are intended to be as self
  1484. Xexplanatory as possible, but admittedly, it might be easier to figure out
  1485. Xvia trial and error than to try to wade through this documentation.
  1486. XA list of the legal curses commands can be obtained when executing the
  1487. Xbind command.
  1488. XRegular tty line-mode commands are not issued from
  1489. Xthe curses interface; only special curses mode commands are understood.
  1490. XThe current list of valid curses commands is:
  1491. X.sp
  1492. X.ta 2i 4i
  1493. X.in +4
  1494. X.nf
  1495. Xalias    last-msg    screen-back    
  1496. Xback-msg    line-mode    screen-next    
  1497. Xbind    lpr    search-again    
  1498. Xbind-macro    mail    search-back    
  1499. Xbottom-page    mail-flags    search-next    
  1500. Xchdir    map    shell-escape    
  1501. Xcopy    map!    sort    
  1502. Xcopy-list    my-hdrs    sort-reverse    
  1503. Xdelete    next-msg    source    
  1504. Xdelete-list    preserve    top    
  1505. Xdisplay    quit    top-page    
  1506. Xdisplay-next    quit!    unbind    
  1507. Xexit    redraw    undelete    
  1508. Xexit!    reply    undelete-list    
  1509. Xfirst-msg    reply-all    update    
  1510. Xfolder    reverse-video    variable    
  1511. Xgoto-msg    save    version    
  1512. Xhelp    save-list    write    
  1513. Xignore    saveopts    write-list    
  1514. X.fi
  1515. X.in -4
  1516. X.sp
  1517. X.PP
  1518. XThe following is a list of default key-command bindings.
  1519. XIf you specify bind commands in your initialization file that conflict with
  1520. Xthese defaults, your settings will override the defaults.
  1521. XThe default settings given in this manual
  1522. Xuse the ^-character method to indicate control characters
  1523. X(mostly because nroff makes printing the backslash
  1524. Xcharacter so amazingly difficult).
  1525. XThus, `^X' would mean control-X even
  1526. Xthough you'd have to type \*Q\\CX\*U to set
  1527. Xthe binding and actually use the control key and the `X' key simultaneously
  1528. Xto really
  1529. X.I do
  1530. Xa Control-X.
  1531. X.TP
  1532. X\&., t, p, T=top, n=next
  1533. XDisplay (type/print) message.
  1534. XTop will display the first
  1535. X.B crt
  1536. Xlines of a message.
  1537. XNext will print the next message.
  1538. XIf the current message is deleted, the next undeleted message is found.
  1539. XYou might notice this is different from the line mode, which will return
  1540. Xan error message that the current message is marked as deleted.
  1541. X.TP
  1542. X+, j, J, RETURN
  1543. XGo to next message.
  1544. X.TP
  1545. X-, k, K, ^K
  1546. XGo to previous message.
  1547. X.TP
  1548. X^, $
  1549. XGo to first/last message.
  1550. X.TP
  1551. X{, }
  1552. XGo to top/bottom of screen.
  1553. X.TP
  1554. Xa
  1555. XSet aliases.
  1556. X.TP
  1557. Xb, B
  1558. XSet/unset bindings.
  1559. X.TP
  1560. Xd, D, u, U
  1561. XDelete/undelete messages (capitals prompt for message list).
  1562. X.TP
  1563. Xf
  1564. XChange folder.
  1565. XIf current folder has changed, verification for update will be requested.
  1566. X.TP
  1567. Xg, 0-9
  1568. XGo directly to a specified message.
  1569. XWhen the \*Qgoto\*U command
  1570. Xis selected, a prompt at the bottom of the window prompts for a
  1571. X.BR "message list" .
  1572. XAnything that describes a message list may be used.
  1573. XSince
  1574. X.I Mush
  1575. Xcommands return message lists, a legal
  1576. X.I Mush
  1577. Xcommand enclosed in backquotes may be used to go to a particular message.
  1578. XThe new current message pointer will point to the next
  1579. Xmessage, returned by the command, that is below the old current message.
  1580. XAn example:
  1581. X.sp
  1582. X.ti +2
  1583. Xgoto msg: `pick \-f argv`
  1584. X.sp
  1585. XThis will cause the current message to move to the first message
  1586. Xin the current folder from the user \*Qargv\*U that comes after the
  1587. Xmessage pointed to when the \*Qgoto\*U was issued.
  1588. XSo, if messages 1 and 5
  1589. Xare from the user \*Qargv\*U and the current message the user was on
  1590. Xwas message 3, then the new current message would be message 5, since it
  1591. Xis the first message found after message 3 that is from \*Qargv\*U.
  1592. XIf none of the messages are found after the current message, the new
  1593. Xcurrent message will be the first one returned by the command.
  1594. X.TP
  1595. Xh
  1596. XSet personal headers.
  1597. X.TP
  1598. Xi
  1599. XSet ignored headers.
  1600. X.TP
  1601. Xm, M
  1602. XSend mail (capital prompts for mail flags).
  1603. X.TP
  1604. Xo, O
  1605. XOrder messages (sort; capital reverses order).
  1606. XA prompt requests the sort constraints.
  1607. X.TP
  1608. Xq, Q, x, X
  1609. XQuit/exit.
  1610. X\&`q' will test to see if the current folder has been updated and prompt
  1611. Xthe user to verify updating.
  1612. X\&`x' does not update mail, but quits the program.
  1613. X\&`Q' does not prompt for update verification; if changes were
  1614. Xmade, updating is automatic.
  1615. X\&`Q' (quit!) and `X' (exit!) will work even when typed at the
  1616. X\*Q...continue...\*U prompt, whereas `q' and `x' will not.
  1617. X.TP
  1618. Xr, R
  1619. XReply/reply all.
  1620. X.TP
  1621. Xs, S, c, C, w, W
  1622. XSave, copy, or write messages (capitals prompt for message lists).
  1623. X.TP
  1624. Xv
  1625. XSet regular variables (as opposed to environment variables).
  1626. X.TP
  1627. XV
  1628. XPrint version number.
  1629. X.TP
  1630. Xz, Z
  1631. XPrint next/previous screenful of message headers.
  1632. X.TP
  1633. X^L
  1634. XRedraw the screen.
  1635. X.TP
  1636. X^P
  1637. XPreserve current message (toggle).
  1638. X.TP
  1639. X^U
  1640. XUpdate folder.
  1641. XA prompt will request confirmation.
  1642. X.TP
  1643. X^R
  1644. XToggle reverse video mode (current message is in reverse video).
  1645. X.TP
  1646. X|
  1647. XSend message to printer
  1648. X.TP
  1649. X!
  1650. XShell Escape.
  1651. XPrompts for command; RETURN invokes a shell.
  1652. X.TP
  1653. X%
  1654. Xchange directory.
  1655. X.TP
  1656. X(, )
  1657. XSource/saveopts.
  1658. XPrompts for file name.
  1659. X.TP
  1660. X/, ^/, ^N
  1661. XForward, backward, continue search for patterns.
  1662. XEntire messages are not searched for here.
  1663. XOnly the text available on the screen is searched for.
  1664. XNote that some terminals use `^_' (control-underscore) for `^/',
  1665. Xso you may wish to re-bind this key.
  1666. X.TP
  1667. X&&
  1668. XCreate a curses mode macro.
  1669. X.TP
  1670. X&:
  1671. XCreate a line mode macro.
  1672. X.TP
  1673. X&!
  1674. XCreate a composition mode macro.
  1675. X.TP
  1676. X:[cmd]
  1677. XEnter line mode for one command.
  1678. XHistory is not recorded for this escape,
  1679. Xand line mode macros are not available.
  1680. XIf no command is given, curses mode
  1681. Xis exited and the session continues in line mode
  1682. X(in which case history and macros become available).
  1683. X.PP
  1684. XWhen setting new key sequences to be bound to commands, the user may
  1685. Xuse control keys and the ESCAPE character for extended commands.
  1686. XExceptions are control-C, control-\\, and possibly other control characters
  1687. Xdepending on your system's configuration or your current tty mode settings.
  1688. X.PP
  1689. XWhen assigning key sequences to commands, the user enters the
  1690. X.B bind
  1691. Xcommand and prompting is done.
  1692. XIf the
  1693. Xuser wishes to have control characters or the escape character in a key
  1694. Xsequence while still using ASCII format, a special notation for control
  1695. Xcharacters is provided.
  1696. XThis sequence is used primarily for the use of
  1697. END_OF_FILE
  1698. if test 50598 -ne `wc -c <'mush/mush.1.a'`; then
  1699.     echo shar: \"'mush/mush.1.a'\" unpacked with wrong size!
  1700. fi
  1701. # end of 'mush/mush.1.a'
  1702. fi
  1703. echo shar: End of archive 2 \(of 19\).
  1704. cp /dev/null ark2isdone
  1705. MISSING=""
  1706. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do
  1707.     if test ! -f ark${I}isdone ; then
  1708.     MISSING="${MISSING} ${I}"
  1709.     fi
  1710. done
  1711. if test "${MISSING}" = "" ; then
  1712.     echo You have unpacked all 19 archives.
  1713.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1714. else
  1715.     echo You still need to unpack the following archives:
  1716.     echo "        " ${MISSING}
  1717. fi
  1718. ##  End of shell archive.
  1719. exit 0
  1720.  
  1721.  
  1722.