home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume12 / mush / part02 < prev    next >
Encoding:
Text File  |  1990-05-05  |  55.3 KB  |  1,729 lines

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