2f01f6d246764f0c102d162d94f87889aa1801c1
[mmh] / man / msh.man
1 .\"
2 .\" %nmhwarning%
3 .\" $Id$
4 .\"
5 .TH MSH %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
6 .SH NAME
7 msh \- nmh shell (and BBoard reader)
8 .SH SYNOPSIS
9 .HP 5
10 .B msh
11 .RB [ \-prompt
12 .IR string ]
13 .RB [ \-scan " | " \-noscan ]
14 .RB [ \-topcur " | " \-notopcur ]
15 .RI [ file ]
16 .RB [ \-version ]
17 .RB [ \-help ]
18 .SH DESCRIPTION
19 .B msh
20 is an interactive program that implements a subset of the normal
21 .B nmh
22 commands operating on a single file in
23 .BR packf 'd format.
24 That is,
25 .B msh
26 is used to read a file that contains a number
27 of messages, as opposed to the standard
28 .B nmh
29 style of reading
30 a number of files, each file being a separate message in a folder.
31 .BR msh 's
32 chief advantage is that the normal
33 .B nmh
34 style does not
35 allow a file to have more than one message in it.  Hence,
36 .B msh
37 is
38 ideal for reading BBoards, as these files are delivered by the
39 transport system in this format.  In addition,
40 .B msh
41 can be used on
42 other files, such as message archives which have been
43 .BR pack ed
44 (see
45 .BR packf (1)).
46 Finally,
47 .B msh
48 is an excellent
49 .B nmh
50 tutor.
51 As the only commands available to the user are
52 .B nmh
53 commands, this
54 allows
55 .B nmh
56 beginners to concentrate on how commands to
57 .B nmh
58 are formed and (more or less) what they mean.
59 .PP
60 When invoked,
61 .B msh
62 reads the named file, and enters a command loop.
63 The user may type most of the normal
64 .B nmh
65 commands.  The syntax and
66 semantics of these commands typed to
67 .B msh
68 are identical to their
69 .B nmh
70 counterparts.  In cases where the nature of
71 .B msh
72 would be
73 inconsistent (e.g., specifying a
74 .I +folder
75 with some commands),
76 .B msh
77 will duly inform the user.  The commands that
78 .B msh
79 currently supports
80 (in some slightly modified or restricted forms) are:
81 .PP
82 .RS 5
83 .nf
84 ali
85 burst
86 comp
87 dist
88 folder
89 forw
90 inc
91 mark
92 mhmail
93 mhn
94 msgchk
95 next
96 packf
97 pick
98 prev
99 refile
100 repl
101 rmm
102 scan
103 send
104 show
105 sortm
106 whatnow
107 whom
108 .fi
109 .RE
110 .PP
111 In addition,
112 .B msh
113 has a
114 .B help
115 command which gives a
116 brief overview.  To terminate
117 .BR msh ,
118 type CTRL\-D, or use the
119 .B quit
120 command.  If
121 .B msh
122 is being invoked from
123 .BR bbc ,
124 then typing CTRL\-D will also tell
125 .B bbc
126 to exit as well, while
127 using the
128 .B quit
129 command will return control to
130 .BR bbc ,
131 and
132 .B bbc
133 will continue examining the list of BBoards that it is scanning.
134 .PP
135 If the file is writable and has been modified, then using
136 .B quit
137 will query the user if the file should be updated.
138 .PP
139 The
140 .B \-prompt
141 .I string
142 switch sets the prompting string for
143 .BR msh .
144 .PP
145 You may wish to use an alternate
146 .B nmh
147 profile for the commands that
148 .B msh
149 executes; see
150 .BR mh-profile (5)
151 for details about the
152 .B $MH
153 environment variable.
154 .PP
155 When invoked from
156 .BR bbc ,
157 two special features are enabled:
158 First, the
159 .B \-scan
160 switch directs
161 .B msh
162 to do a
163 .RB \*(lq scan
164 .BR unseen \*(rq
165 on start\-up if new items are present in the BBoard.  This feature is
166 best used from
167 .BR bbc ,
168 which correctly sets the stage.  Second, the
169 .B mark
170 command in
171 .B msh
172 acts specially when you are reading a
173 BBoard, since
174 .B msh
175 will consult the sequence \*(lqunseen\*(rq in
176 determining what messages you have actually read.  When
177 .B msh
178 exits,
179 it reports this information to
180 .BR bbc .
181 In addition, if you give the
182 .B mark
183 command with no arguments,
184 .B msh
185 will interpret it as
186 .RB \*(lq mark
187 .B \-sequence
188 .B unseen
189 .B \-delete
190 .B \-nozero
191 .BR all \*(rq
192 Hence, to discard
193 all of the messages in the current BBoard you're reading, just use the
194 .B mark
195 command with no arguments.
196 .PP
197 Normally, the
198 .B exit
199 command is identical to the
200 .B quit
201 command in
202 .BR msh .
203 When run under
204 .B bbc
205 however,
206 .B exit
207 directs
208 .B msh
209 to mark all messages as seen and then
210 .BR quit .
211 For speedy type\-in, this command is often abbreviated as just
212 .BR qe .
213 .PP
214 When invoked from
215 .BR vmh ,
216 another special feature is enabled:
217 The `topcur' switch directs
218 .B msh
219 to have the current message
220 \*(lqtrack\*(rq the top line of the
221 .B vmh
222 scan window.  Normally,
223 .B msh
224 has the current message \*(lqtrack\*(rq the center of the window
225 (under
226 .BR \-notopcur ,
227 which is the default).
228 .PP
229 .B msh
230 supports an output redirection facility.  Commands may be
231 followed by one of
232 .PP
233 .RS 5
234 .nf
235 .ta \w'| \fIcommand\fR  'u
236 ^> \fIfile\fR~^write output to \fIfile\fR
237 ^>> \fIfile\fR~^append output to \fIfile\fR
238 ^| \fIcommand\fR~^pipe output to UNIX \fIcommand\fR
239 .fi
240 .RE
241 .PP
242 If
243 .I file
244 starts with a \*(lq\~\*(rq (tilde), then a
245 .BR csh \-like
246 expansion
247 takes place.  Note that
248 .I command
249 is interpreted by
250 .BR sh .
251 Also note that
252 .B msh
253 does NOT support history substitutions, variable
254 substitutions, or alias substitutions.
255 .PP
256 When parsing commands to the left of any redirection symbol,
257 .B msh
258 will honor `\\' (back\-slash) as the quote next\-character symbol, and
259 `\*(lq' (double\-quote) as quote\-word delimiters.  All other input tokens
260 are separated by whitespace (spaces and tabs).
261
262 .SH FILES
263 .fc ^ ~
264 .nf
265 .ta \w'/usr/local/nmh/etc/ExtraBigFileName  'u
266 ^$HOME/\&.mh\(ruprofile~^The user profile
267 ^%etcdir%/mts.conf~^nmh mts configuration file
268 .fi
269
270 .SH "PROFILE COMPONENTS"
271 .fc ^ ~
272 .nf
273 .ta 2.4i
274 .ta \w'ExtraBigProfileName  'u
275 ^Path:~^To determine the user's nmh directory
276 ^Msg\-Protect:~^To set mode when creating a new `file'
277 ^fileproc:~^Program to file messages
278 ^showproc:~^Program to show messages
279 .fi
280
281 .SH "SEE ALSO"
282 bbc(1)
283
284 .SH DEFAULTS
285 .nf
286 .RB ` file "' defaults to \*(lq./msgbox\*(rq"
287 .RB ` "\-prompt\ (msh)\ "'
288 .RB ` \-noscan '
289 .RB ` \-notopcur '
290 .fi
291
292 .SH CONTEXT
293 None
294
295 .SH BUGS
296 The argument to the
297 .B \-prompt
298 switch must be interpreted as a single
299 token by the shell that invokes
300 .BR msh .
301 Therefore, one must usually
302 place the argument to this switch inside double\-quotes.
303 .PP
304 There is a strict limit of messages per file in
305 .BR packf 'd
306 format which
307 .B msh
308 can handle.  Usually, this limit is 1000 messages.
309 .PP
310 Please remember that
311 .B msh
312 is not the C\-Shell, and that a lot of
313 the nice facilities provided by the latter are not present in the former.
314 .PP
315 In particular,
316 .B msh
317 does not understand back\-quoting, so the only
318 effective way to use
319 .B pick
320 inside
321 .B msh
322 is to always use the
323 .B \-seq
324 .I select
325 switch.  Clever users of
326 .B nmh
327 will put the line
328 .P
329 .RS 5
330 pick:\0\-seq\0select\0\-list
331 .RE
332 .PP
333 in their
334 .I \&.mh\(ruprofile
335 file so that
336 .B pick
337 works equally well from both the shell and
338 .BR msh .
339 .PP
340 .B sortm
341 always uses
342 .B \-noverbose
343 and if
344 .B \-textfield
345 .I field
346 is used,
347 .B \-limit
348 .IR 0 .
349 .PP
350 The
351 .B msh
352 program inherits most (if not all) of the bugs from the
353 .B nmh
354 commands it implements.