]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/tcsh/tcsh.man
MFC r315948:
[FreeBSD/stable/10.git] / contrib / tcsh / tcsh.man
1 .\" $tcsh: tcsh.man,v 3.266 2016/11/24 15:04:52 christos Exp $
2 .\"
3 .\" Copyright (c) 1980, 1990, 1993
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\"    may be used to endorse or promote products derived from this software
16 .\"    without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\" 
30 .\" Style notes for the tcsh man page:
31 .\" 
32 .\" - Tags in lists are bold, except in the FILES section where they are
33 .\"   italic.
34 .\" 
35 .\" - References are bold for section headings and environment and shell
36 .\"   variables and italic for commands (externals, builtins, aliases, and
37 .\"   editor commands) and arguments to commands.
38 .\" 
39 .\" - Be careful with the .B and .I macros: they handle only a limited number
40 .\"   of words. Work around this with \fB and \fI, but only if absolutely
41 .\"   necessary, because tcsh.man2html uses .B/.I to find name anchors.
42 .\" 
43 .\" - Indent in multiples of 4, usually 8.
44 .\" 
45 .\" - Use `', not '' or "", except of course in shell syntax examples.
46 .\"   '' at the beginning of a line will vanish!
47 .\"
48 .\" - Use \` for literal back-quote (`).
49 .\"
50 .\" - Use \e for literal backslash (\).
51 .\" 
52 .\" - Use \-, not -.
53 .\" 
54 .\" - Include the tilde when naming dot files. `~/.login', not `.login'.
55 .\" 
56 .\" - Refer to external commands in man page format, e.g., `csh(1)'. However,
57 .\"   tcsh is `tcsh', not `tcsh(1)', because this is the tcsh man page (and
58 .\"   see the next note anyway).
59 .\" 
60 .\" - Say `the shell', not `tcsh', unless distinguishing between tcsh and csh.
61 .\" 
62 .\" - Say `shell variable'/`environment variable' instead of `variable'
63 .\"   and `builtin command'/`editor command' instead of `builtin' or `command'
64 .\"   unless the distinction is absolutely clear from context.
65 .\" 
66 .\" - Use the simple present tense. `The shell uses', not `The shell will use'.
67 .\" 
68 .\" - IMPORTANT: Cross-reference as much as possible. Commands, variables,
69 .\"   etc. in the reference section should be mentioned in the appropriate
70 .\"   descriptive section, or at least in the reference-section description
71 .\"   of another command (or whatever) which is mentioned in a description
72 .\"   section. Remember to note OS-specific things in "OS variant support",
73 .\"   new features in NEW FEATURES and referenced external commands in SEE
74 .\"   ALSO.
75 .\" 
76 .\" - tcsh.man2html depends heavily on the specific nroff commands used in the
77 .\"   man page when the script was written. Please stick closely to the style
78 .\"   used here if you can. In particular, please don't use nroff commands
79 .\"   which aren't already used herein.
80 .\" 
81 .TH TCSH 1 "24 November 2016" "Astron 6.20.00"
82 .SH NAME
83 tcsh \- C shell with file name completion and command line editing
84 .SH SYNOPSIS
85 .B tcsh \fR[\fB\-bcdefFimnqstvVxX\fR] [\fB\-Dname\fR[\fB=value\fR]] [arg ...]
86 .br
87 .B tcsh \-l
88 .SH DESCRIPTION
89 \fItcsh\fR is an enhanced but completely compatible version of the Berkeley
90 UNIX C shell, \fIcsh\fR(1).
91 It is a command language interpreter usable both as an interactive login
92 shell and a shell script command processor.
93 It includes a command-line editor (see \fBThe command-line editor\fR),
94 programmable word completion (see \fBCompletion and listing\fR),
95 spelling correction (see \fBSpelling correction\fR),
96 a history mechanism (see \fBHistory substitution\fR),
97 job control (see \fBJobs\fR)
98 and a C-like syntax.
99 The \fBNEW FEATURES\fR section describes major enhancements of \fItcsh\fR
100 over \fIcsh\fR(1).
101 Throughout this manual, features of
102 \fItcsh\fR not found in most \fIcsh\fR(1) implementations
103 (specifically, the 4.4BSD \fIcsh\fR)
104 are labeled with `(+)', and features which are present in \fIcsh\fR(1)
105 but not usually documented are labeled with `(u)'.
106 .SS "Argument list processing"
107 If the first argument (argument 0) to the shell is `\-' then it is a
108 login shell.  A login shell can be also specified by invoking the shell with
109 the \fB\-l\fR flag as the only argument.
110 .PP
111 The rest of the flag arguments are interpreted as follows:
112 .TP 4
113 .B \-b
114 Forces a ``break'' from option processing, causing any
115 further shell arguments to be treated as non-option arguments.  The remaining
116 arguments will not be interpreted as shell options.  This may be used to pass
117 options to a shell script without confusion or possible subterfuge.  The shell
118 will not run a set-user ID script without this option.
119 .TP 4
120 .B \-c
121 Commands are read from the following argument (which must be present, and
122 must be a single argument),
123 stored in the \fBcommand\fR shell variable for reference, and executed.
124 Any remaining arguments are placed in the \fBargv\fR shell variable.
125 .TP 4
126 .B \-d
127 The shell loads the directory stack from \fI~/.cshdirs\fR as described under
128 \fBStartup and shutdown\fR, whether or not it is a login shell. (+)
129 .TP 4
130 .B \-D\fIname\fR[=\fIvalue\fR]
131 Sets the environment variable \fIname\fR to \fIvalue\fR. (Domain/OS only) (+)
132 .TP 4
133 .B \-e
134 The shell exits if any invoked command terminates abnormally or
135 yields a non-zero exit status.
136 .TP 4
137 .B \-f
138 The shell does not load any resource or startup files, or perform any 
139 command hashing, and thus starts faster.
140 .TP 4
141 .B \-F
142 The shell uses \fIfork\fR(2) instead of \fIvfork\fR(2) to spawn processes. (+)
143 .TP 4
144 .B \-i
145 The shell is interactive and prompts for its top-level input, even if
146 it appears to not be a terminal.  Shells are interactive without this option if
147 their inputs and outputs are terminals.
148 .TP 4
149 .B \-l
150 The shell is a login shell.  Applicable only if \fB\-l\fR is the only
151 flag specified.
152 .TP 4
153 .B \-m
154 The shell loads \fI~/.tcshrc\fR even if it does not belong to the effective
155 user.  Newer versions of \fIsu\fR(1) can pass \fB\-m\fR to the shell. (+)
156 .TP 4
157 .B \-n
158 The shell parses commands but does not execute them.
159 This aids in debugging shell scripts.
160 .TP 4
161 .B \-q
162 The shell accepts SIGQUIT (see \fBSignal handling\fR) and behaves when
163 it is used under a debugger.  Job control is disabled. (u)
164 .TP 4
165 .B \-s
166 Command input is taken from the standard input.
167 .TP 4
168 .B \-t
169 The shell reads and executes a single line of input.  A `\e' may be used to
170 escape the newline at the end of this line and continue onto another line.
171 .TP 4
172 .B \-v
173 Sets the \fBverbose\fR shell variable, so that
174 command input is echoed after history substitution.
175 .TP 4
176 .B \-x
177 Sets the \fBecho\fR shell variable, so that commands are echoed
178 immediately before execution.
179 .TP 4
180 .B \-V
181 Sets the \fBverbose\fR shell variable even before executing \fI~/.tcshrc\fR.
182 .TP 4
183 .B \-X
184 Is to \fB\-x\fR as \fB\-V\fR is to \fB\-v\fR.
185 .TP 4
186 .B \-\-help
187 Print a help message on the standard output and exit. (+)
188 .TP 4
189 .B \-\-version
190 Print the version/platform/compilation options on the standard output and exit.
191 This information is also contained in the \fBversion\fR shell variable. (+)
192 .PP
193 After processing of flag arguments, if arguments remain but none of the
194 \fB\-c\fR, \fB\-i\fR, \fB\-s\fR, or \fB\-t\fR options were given, the first
195 argument is taken as the name of a file of commands, or ``script'', to
196 be executed.  The shell opens this file and saves its name for possible
197 resubstitution by `$0'.  Because many systems use either the standard
198 version 6 or version 7 shells whose shell scripts are not compatible
199 with this shell, the shell uses such a `standard' shell to execute a script
200 whose first character is not a `#', i.e., that does not start with a
201 comment.
202 .PP
203 Remaining arguments are placed in the \fBargv\fR shell variable.
204 .SS "Startup and shutdown"
205 A login shell begins by executing commands from the system files
206 \fI/etc/csh.cshrc\fR and \fI/etc/csh.login\fR.
207 It then executes commands from files in the user's \fBhome\fR directory:
208 first \fI~/.tcshrc\fR (+)
209 or, if \fI~/.tcshrc\fR is not found, \fI~/.cshrc\fR,
210 then the contents of \fI~/.history\fR (or the value of the \fBhistfile\fR shell variable) are loaded into memory,
211 then \fI~/.login\fR,
212 and finally \fI~/.cshdirs\fR (or the value of the \fBdirsfile\fR shell variable) (+).
213 The shell may read \fI/etc/csh.login\fR before instead of after
214 \fI/etc/csh.cshrc\fR, and \fI~/.login\fR before instead of after
215 \fI~/.tcshrc\fR or \fI~/.cshrc\fR and \fI~/.history\fR, if so compiled;
216 see the \fBversion\fR shell variable. (+)
217 .PP
218 Non-login shells read only \fI/etc/csh.cshrc\fR and \fI~/.tcshrc\fR
219 or \fI~/.cshrc\fR on startup.
220 .PP
221 For examples of startup files, please consult
222 \fIhttp://tcshrc.sourceforge.net\fR.
223 .PP
224 Commands like \fIstty\fR(1) and \fItset\fR(1),
225 which need be run only once per login, usually go in one's \fI~/.login\fR file.
226 Users who need to use the same set of files with both \fIcsh\fR(1) and
227 \fItcsh\fR can have only a \fI~/.cshrc\fR which checks for the existence of the
228 \fBtcsh\fR shell variable (q.v.) before using \fItcsh\fR-specific commands,
229 or can have both a \fI~/.cshrc\fR and a \fI~/.tcshrc\fR which \fIsource\fRs
230 (see the builtin command) \fI~/.cshrc\fR.
231 The rest of this manual uses `\fI~/.tcshrc\fR' to mean `\fI~/.tcshrc\fR or,
232 if \fI~/.tcshrc\fR is not found, \fI~/.cshrc\fR'.
233 .PP
234 In the normal case, the shell begins reading commands from the terminal,
235 prompting with `> '.  (Processing of arguments and the use of the shell to
236 process files containing command scripts are described later.)
237 The shell repeatedly reads a line of command input, breaks it into words,
238 places it on the command history list, parses it and executes each command
239 in the line.
240 .PP
241 One can log out by typing `^D' on an empty line, `logout' or `login' or
242 via the shell's autologout mechanism (see the \fBautologout\fR shell variable).
243 When a login shell terminates it sets the \fBlogout\fR shell variable to
244 `normal' or `automatic' as appropriate, then
245 executes commands from the files
246 \fI/etc/csh.logout\fR and \fI~/.logout\fR.  The shell may drop DTR on logout
247 if so compiled; see the \fBversion\fR shell variable.
248 .PP
249 The names of the system login and logout files vary from system to system for
250 compatibility with different \fIcsh\fR(1) variants; see \fBFILES\fR.
251 .SS Editing
252 We first describe \fBThe command-line editor\fR.
253 The \fBCompletion and listing\fR and \fBSpelling correction\fR sections
254 describe two sets of functionality that are implemented as editor commands
255 but which deserve their own treatment.
256 Finally, \fBEditor commands\fR lists and describes
257 the editor commands specific to the shell and their default bindings.
258 .SS "The command-line editor (+)"
259 Command-line input can be edited using key sequences much like those used in
260 \fIemacs\fR(1) or \fIvi\fR(1).
261 The editor is active only when the \fBedit\fR shell variable is set, which
262 it is by default in interactive shells.
263 The \fIbindkey\fR builtin can display and change key bindings.
264 \fIemacs\fR(1)\-style key bindings are used by default
265 (unless the shell was compiled otherwise; see the \fBversion\fR shell variable),
266 but \fIbindkey\fR can change the key bindings to \fIvi\fR(1)\-style bindings en masse.
267 .PP
268 The shell always binds the arrow keys (as defined in the \fBTERMCAP\fR
269 environment variable) to
270 .PP
271 .PD 0
272 .RS +4
273 .TP 8
274 down
275 \fIdown-history\fR
276 .TP 8
277 up
278 \fIup-history\fR
279 .TP 8
280 left
281 \fIbackward-char\fR
282 .TP 8
283 right
284 \fIforward-char\fR
285 .PD
286 .RE
287 .PP
288 unless doing so would alter another single-character binding.
289 One can set the arrow key escape sequences to the empty string with \fIsettc\fR
290 to prevent these bindings.
291 The ANSI/VT100 sequences for arrow keys are always bound.
292 .PP
293 Other key bindings are, for the most part, what \fIemacs\fR(1) and \fIvi\fR(1)
294 users would expect and can easily be displayed by \fIbindkey\fR, so there
295 is no need to list them here.  Likewise, \fIbindkey\fR can list the editor
296 commands with a short description of each.
297 Certain key bindings have different behavior depending if \fIemacs\fR(1) or \fIvi\fR(1)
298 style bindings are being used; see \fBvimode\fR for more information.
299 .PP
300 Note that editor commands do not have the same notion of a ``word'' as does the
301 shell.  The editor delimits words with any non-alphanumeric characters not in
302 the shell variable \fBwordchars\fR, while the shell recognizes only whitespace
303 and some of the characters with special meanings to it, listed under
304 \fBLexical structure\fR.
305 .SS "Completion and listing (+)"
306 The shell is often able to complete words when given a unique abbreviation.
307 Type part of a word (for example `ls /usr/lost') and hit the tab key to
308 run the \fIcomplete-word\fR editor command.
309 The shell completes the filename `/usr/lost' to `/usr/lost+found/',
310 replacing the incomplete word with the complete word in the input buffer.
311 (Note the terminal `/'; completion adds a `/' to the
312 end of completed directories and a space to the end of other completed words,
313 to speed typing and provide a visual indicator of successful completion.
314 The \fBaddsuffix\fR shell variable can be unset to prevent this.)
315 If no match is found (perhaps `/usr/lost+found' doesn't exist),
316 the terminal bell rings.
317 If the word is already complete (perhaps there is a `/usr/lost' on your
318 system, or perhaps you were thinking too far ahead and typed the whole thing)
319 a `/' or space is added to the end if it isn't already there.
320 .PP
321 Completion works anywhere in the line, not at just the end; completed
322 text pushes the rest of the line to the right.  Completion in the middle of a word
323 often results in leftover characters to the right of the cursor that need
324 to be deleted.
325 .PP
326 Commands and variables can be completed in much the same way.
327 For example, typing `em[tab]' would complete `em' to
328 `emacs' if \fIemacs\fR were the only command on your system beginning with `em'.
329 Completion can find a command in any directory in \fBpath\fR or if
330 given a full pathname.
331 Typing `echo $ar[tab]' would complete `$ar' to `$argv'
332 if no other variable began with `ar'.
333 .PP
334 The shell parses the input buffer to determine whether the word you want to
335 complete should be completed as a filename, command or variable.
336 The first word in the buffer and the first word following
337 `;', `|', `|&', `&&' or `||' is considered to be a command.
338 A word beginning with `$' is considered to be a variable.
339 Anything else is a filename.  An empty line is `completed' as a filename.
340 .PP
341 You can list the possible completions of a word at any time by typing `^D'
342 to run the \fIdelete-char-or-list-or-eof\fR editor command.
343 The shell lists the possible completions using the \fIls\-F\fR builtin (q.v.)
344 and reprints the prompt and unfinished command line, for example:
345 .IP "" 4
346 > ls /usr/l[^D]
347 .br
348 lbin/       lib/        local/      lost+found/
349 .br
350 > ls /usr/l
351 .PP
352 If the \fBautolist\fR shell variable is set, the shell lists the remaining
353 choices (if any) whenever completion fails:
354 .IP "" 4
355 > set autolist
356 .br
357 > nm /usr/lib/libt[tab]
358 .br
359 libtermcap.a@ libtermlib.a@
360 .br
361 > nm /usr/lib/libterm
362 .PP
363 If \fBautolist\fR is set to `ambiguous', choices are listed only when
364 completion fails and adds no new characters to the word being completed.
365 .PP
366 A filename to be completed can contain variables, your own or others' home
367 directories abbreviated with `~' (see \fBFilename substitution\fR) and
368 directory stack entries abbreviated with `='
369 (see \fBDirectory stack substitution\fR).  For example,
370 .IP "" 4
371 > ls ~k[^D]
372 .br
373 kahn    kas     kellogg
374 .br
375 > ls ~ke[tab]
376 .br
377 > ls ~kellogg/
378 .PP
379 or
380 .IP "" 4
381 > set local = /usr/local
382 .br
383 > ls $lo[tab]
384 .br
385 > ls $local/[^D]
386 .br
387 bin/ etc/ lib/ man/ src/
388 .br
389 > ls $local/
390 .PP
391 Note that variables can also be expanded explicitly with the
392 \fIexpand-variables\fR editor command.
393 .PP
394 \fIdelete-char-or-list-or-eof\fR lists at only the end of the line;
395 in the middle of a line it deletes the character under the cursor and
396 on an empty line it logs one out or, if \fBignoreeof\fR is set, does nothing.
397 `M-^D', bound to the editor command \fIlist-choices\fR, lists completion
398 possibilities anywhere on a line, and \fIlist-choices\fR (or any one of the
399 related editor commands that do or don't delete, list and/or log out,
400 listed under \fIdelete-char-or-list-or-eof\fR) can be bound to `^D' with
401 the \fIbindkey\fR builtin command if so desired.
402 .PP
403 The \fIcomplete-word-fwd\fR and \fIcomplete-word-back\fR editor commands
404 (not bound to any keys by default) can be used to cycle up and down through
405 the list of possible completions, replacing the current word with the next or
406 previous word in the list.
407 .PP
408 The shell variable \fBfignore\fR can be set to a list of suffixes to be
409 ignored by completion.  Consider the following:
410 .IP "" 4
411 > ls
412 .br
413 Makefile        condiments.h~   main.o          side.c
414 .br
415 README          main.c          meal            side.o
416 .br
417 condiments.h    main.c~
418 .br
419 > set fignore = (.o \e~)
420 .br
421 > emacs ma[^D]
422 .br
423 main.c   main.c~  main.o
424 .br
425 > emacs ma[tab]
426 .br
427 > emacs main.c
428 .PP
429 `main.c~' and `main.o' are ignored by completion (but not listing),
430 because they end in suffixes in \fBfignore\fR.
431 Note that a `\e' was needed in front of `~' to prevent it from being
432 expanded to \fBhome\fR as described under \fBFilename substitution\fR.
433 \fBfignore\fR is ignored if only one completion is possible.
434 .PP
435 If the \fBcomplete\fR shell variable is set to `enhance', completion
436 1) ignores case and 2) considers periods, hyphens and underscores
437 (`.', `\-' and `_') to be word separators and hyphens and underscores to
438 be equivalent.  If you had the following files
439 .IP "" 4
440 comp.lang.c      comp.lang.perl   comp.std.c++
441 .br
442 comp.lang.c++    comp.std.c
443 .PP
444 and typed `mail \-f c.l.c[tab]', it would be completed to
445 `mail \-f comp.lang.c', and ^D would list `comp.lang.c' and `comp.lang.c++'.
446 `mail \-f c..c++[^D]' would list `comp.lang.c++' and `comp.std.c++'.  Typing
447 `rm a\-\-file[^D]' in the following directory
448 .IP "" 4
449 A_silly_file    a-hyphenated-file    another_silly_file
450 .PP
451 would list all three files, because case is ignored and hyphens and
452 underscores are equivalent.  Periods, however, are not equivalent to
453 hyphens or underscores.
454 .PP
455 If the \fBcomplete\fR shell variable is set to `Enhance', completion
456 ignores case and differences between a hyphen and an underscore word
457 separator only when the user types a lowercase character or a hyphen.
458 Entering an uppercase character or an underscore will not match the 
459 corresponding lowercase character or hyphen word separator.  
460 Typing `rm a\-\-file[^D]' in the directory of the previous example would 
461 still list all three files, but typing `rm A\-\-file' would match only 
462 `A_silly_file' and typing `rm a__file[^D]' would match just `A_silly_file' 
463 and `another_silly_file' because the user explicitly used an uppercase 
464 or an underscore character.  
465 .PP
466 Completion and listing are affected by several other shell variables:
467 \fBrecexact\fR can be set to complete on the shortest possible unique
468 match, even if more typing might result in a longer match:
469 .IP "" 4
470 > ls
471 .br
472 fodder   foo      food     foonly
473 .br
474 > set recexact
475 .br
476 > rm fo[tab]
477 .PP
478 just beeps, because `fo' could expand to `fod' or `foo', but if we type
479 another `o',
480 .IP "" 4
481 > rm foo[tab]
482 .br
483 > rm foo
484 .PP
485 the completion completes on `foo', even though `food' and `foonly'
486 also match.
487 \fBautoexpand\fR can be set to run the \fIexpand-history\fR editor command
488 before each completion attempt, \fBautocorrect\fR can be set to
489 spelling-correct the word to be completed (see \fBSpelling correction\fR)
490 before each completion attempt and \fBcorrect\fR can be set to complete
491 commands automatically after one hits `return'.
492 \fBmatchbeep\fR can be set to make completion beep or not beep in a variety
493 of situations, and \fBnobeep\fR can be set to never beep at all.
494 \fBnostat\fR can be set to a list of directories and/or patterns that
495 match directories to prevent the completion mechanism from \fIstat\fR(2)ing
496 those directories.
497 \fBlistmax\fR and \fBlistmaxrows\fR can be set to limit the number of items
498 and rows (respectively) that are listed without asking first.
499 \fBrecognize_only_executables\fR can be set to make the shell list only
500 executables when listing commands, but it is quite slow.
501 .PP
502 Finally, the \fIcomplete\fR builtin command can be used to tell the shell how
503 to complete words other than filenames, commands and variables.
504 Completion and listing do not work on glob-patterns (see \fBFilename substitution\fR),
505 but the \fIlist-glob\fR and \fIexpand-glob\fR editor commands perform
506 equivalent functions for glob-patterns.
507 .SS "Spelling correction (+)"
508 The shell can sometimes correct the spelling of filenames, commands and variable names
509 as well as completing and listing them.
510 .PP
511 Individual words can be spelling-corrected with the \fIspell-word\fR
512 editor command (usually bound to M-s and M-S)
513 and the entire input buffer with \fIspell-line\fR (usually bound to M-$).
514 The \fBcorrect\fR shell variable can be set to `cmd' to correct the
515 command name or `all' to correct the entire line each time return is typed,
516 and \fBautocorrect\fR can be set to correct the word to be completed
517 before each completion attempt.
518 .PP
519 When spelling correction is invoked in any of these ways and
520 the shell thinks that any part of the command line is misspelled,
521 it prompts with the corrected line:
522 .IP "" 4
523 > set correct = cmd
524 .br
525 > lz /usr/bin
526 .br
527 CORRECT>ls /usr/bin (y|n|e|a)?
528 .PP
529 One can answer `y' or space to execute the corrected line,
530 `e' to leave the uncorrected command in the input buffer,
531 `a' to abort the command as if `^C' had been hit, and
532 anything else to execute the original line unchanged.
533 .PP
534 Spelling correction recognizes user-defined completions (see the
535 \fIcomplete\fR builtin command).  If an input word in a position for
536 which a completion is defined resembles a word in the completion list,
537 spelling correction registers a misspelling and suggests the latter
538 word as a correction.  However, if the input word does not match any of
539 the possible completions for that position, spelling correction does
540 not register a misspelling.
541 .PP
542 Like completion, spelling correction works anywhere in the line,
543 pushing the rest of the line to the right and possibly leaving
544 extra characters to the right of the cursor.
545 .SS "Editor commands (+)"
546 `bindkey' lists key bindings and `bindkey \-l' lists and briefly describes
547 editor commands.
548 Only new or especially interesting editor commands are described here.
549 See \fIemacs\fR(1) and \fIvi\fR(1) for descriptions of each editor's
550 key bindings.
551 .PP
552 The character or characters to which each command is bound by default is
553 given in parentheses.  `^\fIcharacter\fR' means a control character and
554 `M-\fIcharacter\fR' a meta character, typed as escape-\fIcharacter\fR
555 on terminals without a meta key.  Case counts, but commands that are bound
556 to letters by default are bound to both lower- and uppercase letters for
557 convenience.
558 .TP 8
559 .B backward-char \fR(^B, left)
560 Move back a character.
561 Cursor behavior modified by \fBvimode\fR.
562 .TP 8
563 .B backward-delete-word \fR(M-^H, M-^?)
564 Cut from beginning of current word to cursor \- saved in cut buffer.
565 Word boundary behavior modified by \fBvimode\fR.
566 .TP 8
567 .B backward-word \fR(M-b, M-B)
568 Move to beginning of current word.
569 Word boundary and cursor behavior modified by \fBvimode\fR.
570 .TP 8
571 .B beginning-of-line \fR(^A, home)
572 Move to beginning of line.
573 Cursor behavior modified by \fBvimode\fR.
574 .TP 8
575 .B capitalize-word \fR(M-c, M-C)
576 Capitalize the characters from cursor to end of current word.
577 Word boundary behavior modified by \fBvimode\fR.
578 .TP 8
579 .B complete-word \fR(tab)
580 Completes a word as described under \fBCompletion and listing\fR.
581 .TP 8
582 .B complete-word-back \fR(not bound)
583 Like \fIcomplete-word-fwd\fR, but steps up from the end of the list.
584 .TP 8
585 .B complete-word-fwd \fR(not bound)
586 Replaces the current word with the first word in the list of possible
587 completions.  May be repeated to step down through the list.
588 At the end of the list, beeps and reverts to the incomplete word.
589 .TP 8
590 .B complete-word-raw \fR(^X-tab)
591 Like \fIcomplete-word\fR, but ignores user-defined completions.
592 .TP 8
593 .B copy-prev-word \fR(M-^_)
594 Copies the previous word in the current line into the input buffer.
595 See also \fIinsert-last-word\fR.
596 Word boundary behavior modified by \fBvimode\fR.
597 .TP 8
598 .B dabbrev-expand \fR(M-/)
599 Expands the current word to the most recent preceding one for which
600 the current is a leading substring, wrapping around the history list
601 (once) if necessary.
602 Repeating \fIdabbrev-expand\fR without any intervening typing
603 changes to the next previous word etc., skipping identical matches
604 much like \fIhistory-search-backward\fR does.
605 .TP 8
606 .B delete-char \fR(not bound)
607 Deletes the character under the cursor.
608 See also \fIdelete-char-or-list-or-eof\fR.
609 Cursor behavior modified by \fBvimode\fR.
610 .TP 8
611 .B delete-char-or-eof \fR(not bound)
612 Does \fIdelete-char\fR if there is a character under the cursor
613 or \fIend-of-file\fR on an empty line.
614 See also \fIdelete-char-or-list-or-eof\fR.
615 Cursor behavior modified by \fBvimode\fR.
616 .TP 8
617 .B delete-char-or-list \fR(not bound)
618 Does \fIdelete-char\fR if there is a character under the cursor
619 or \fIlist-choices\fR at the end of the line.
620 See also \fIdelete-char-or-list-or-eof\fR.
621 .TP 8
622 .B delete-char-or-list-or-eof \fR(^D)
623 Does \fIdelete-char\fR if there is a character under the cursor,
624 \fIlist-choices\fR at the end of the line
625 or \fIend-of-file\fR on an empty line.
626 See also those three commands, each of which does only a single action, and
627 \fIdelete-char-or-eof\fR, \fIdelete-char-or-list\fR and \fIlist-or-eof\fR,
628 each of which does a different two out of the three.
629 .TP 8
630 .B delete-word \fR(M-d, M-D)
631 Cut from cursor to end of current word \- save in cut buffer.
632 Word boundary behavior modified by \fBvimode\fR.
633 .TP 8
634 .B down-history \fR(down-arrow, ^N)
635 Like \fIup-history\fR, but steps down, stopping at the original input line.
636 .TP 8
637 .B downcase-word \fR(M-l, M-L)
638 Lowercase the characters from cursor to end of current word.
639 Word boundary behavior modified by \fBvimode\fR.
640 .TP 8
641 .B end-of-file \fR(not bound)
642 Signals an end of file, causing the shell to exit unless the \fBignoreeof\fR
643 shell variable (q.v.) is set to prevent this.
644 See also \fIdelete-char-or-list-or-eof\fR.
645 .TP 8
646 .B end-of-line \fR(^E, end)
647 Move cursor to end of line.
648 Cursor behavior modified by \fBvimode\fR.
649 .TP 8
650 .B expand-history \fR(M-space)
651 Expands history substitutions in the current word.
652 See \fBHistory substitution\fR.
653 See also \fImagic-space\fR, \fItoggle-literal-history\fR and
654 the \fBautoexpand\fR shell variable.
655 .TP 8
656 .B expand-glob \fR(^X-*)
657 Expands the glob-pattern to the left of the cursor.
658 See \fBFilename substitution\fR.
659 .TP 8
660 .B expand-line \fR(not bound)
661 Like \fIexpand-history\fR, but
662 expands history substitutions in each word in the input buffer.
663 .TP 8
664 .B expand-variables \fR(^X-$)
665 Expands the variable to the left of the cursor.
666 See \fBVariable substitution\fR.
667 .TP 8
668 .B forward-char \fR(^F, right)
669 Move forward one character.
670 Cursor behavior modified by \fBvimode\fR.
671 .TP 8
672 .B forward-word \fR(M-f, M-F)
673 Move forward to end of current word.
674 Word boundary and cursor behavior modified by \fBvimode\fR.
675 .TP 8
676 .B history-search-backward \fR(M-p, M-P)
677 Searches backwards through the history list for a command beginning with
678 the current contents of the input buffer up to the cursor and copies it
679 into the input buffer.
680 The search string may be a glob-pattern (see \fBFilename substitution\fR)
681 containing `*', `?', `[]' or `{}'.
682 \fIup-history\fR and \fIdown-history\fR will proceed from the
683 appropriate point in the history list.
684 Emacs mode only.
685 See also \fIhistory-search-forward\fR and \fIi-search-back\fR.
686 .TP 8
687 .B history-search-forward \fR(M-n, M-N)
688 Like \fIhistory-search-backward\fR, but searches forward.
689 .TP 8
690 .B i-search-back \fR(not bound)
691 Searches backward like \fIhistory-search-backward\fR, copies the first match
692 into the input buffer with the cursor positioned at the end of the pattern,
693 and prompts with `bck: ' and the first match.  Additional characters may be
694 typed to extend the search, \fIi-search-back\fR may be typed to continue
695 searching with the same pattern, wrapping around the history list if
696 necessary, (\fIi-search-back\fR must be bound to a
697 single character for this to work) or one of the following special characters
698 may be typed:
699 .PP
700 .RS +8
701 .RS +4
702 .PD 0
703 .TP 8
704 ^W
705 Appends the rest of the word under the cursor to the search pattern.
706 .TP 8
707 delete (or any character bound to \fIbackward-delete-char\fR)
708 Undoes the effect of the last character typed and deletes a character
709 from the search pattern if appropriate.
710 .TP 8
711 ^G
712 If the previous search was successful, aborts the entire search.
713 If not, goes back to the last successful search.
714 .TP 8
715 escape
716 Ends the search, leaving the current line in the input buffer.
717 .RE
718 .PD
719 .PP
720 Any other character not bound to \fIself-insert-command\fR terminates the
721 search, leaving the current line in the input buffer, and
722 is then interpreted as normal input.  In particular, a carriage return
723 causes the current line to be executed.
724 See also \fIi-search-fwd\fR and \fIhistory-search-backward\fR.
725 Word boundary behavior modified by \fBvimode\fR.
726 .RE
727 .TP 8
728 .B i-search-fwd \fR(not bound)
729 Like \fIi-search-back\fR, but searches forward.
730 Word boundary behavior modified by \fBvimode\fR.
731 .TP 8
732 .B insert-last-word \fR(M-_)
733 Inserts the last word of the previous input line (`!$') into the input buffer.
734 See also \fIcopy-prev-word\fR.
735 .TP 8
736 .B list-choices \fR(M-^D)
737 Lists completion possibilities as described under \fBCompletion and listing\fR.
738 See also \fIdelete-char-or-list-or-eof\fR and \fIlist-choices-raw\fR.
739 .TP 8
740 .B list-choices-raw \fR(^X-^D)
741 Like \fIlist-choices\fR, but ignores user-defined completions.
742 .TP 8
743 .B list-glob \fR(^X-g, ^X-G)
744 Lists (via the \fIls\-F\fR builtin) matches to the glob-pattern
745 (see \fBFilename substitution\fR) to the left of the cursor.
746 .TP 8
747 .B list-or-eof \fR(not bound)
748 Does \fIlist-choices\fR
749 or \fIend-of-file\fR on an empty line.
750 See also \fIdelete-char-or-list-or-eof\fR.
751 .TP 8
752 .B magic-space \fR(not bound)
753 Expands history substitutions in the current line,
754 like \fIexpand-history\fR, and inserts a space.
755 \fImagic-space\fR is designed to be bound to the space bar,
756 but is not bound by default.
757 .TP 8
758 .B normalize-command \fR(^X-?)
759 Searches for the current word in PATH and, if it is found, replaces it with
760 the full path to the executable.  Special characters are quoted.  Aliases are
761 expanded and quoted but commands within aliases are not.  This command is
762 useful with commands that take commands as arguments, e.g., `dbx' and `sh \-x'.
763 .TP 8
764 .B normalize-path \fR(^X-n, ^X-N)
765 Expands the current word as described under the `expand' setting
766 of the \fBsymlinks\fR shell variable.
767 .TP 8
768 .B overwrite-mode \fR(unbound)
769 Toggles between input and overwrite modes.
770 .TP 8
771 .B run-fg-editor \fR(M-^Z)
772 Saves the current input line and
773 looks for a stopped job where the file name portion of its first word
774 is found in the \fBeditors\fR shell variable.
775 If \fBeditors\fR is not set, then the file name portion of the
776 \fBEDITOR\fR environment variable (`ed' if unset)
777 and the
778 \fBVISUAL\fR environment variable (`vi' if unset)
779 will be used.
780 If such a job is found, it is restarted as if `fg %\fIjob\fR' had been
781 typed.  This is used to toggle back and forth between an editor and
782 the shell easily.  Some people bind this command to `^Z' so they
783 can do this even more easily.
784 .TP
785 .B run-help \fR(M-h, M-H)
786 Searches for documentation on the current command, using the same notion of
787 `current command' as the completion routines, and prints it.  There is no way
788 to use a pager; \fIrun-help\fR is designed for short help files.
789 If the special alias \fBhelpcommand\fR is defined, it is run with the
790 command name as a sole argument.  Else,
791 documentation should be in a file named \fIcommand\fR.help, \fIcommand\fR.1,
792 \fIcommand\fR.6, \fIcommand\fR.8 or \fIcommand\fR, which should be in one
793 of the directories listed in the \fBHPATH\fR environment variable.
794 If there is more than one help file only the first is printed.
795 .TP 8
796 .B self-insert-command \fR(text characters)
797 In insert mode (the default), inserts the typed character into the input line after the character under the cursor.
798 In overwrite mode, replaces the character under the cursor with the typed character.
799 The input mode is normally preserved between lines, but the
800 \fBinputmode\fR shell variable can be set to `insert' or `overwrite' to put the
801 editor in that mode at the beginning of each line.
802 See also \fIoverwrite-mode\fR.
803 .TP 8
804 .B sequence-lead-in \fR(arrow prefix, meta prefix, ^X)
805 Indicates that the following characters are part of a
806 multi-key sequence.  Binding a command to a multi-key sequence really creates
807 two bindings: the first character to \fIsequence-lead-in\fR and the
808 whole sequence to the command.  All sequences beginning with a character
809 bound to \fIsequence-lead-in\fR are effectively bound to \fIundefined-key\fR
810 unless bound to another command.
811 .TP 8
812 .B spell-line \fR(M-$)
813 Attempts to correct the spelling of each word in the input buffer, like
814 \fIspell-word\fR, but ignores words whose first character is one of
815 `\-', `!', `^' or `%', or which contain `\e', `*' or `?', to avoid problems
816 with switches, substitutions and the like.
817 See \fBSpelling correction\fR.
818 .TP 8
819 .B spell-word \fR(M-s, M-S)
820 Attempts to correct the spelling of the current word as described
821 under \fBSpelling correction\fR.
822 Checks each component of a word which appears to be a pathname.
823 .TP 8
824 .B toggle-literal-history \fR(M-r, M-R)
825 Expands or `unexpands' history substitutions in the input buffer.
826 See also \fIexpand-history\fR and the \fBautoexpand\fR shell variable.
827 .TP 8
828 .B undefined-key \fR(any unbound key)
829 Beeps.
830 .TP 8
831 .B up-history \fR(up-arrow, ^P)
832 Copies the previous entry in the history list into the input buffer.
833 If \fBhistlit\fR is set, uses the literal form of the entry.
834 May be repeated to step up through the history list, stopping at the top.
835 .TP 8
836 .B upcase-word \fR(M-u, M-U)
837 Uppercase the characters from cursor to end of current word.
838 Word boundary behavior modified by \fBvimode\fR.
839 .TP 8
840 .B vi-beginning-of-next-word \fR(not bound)
841 Vi goto the beginning of next word.
842 Word boundary and cursor behavior modified by \fBvimode\fR.
843 .TP 8
844 .B vi-eword \fR(not bound)
845 Vi move to the end of the current word.
846 Word boundary behavior modified by \fBvimode\fR.
847 .TP 8
848 .B vi-search-back \fR(?)
849 Prompts with `?' for a search string (which may be a glob-pattern, as with
850 \fIhistory-search-backward\fR), searches for it and copies it into the
851 input buffer.  The bell rings if no match is found.
852 Hitting return ends the search and leaves the last match in the input
853 buffer.
854 Hitting escape ends the search and executes the match.
855 \fIvi\fR mode only.
856 .TP 8
857 .B vi-search-fwd \fR(/)
858 Like \fIvi-search-back\fR, but searches forward.
859 .TP 8
860 .B which-command \fR(M-?)
861 Does a \fIwhich\fR (see the description of the builtin command) on the
862 first word of the input buffer.
863 .TP 8
864 .B yank-pop \fR(M-y)
865 When executed immediately after a \fIyank\fR or another \fIyank-pop\fR,
866 replaces the yanked string with the next previous string from the
867 killring. This also has the effect of rotating the killring, such that
868 this string will be considered the most recently killed by a later
869 \fIyank\fR command. Repeating \fIyank-pop\fR will cycle through the
870 killring any number of times.
871 .SS "Lexical structure"
872 The shell splits input lines into words at blanks and tabs.  The special
873 characters `&', `|', `;', `<', `>', `(', and `)' and the doubled characters
874 `&&', `||', `<<' and `>>' are always separate words, whether or not they are
875 surrounded by whitespace.
876 .PP
877 When the shell's input is not a terminal, the character `#' is taken to begin a
878 comment.  Each `#' and the rest of the input line on which it appears is
879 discarded before further parsing.
880 .PP
881 A special character (including a blank or tab) may be prevented from having
882 its special meaning, and possibly made part of another word, by preceding it
883 with a backslash (`\e') or enclosing it in single (`''), double (`"') or
884 backward (`\`') quotes.  When not otherwise quoted a newline preceded by a `\e'
885 is equivalent to a blank, but inside quotes this sequence results in a
886 newline.
887 .PP
888 Furthermore, all \fBSubstitutions\fR (see below) except \fBHistory substitution\fR
889 can be prevented by enclosing the strings (or parts of strings)
890 in which they appear with single quotes or by quoting the crucial character(s)
891 (e.g., `$' or `\`' for \fBVariable substitution\fR or \fBCommand substitution\fR respectively)
892 with `\e'.  (\fBAlias substitution\fR is no exception: quoting in any way any
893 character of a word for which an \fIalias\fR has been defined prevents
894 substitution of the alias.  The usual way of quoting an alias is to precede it
895 with a backslash.) \fBHistory substitution\fR is prevented by
896 backslashes but not by single quotes.  Strings quoted with double or backward
897 quotes undergo \fBVariable substitution\fR and \fBCommand substitution\fR, but other
898 substitutions are prevented.
899 .PP
900 Text inside single or double quotes becomes a single word (or part of one).
901 Metacharacters in these strings, including blanks and tabs, do not form
902 separate words.  Only in one special case (see \fBCommand substitution\fR
903 below) can a double-quoted string yield parts of more than one word;
904 single-quoted strings never do.  Backward quotes are special: they signal
905 \fBCommand substitution\fR (q.v.), which may result in more than one word.
906 .PP
907 Quoting complex strings, particularly strings which themselves contain quoting
908 characters, can be confusing.  Remember that quotes need not be used as they are
909 in human writing!  It may be easier to quote not an entire string, but only
910 those parts of the string which need quoting, using different types of quoting
911 to do so if appropriate.
912 .PP
913 The \fBbackslash_quote\fR shell variable (q.v.) can be set to make backslashes
914 always quote `\e', `'', and `"'.  (+) This may make complex quoting tasks
915 easier, but it can cause syntax errors in \fIcsh\fR(1) scripts.
916 .SS Substitutions
917 We now describe the various transformations the shell performs on the input in
918 the order in which they occur.  We note in passing the data structures involved
919 and the commands and variables which affect them.  Remember that substitutions
920 can be prevented by quoting as described under \fBLexical structure\fR.
921 .SS "History substitution"
922 Each command, or ``event'', input from the terminal is saved in the history
923 list.  The previous command is always saved, and the \fBhistory\fR shell
924 variable can be set to a number to save that many commands.  The \fBhistdup\fR
925 shell variable can be set to not save duplicate events or consecutive duplicate
926 events.
927 .PP
928 Saved commands are numbered sequentially from 1 and stamped with the time.
929 It is not usually necessary to use event numbers, but the current event number
930 can be made part of the prompt by placing an `!' in the \fBprompt\fR shell variable.
931 .PP
932 The shell actually saves history in expanded and literal (unexpanded) forms.
933 If the \fBhistlit\fR shell variable is set, commands that display and store
934 history use the literal form.
935 .PP
936 The \fIhistory\fR builtin command can print, store in a file, restore
937 and clear the history list at any time,
938 and the \fBsavehist\fR and \fBhistfile\fR shell variables can be set to
939 store the history list automatically on logout and restore it on login.
940 .PP
941 History substitutions introduce words from the history list into the input
942 stream, making it easy to repeat commands, repeat arguments of a previous
943 command in the current command, or fix spelling mistakes in the previous
944 command with little typing and a high degree of confidence.
945 .PP
946 History substitutions begin with the character `!'.  They may begin anywhere in
947 the input stream, but they do not nest.  The `!' may be preceded by a `\e' to
948 prevent its special meaning; for convenience, a `!' is passed unchanged when it
949 is followed by a blank, tab, newline, `=' or `('.  History substitutions also
950 occur when an input line begins with `^'.  This special abbreviation will be
951 described later.  The characters used to signal history substitution (`!' and
952 `^') can be changed by setting the \fBhistchars\fR shell variable.  Any input
953 line which contains a history substitution is printed before it is executed.
954 .PP
955 A history substitution may have an ``event specification'', which indicates
956 the event from which words are to be taken, a ``word designator'',
957 which selects particular words from the chosen event, and/or a ``modifier'',
958 which manipulates the selected words.
959 .PP
960 An event specification can be
961 .PP
962 .PD 0
963 .RS +4
964 .TP 8
965 .I n
966 A number, referring to a particular event
967 .TP 8
968 \-\fIn\fR
969 An offset, referring to the event \fIn\fR before the current event
970 .TP 8
971 #
972 The current event.
973 This should be used carefully in \fIcsh\fR(1), where there is no check for
974 recursion.  \fItcsh\fR allows 10 levels of recursion.  (+)
975 .TP 8
976 !
977 The previous event (equivalent to `\-1')
978 .TP 8
979 .I s
980 The most recent event whose first word begins with the string \fIs\fR
981 .TP 8
982 ?\fIs\fR?
983 The most recent event which contains the string \fIs\fR.
984 The second `?' can be omitted if it is immediately followed by a newline.
985 .RE
986 .PD
987 .PP
988 For example, consider this bit of someone's history list:
989 .IP "" 4
990 \ 9  8:30    nroff \-man wumpus.man
991 .br
992 10  8:31    cp wumpus.man wumpus.man.old
993 .br
994 11  8:36    vi wumpus.man
995 .br
996 12  8:37    diff wumpus.man.old wumpus.man
997 .PP
998 The commands are shown with their event numbers and time stamps.
999 The current event, which we haven't typed in yet, is event 13.
1000 `!11' and `!\-2' refer to event 11.
1001 `!!' refers to the previous event, 12.  `!!' can be abbreviated `!' if it is
1002 followed by `:' (`:' is described below).
1003 `!n' refers to event 9, which begins with `n'.
1004 `!?old?' also refers to event 12, which contains `old'.
1005 Without word designators or modifiers history references simply expand to the
1006 entire event, so we might type `!cp' to redo the copy command or `!!|more'
1007 if the `diff' output scrolled off the top of the screen.
1008 .PP
1009 History references may be insulated from the surrounding text with braces if
1010 necessary.  For example, `!vdoc' would look for a command beginning with
1011 `vdoc', and, in this example, not find one, but `!{v}doc' would expand
1012 unambiguously to `vi wumpus.mandoc'.
1013 Even in braces, history substitutions do not nest.
1014 .PP
1015 (+) While \fIcsh\fR(1) expands, for example, `!3d' to event 3 with the
1016 letter `d' appended to it, \fItcsh\fR expands it to the last event beginning
1017 with `3d'; only completely numeric arguments are treated as event numbers.
1018 This makes it possible to recall events beginning with numbers.
1019 To expand `!3d' as in \fIcsh\fR(1) say `!{3}d'.
1020 .PP
1021 To select words from an event we can follow the event specification by a `:'
1022 and a designator for the desired words.  The words of an input line are
1023 numbered from 0, the first (usually command) word being 0, the second word
1024 (first argument) being 1, etc.  The basic word designators are:
1025 .PP
1026 .PD 0
1027 .RS +4
1028 .TP 8
1029 0
1030 The first (command) word
1031 .TP 8
1032 .I n
1033 The \fIn\fRth argument
1034 .TP 8
1035 ^
1036 The first argument, equivalent to `1'
1037 .TP 8
1038 $
1039 The last argument
1040 .TP 8
1041 %
1042 The word matched by an ?\fIs\fR? search
1043 .TP 8
1044 .I x\-y
1045 A range of words
1046 .TP 8
1047 .I \-y
1048 Equivalent to \fI`0\-y'\fR
1049 .TP 8
1050 *
1051 Equivalent to `^\-$', but returns nothing if the event contains only 1 word
1052 .TP 8
1053 .I x*
1054 Equivalent to \fI`x\-$'\fR
1055 .TP 8
1056 .I x\-
1057 Equivalent to \fI`x*'\fR, but omitting the last word (`$')
1058 .PD
1059 .RE
1060 .PP
1061 Selected words are inserted into the command line separated by single blanks.
1062 For example, the `diff' command in the previous example might have been
1063 typed as `diff !!:1.old !!:1' (using `:1' to select the first argument
1064 from the previous event) or `diff !\-2:2 !\-2:1' to select and swap the
1065 arguments from the `cp' command.  If we didn't care about the order of the
1066 `diff' we might have said `diff !\-2:1\-2' or simply `diff !\-2:*'.
1067 The `cp' command might have been written `cp wumpus.man !#:1.old', using `#'
1068 to refer to the current event.
1069 `!n:\- hurkle.man' would reuse the first two words from the `nroff' command
1070 to say `nroff \-man hurkle.man'.
1071 .PP
1072 The `:' separating the event specification from the word designator can be
1073 omitted if the argument selector begins with a `^', `$', `*', `%' or `\-'.
1074 For example, our `diff' command might have been `diff !!^.old !!^' or,
1075 equivalently, `diff !!$.old !!$'.  However, if `!!' is abbreviated `!',
1076 an argument selector beginning with `\-' will be interpreted as an event
1077 specification.
1078 .PP
1079 A history reference may have a word designator but no event specification.
1080 It then references the previous command.
1081 Continuing our `diff' example, we could have said simply `diff
1082 !^.old !^' or, to get the arguments in the opposite order, just `diff !*'.
1083 .PP
1084 The word or words in a history reference can be edited, or ``modified'',
1085 by following it with one or more modifiers, each preceded by a `:':
1086 .PP
1087 .PD 0
1088 .RS +4
1089 .TP 8
1090 h
1091 Remove a trailing pathname component, leaving the head.
1092 .TP 8
1093 t
1094 Remove all leading pathname components, leaving the tail.
1095 .TP 8
1096 r
1097 Remove a filename extension `.xxx', leaving the root name.
1098 .TP 8
1099 e
1100 Remove all but the extension.
1101 .TP 8
1102 u
1103 Uppercase the first lowercase letter.
1104 .TP 8
1105 l
1106 Lowercase the first uppercase letter.
1107 .TP 8
1108 s\fI/l/r/\fR
1109 Substitute \fIl\fR for \fIr\fR.
1110 \fIl\fR is simply a string like \fIr\fR, not a regular expression as in
1111 the eponymous \fIed\fR(1) command.
1112 Any character may be used as the delimiter in place of `/';
1113 a `\e' can be used to quote the delimiter inside \fIl\fR and \fIr\fR.
1114 The character `&' in the \fIr\fR is replaced by \fIl\fR; `\e' also quotes `&'.
1115 If \fIl\fR is empty (``''), the \fIl\fR from a previous substitution or the
1116 \fIs\fR from a previous search or event number in event specification is used.
1117 The trailing delimiter may be omitted if it is immediately followed by a newline.
1118 .TP 8
1119 &
1120 Repeat the previous substitution.
1121 .TP 8
1122 g
1123 Apply the following modifier once to each word.
1124 .TP 8
1125 a (+)
1126 Apply the following modifier as many times as possible to a single word.
1127 `a' and `g' can be used together to apply a modifier globally.
1128 With the `s' modifier, only the patterns contained in the original word are
1129 substituted, not patterns that contain any substitution result.
1130 .TP 8
1131 p
1132 Print the new command line but do not execute it.
1133 .TP 8
1134 q
1135 Quote the substituted words, preventing further substitutions.
1136 .TP 8
1137 x
1138 Like q, but break into words at blanks, tabs and newlines.
1139 .PD
1140 .RE
1141 .PP
1142 Modifiers are applied to only the first modifiable word (unless `g' is used).
1143 It is an error for no word to be modifiable.
1144 .PP
1145 For example, the `diff' command might have been written as `diff wumpus.man.old
1146 !#^:r', using `:r' to remove `.old' from the first argument on the same line
1147 (`!#^').  We could say `echo hello out there', then `echo !*:u' to capitalize
1148 `hello', `echo !*:au' to say it out loud, or `echo !*:agu' to really shout.
1149 We might follow `mail \-s "I forgot my password" rot' with `!:s/rot/root' to
1150 correct the spelling of `root' (but see \fBSpelling correction\fR for a
1151 different approach).
1152 .PP
1153 There is a special abbreviation for substitutions.
1154 `^', when it is the first character on an input line, is equivalent to `!:s^'.
1155 Thus we might have said `^rot^root' to make the spelling correction in the
1156 previous example.
1157 This is the only history substitution which does not explicitly begin with `!'.
1158 .PP
1159 (+) In \fIcsh\fR as such, only one modifier may be applied to each history
1160 or variable expansion.  In \fItcsh\fR, more than one may be used, for example
1161 .IP "" 4
1162 % mv wumpus.man /usr/man/man1/wumpus.1
1163 .br
1164 % man !$:t:r
1165 .br
1166 man wumpus
1167 .PP
1168 In \fIcsh\fR, the result would be `wumpus.1:r'.  A substitution followed by a
1169 colon may need to be insulated from it with braces:
1170 .IP "" 4
1171 > mv a.out /usr/games/wumpus
1172 .br
1173 > setenv PATH !$:h:$PATH
1174 .br
1175 Bad ! modifier: $.
1176 .br
1177 > setenv PATH !{\-2$:h}:$PATH
1178 .br
1179 setenv PATH /usr/games:/bin:/usr/bin:.
1180 .PP
1181 The first attempt would succeed in \fIcsh\fR but fails in \fItcsh\fR,
1182 because \fItcsh\fR expects another modifier after the second colon
1183 rather than `$'.
1184 .PP
1185 Finally, history can be accessed through the editor as well as through
1186 the substitutions just described.
1187 The \fIup-\fR and \fIdown-history\fR, \fIhistory-search-backward\fR and
1188 \fI-forward\fR, \fIi-search-back\fR and \fI-fwd\fR,
1189 \fIvi-search-back\fR and \fI-fwd\fR, \fIcopy-prev-word\fR
1190 and \fIinsert-last-word\fR editor commands search for
1191 events in the history list and copy them into the input buffer.
1192 The \fItoggle-literal-history\fR editor command switches between the
1193 expanded and literal forms of history lines in the input buffer.
1194 \fIexpand-history\fR and \fIexpand-line\fR expand history substitutions
1195 in the current word and in the entire input buffer respectively.
1196 .SS "Alias substitution"
1197 The shell maintains a list of aliases which can be set, unset and printed by
1198 the \fIalias\fR and \fIunalias\fR commands.  After a command line is parsed
1199 into simple commands (see \fBCommands\fR) the first word of each command,
1200 left-to-right, is checked to see if it has an alias.  If so, the first word is
1201 replaced by the alias.  If the alias contains a history reference, it undergoes
1202 \fBHistory substitution\fR (q.v.) as though the original command were the
1203 previous input line.  If the alias does not contain a history reference, the
1204 argument list is left untouched.
1205 .PP
1206 Thus if the alias for `ls' were `ls \-l' the command `ls /usr' would become `ls
1207 \-l /usr', the argument list here being undisturbed.  If the alias for `lookup'
1208 were `grep !^ /etc/passwd' then `lookup bill' would become `grep bill
1209 /etc/passwd'.  Aliases can be used to introduce parser metasyntax.  For
1210 example, `alias print 'pr \e!* | lpr'' defines a ``command'' (`print') which
1211 \fIpr\fR(1)s its arguments to the line printer.
1212 .PP
1213 Alias substitution is repeated until the first word of the command has no
1214 alias.  If an alias substitution does not change the first word (as in the
1215 previous example) it is flagged to prevent a loop.  Other loops are detected and
1216 cause an error.
1217 .PP
1218 Some aliases are referred to by the shell; see \fBSpecial aliases\fR.
1219 .SS "Variable substitution"
1220 The shell maintains a list of variables, each of which has as value a list of
1221 zero or more words.
1222 The values of shell variables can be displayed and changed with the
1223 \fIset\fR and \fIunset\fR commands.
1224 The system maintains its own list of ``environment'' variables.
1225 These can be displayed and changed with \fIprintenv\fR, \fIsetenv\fR and
1226 \fIunsetenv\fR.
1227 .PP
1228 (+) Variables may be made read-only with `set \-r' (q.v.).
1229 Read-only variables may not be modified or unset;
1230 attempting to do so will cause an error.
1231 Once made read-only, a variable cannot be made writable,
1232 so `set \-r' should be used with caution.
1233 Environment variables cannot be made read-only.
1234 .PP
1235 Some variables are set by the shell or referred to by it.
1236 For instance, the \fBargv\fR variable is an image of the shell's argument
1237 list, and words of this variable's value are referred to in special ways.
1238 Some of the variables referred to by the shell are toggles;
1239 the shell does not care what their value is, only whether they are set or not.
1240 For instance, the \fBverbose\fR variable is a toggle which causes command
1241 input to be echoed.  The \fB\-v\fR command line option sets this variable.
1242 \fBSpecial shell variables\fR lists all variables which are referred to by the shell.
1243 .PP
1244 Other operations treat variables numerically.  The `@' command permits numeric
1245 calculations to be performed and the result assigned to a variable.  Variable
1246 values are, however, always represented as (zero or more) strings.  For the
1247 purposes of numeric operations, the null string is considered to be zero, and
1248 the second and subsequent words of multi-word values are ignored.
1249 .PP
1250 After the input line is aliased and parsed, and before each command is
1251 executed, variable substitution is performed keyed by `$' characters.  This
1252 expansion can be prevented by preceding the `$' with a `\e' except within `"'s
1253 where it \fIalways\fR occurs, and within `''s where it \fInever\fR occurs.
1254 Strings quoted by `\`' are interpreted later (see \fBCommand substitution\fR
1255 below) so `$' substitution does not occur there until later,
1256 if at all.  A `$' is passed unchanged if followed by a blank, tab, or
1257 end-of-line.
1258 .PP
1259 Input/output redirections are recognized before variable expansion, and are
1260 variable expanded separately.  Otherwise, the command name and entire argument
1261 list are expanded together.  It is thus possible for the first (command) word
1262 (to this point) to generate more than one word, the first of which becomes the
1263 command name, and the rest of which become arguments.
1264 .PP
1265 Unless enclosed in `"' or given the `:q' modifier the results of variable
1266 substitution may eventually be command and filename substituted.  Within `"', a
1267 variable whose value consists of multiple words expands to a (portion of a)
1268 single word, with the words of the variable's value separated by blanks.  When
1269 the `:q' modifier is applied to a substitution the variable will expand to
1270 multiple words with each word separated by a blank and quoted to prevent later
1271 command or filename substitution.
1272 .PP
1273 The following metasequences are provided for introducing variable values into
1274 the shell input.  Except as noted, it is an error to reference a variable which
1275 is not set.
1276 .PP
1277 .PD 0
1278 $\fIname\fR
1279 .TP 8
1280 ${\fIname\fR}
1281 Substitutes the words of the value of variable \fIname\fR, each separated
1282 by a blank.  Braces insulate \fIname\fR from following characters which would
1283 otherwise be part of it.  Shell variables have names consisting of
1284 letters and digits starting with a letter.  The underscore character is
1285 considered a letter.  If \fIname\fR is not a shell variable, but is set in the
1286 environment, then that value is returned (but some of the other forms
1287 given below are not available in this case).
1288 .PP
1289 $\fIname\fR[\fIselector\fR]
1290 .TP 8
1291 ${\fIname\fR[\fIselector\fR]}
1292 Substitutes only the selected words from the value of \fIname\fR.
1293 The \fIselector\fR is subjected to `$' substitution and may consist of
1294 a single number or two numbers separated by a `\-'.
1295 The first word of a variable's value is numbered `1'.
1296 If the first number of a range is omitted it defaults to `1'.
1297 If the last member of a range is omitted it defaults to `$#\fIname\fR'.
1298 The \fIselector\fR `*' selects all words.
1299 It is not an error for a range to be empty if the
1300 second argument is omitted or in range.
1301 .TP 8
1302 $0
1303 Substitutes the name of the file from which command input
1304 is being read.  An error occurs if the name is not known.
1305 .PP
1306 $\fInumber\fR
1307 .TP 8
1308 ${\fInumber\fR}
1309 Equivalent to `$argv[\fInumber\fR]'.
1310 .TP 8
1311 $*
1312 Equivalent to `$argv', which is equivalent to `$argv[*]'.
1313 .PD
1314 .PP
1315 The `:' modifiers described under \fBHistory substitution\fR, except for `:p',
1316 can be applied to the substitutions above.  More than one may be used.  (+)
1317 Braces may be needed to insulate a variable substitution from a literal colon
1318 just as with \fBHistory substitution\fR (q.v.); any modifiers must appear
1319 within the braces.
1320 .PP
1321 The following substitutions can not be modified with `:' modifiers.
1322 .PP
1323 .PD 0
1324 $?\fIname\fR
1325 .TP 8
1326 ${?\fIname\fR}
1327 Substitutes the string `1' if \fIname\fR is set, `0' if it is not.
1328 .TP 8
1329 $?0
1330 Substitutes `1' if the current input filename is known, `0' if it is not.
1331 Always `0' in interactive shells.
1332 .PP
1333 $#\fIname\fR
1334 .TP 8
1335 ${#\fIname\fR}
1336 Substitutes the number of words in \fIname\fR.
1337 .TP 8
1338 $#
1339 Equivalent to `$#argv'.  (+)
1340 .PP
1341 $%\fIname\fR
1342 .TP 8
1343 ${%\fIname\fR}
1344 Substitutes the number of characters in \fIname\fR.  (+)
1345 .PP
1346 $%\fInumber\fR
1347 .TP 8
1348 ${%\fInumber\fR}
1349 Substitutes the number of characters in $argv[\fInumber\fR].  (+)
1350 .TP 8
1351 $?
1352 Equivalent to `$status'.  (+)
1353 .TP 8
1354 $$
1355 Substitutes the (decimal) process number of the (parent) shell.
1356 .TP 8
1357 $!
1358 Substitutes the (decimal) process number of the last
1359 background process started by this shell.  (+)
1360 .TP 8
1361 $_
1362 Substitutes the command line of the last command executed.  (+)
1363 .TP 8
1364 $<
1365 Substitutes a line from the standard input, with no further interpretation
1366 thereafter.  It can be used to read from the keyboard in a shell script.
1367 (+) While \fIcsh\fR always quotes $<, as if it were equivalent to `$<:q',
1368 \fItcsh\fR does not.  Furthermore, when \fItcsh\fR is waiting for a line to be
1369 typed the user may type an interrupt to interrupt the sequence into
1370 which the line is to be substituted, but \fIcsh\fR does not allow this.
1371 .PD
1372 .PP
1373 The editor command \fIexpand-variables\fR, normally bound to `^X-$',
1374 can be used to interactively expand individual variables.
1375 .SS "Command, filename and directory stack substitution"
1376 The remaining substitutions are applied selectively to the arguments of builtin
1377 commands.  This means that portions of expressions which are not evaluated are
1378 not subjected to these expansions.  For commands which are not internal to the
1379 shell, the command name is substituted separately from the argument list.  This
1380 occurs very late, after input-output redirection is performed, and in a child
1381 of the main shell.
1382 .SS "Command substitution"
1383 Command substitution is indicated by a command enclosed in `\`'.  The output
1384 from such a command is broken into separate words at blanks, tabs and newlines,
1385 and null words are discarded.  The output is variable and command substituted
1386 and put in place of the original string.
1387 .PP
1388 Command substitutions inside double
1389 quotes (`"') retain blanks and tabs; only newlines force new words.  The single
1390 final newline does not force a new word in any case.  It is thus possible for a
1391 command substitution to yield only part of a word, even if the command outputs
1392 a complete line.
1393 .PP
1394 By default, the shell since version 6.12 replaces all newline and carriage 
1395 return characters in the command by spaces.  If this is switched off by
1396 unsetting \fBcsubstnonl\fR, newlines separate commands as usual.
1397 .SS "Filename substitution"
1398 If a word contains any of the characters `*', `?', `[' or `{' or begins with
1399 the character `~' it is a candidate for filename substitution, also known as
1400 ``globbing''.  This word is then regarded as a pattern (``glob-pattern''), and
1401 replaced with an alphabetically sorted list of file names which match the
1402 pattern.
1403 .PP
1404 In matching filenames, the character `.' at the beginning of a filename or
1405 immediately following a `/', as well as the character `/' must be matched
1406 explicitly (unless either
1407 .B globdot
1408 or
1409 .B globstar
1410 or both are set(+)).  The character `*' matches any string of characters, 
1411 including the null string.  The character `?' matches any single character.  
1412 The sequence `[...]' matches any one of the characters enclosed.  
1413 Within `[...]', a pair of
1414 characters separated by `\-' matches any character lexically between the two.
1415 .PP
1416 (+) Some glob-patterns can be negated:
1417 The sequence `[^...]' matches any single character \fInot\fR specified by the
1418 characters and/or ranges of characters in the braces.
1419 .PP
1420 An entire glob-pattern can also be negated with `^':
1421 .IP "" 4
1422 > echo *
1423 .br
1424 bang crash crunch ouch
1425 .br
1426 > echo ^cr*
1427 .br
1428 bang ouch
1429 .PP
1430 Glob-patterns which do not use `?', `*', or `[]' or which use `{}' or `~'
1431 (below) are not negated correctly.
1432 .PP
1433 The metanotation `a{b,c,d}e' is a shorthand for `abe ace ade'.
1434 Left-to-right order is preserved: `/usr/source/s1/{oldls,ls}.c' expands
1435 to `/usr/source/s1/oldls.c /usr/source/s1/ls.c'.  The results of matches are
1436 sorted separately at a low level to preserve this order:
1437 `../{memo,*box}' might expand to `../memo ../box ../mbox'.
1438 (Note that `memo' was not sorted with the results of matching `*box'.)
1439 It is not an error when this construct expands to files which do not exist,
1440 but it is possible to get an error from a command to which the expanded list
1441 is passed.
1442 This construct may be nested.
1443 As a special case the words `{', `}' and `{}' are passed undisturbed.
1444 .PP
1445 The character `~' at the beginning of a filename refers to home directories.
1446 Standing alone, i.e., `~', it expands to the invoker's home directory as
1447 reflected in the value of the \fBhome\fR shell variable.  When followed by a
1448 name consisting of letters, digits and `\-' characters the shell searches for a
1449 user with that name and substitutes their home directory; thus `~ken' might
1450 expand to `/usr/ken' and `~ken/chmach' to `/usr/ken/chmach'.  If the character
1451 `~' is followed by a character other than a letter or `/' or appears elsewhere
1452 than at the beginning of a word, it is left undisturbed.
1453 A command like `setenv MANPATH /usr/man:/usr/local/man:~/lib/man' does not,
1454 therefore, do home directory substitution as one might hope.
1455 .PP
1456 It is an error for a glob-pattern containing `*', `?', `[' or `~', with or
1457 without `^', not to match any files.  However, only one pattern in a list of
1458 glob-patterns must match a file (so that, e.g., `rm *.a *.c *.o' would fail
1459 only if there were no files in the current directory ending in `.a', `.c', or
1460 `.o'), and if the \fBnonomatch\fR shell variable is set a pattern (or list
1461 of patterns) which matches nothing is left unchanged rather than causing
1462 an error.
1463 .PP
1464 The \fBglobstar\fR shell variable can be set to allow `**' or `***' as 
1465 a file glob pattern that matches any string of characters including `/',
1466 recursively traversing any existing sub-directories.  For example, 
1467 `ls **.c' will list all the .c files in the current directory tree.
1468 If used by itself, it will match zero or more sub-directories
1469 (e.g. `ls /usr/include/**/time.h' will list any file named `time.h'
1470 in the /usr/include directory tree; `ls /usr/include/**time.h' will match 
1471 any file in the /usr/include directory tree ending in `time.h'; and
1472 `ls /usr/include/**time**.h' will match any .h file with `time' either
1473 in a subdirectory name or in the filename itself).
1474 To prevent problems with recursion, the `**' glob-pattern will not 
1475 descend into a symbolic link containing a directory.  To override this,
1476 use `***' (+)
1477 .PP
1478 The \fBnoglob\fR shell variable can be set to prevent filename substitution,
1479 and the \fIexpand-glob\fR editor command, normally bound to `^X-*', can be
1480 used to interactively expand individual filename substitutions.
1481 .SS "Directory stack substitution (+)"
1482 The directory stack is a list of directories, numbered from zero, used by the
1483 \fIpushd\fR, \fIpopd\fR and \fIdirs\fR builtin commands (q.v.).
1484 \fIdirs\fR can print, store in a file, restore and clear the directory stack
1485 at any time, and the \fBsavedirs\fR and \fBdirsfile\fR shell variables can be set to
1486 store the directory stack automatically on logout and restore it on login.
1487 The \fBdirstack\fR shell variable can be examined to see the directory stack and
1488 set to put arbitrary directories into the directory stack.
1489 .PP
1490 The character `=' followed by one or more digits expands to an entry in
1491 the directory stack.  The special case `=\-' expands to the last directory in
1492 the stack.  For example,
1493 .IP "" 4
1494 > dirs \-v
1495 .br
1496 0       /usr/bin
1497 .br
1498 1       /usr/spool/uucp
1499 .br
1500 2       /usr/accts/sys
1501 .br
1502 > echo =1
1503 .br
1504 /usr/spool/uucp
1505 .br
1506 > echo =0/calendar
1507 .br
1508 /usr/bin/calendar
1509 .br
1510 > echo =\-
1511 .br
1512 /usr/accts/sys
1513 .PP
1514 The \fBnoglob\fR and \fBnonomatch\fR shell variables and the \fIexpand-glob\fR
1515 editor command apply to directory stack as well as filename substitutions.
1516 .SS "Other substitutions (+)"
1517 There are several more transformations involving filenames, not strictly
1518 related to the above but mentioned here for completeness.
1519 \fIAny\fR filename may be expanded to a full path when the
1520 \fBsymlinks\fR variable (q.v.) is set to `expand'.
1521 Quoting prevents this expansion, and
1522 the \fInormalize-path\fR editor command does it on demand.
1523 The \fInormalize-command\fR editor command expands commands in PATH into
1524 full paths on demand.
1525 Finally, \fIcd\fR and \fIpushd\fR interpret `\-' as the old working directory
1526 (equivalent to the shell variable \fBowd\fR).
1527 This is not a substitution at all, but an abbreviation recognized by only
1528 those commands.  Nonetheless, it too can be prevented by quoting.
1529 .SS Commands
1530 The next three sections describe how the shell executes commands and
1531 deals with their input and output.
1532 .SS Simple commands, pipelines and sequences
1533 A simple command is a sequence of words, the first of which specifies the
1534 command to be executed.  A series of simple commands joined by `|' characters
1535 forms a pipeline.  The output of each command in a pipeline is connected to the
1536 input of the next.
1537 .PP
1538 Simple commands and pipelines may be joined into sequences with `;', and will
1539 be executed sequentially.  Commands and pipelines can also be joined into
1540 sequences with `||' or `&&', indicating, as in the C language, that the second
1541 is to be executed only if the first fails or succeeds respectively.
1542 .PP
1543 A simple command, pipeline or sequence may be placed in parentheses, `()',
1544 to form a simple command, which may in turn be a component of a pipeline or
1545 sequence.  A command, pipeline or sequence can be executed
1546 without waiting for it to terminate by following it with an `&'.
1547 .SS "Builtin and non-builtin command execution"
1548 Builtin commands are executed within the shell.  If any component of a
1549 pipeline except the last is a builtin command, the pipeline is executed
1550 in a subshell.
1551 .PP
1552 Parenthesized commands are always executed in a subshell.
1553 .IP "" 4
1554 (cd; pwd); pwd
1555 .PP
1556 thus prints the \fBhome\fR directory, leaving you where you were
1557 (printing this after the home directory), while
1558 .IP "" 4
1559 cd; pwd
1560 .PP
1561 leaves you in the \fBhome\fR directory.  Parenthesized commands are most often
1562 used to prevent \fIcd\fR from affecting the current shell.
1563 .PP
1564 When a command to be executed is found not to be a builtin command the shell
1565 attempts to execute the command via \fIexecve\fR(2).  Each word in the variable
1566 \fBpath\fR names a directory in which the shell will look for the
1567 command.  If the shell is not given a \fB\-f\fR option, the shell
1568 hashes the names in these directories into an internal table so that it will
1569 try an \fIexecve\fR(2) in only a directory where there is a possibility that the
1570 command resides there.  This greatly speeds command location when a large
1571 number of directories are present in the search path. This hashing mechanism is
1572 not used:
1573 .TP 4
1574 .B 1.
1575 If hashing is turned explicitly off via \fIunhash\fR.
1576 .TP 4
1577 .B 2.
1578 If the shell was given a \fB\-f\fR argument.
1579 .TP 4
1580 .B 3.
1581 For each directory component of \fBpath\fR which does not begin with a `/'.
1582 .TP 4
1583 .B 4.
1584 If the command contains a `/'.
1585 .PP
1586 In the above four cases the shell concatenates each component of the path
1587 vector with the given command name to form a path name of a file which it
1588 then attempts to execute it. If execution is successful, the search stops.
1589 .PP
1590 If the file has execute permissions but is not an executable to the system
1591 (i.e., it is neither an executable binary nor a script that specifies its
1592 interpreter), then it is assumed to be a file containing shell commands and
1593 a new shell is spawned to read it.  The \fIshell\fR special alias may be set
1594 to specify an interpreter other than the shell itself.
1595 .PP
1596 On systems which do not understand the `#!' script interpreter convention
1597 the shell may be compiled to emulate it; see the \fBversion\fR shell
1598 variable.  If so, the shell checks the first line of the file to
1599 see if it is of the form `#!\fIinterpreter\fR \fIarg\fR ...'.  If it is,
1600 the shell starts \fIinterpreter\fR with the given \fIarg\fRs and feeds the
1601 file to it on standard input.
1602 .SS Input/output
1603 The standard input and standard output of a command may be redirected with the
1604 following syntax:
1605 .PP
1606 .PD 0
1607 .TP 8
1608 < \fIname
1609 Open file \fIname\fR (which is first variable, command and filename
1610 expanded) as the standard input.
1611 .TP 8
1612 << \fIword
1613 Read the shell input up to a line which is identical to \fIword\fR.  \fIword\fR
1614 is not subjected to variable, filename or command substitution, and each input
1615 line is compared to \fIword\fR before any substitutions are done on this input
1616 line.  Unless a quoting `\e', `"', `' or `\`' appears in \fIword\fR variable and
1617 command substitution is performed on the intervening lines, allowing `\e' to
1618 quote `$', `\e' and `\`'.  Commands which are substituted have all blanks, tabs,
1619 and newlines preserved, except for the final newline which is dropped.  The
1620 resultant text is placed in an anonymous temporary file which is given to the
1621 command as standard input.
1622 .PP
1623 > \fIname
1624 .br
1625 >! \fIname
1626 .br
1627 >& \fIname
1628 .TP 8
1629 >&! \fIname
1630 The file \fIname\fR is used as standard output.  If the file does not exist
1631 then it is created; if the file exists, it is truncated, its previous contents
1632 being lost.
1633 .RS +8
1634 .PD
1635 .PP
1636 If the shell variable \fBnoclobber\fR is set, then the file must not exist or be a
1637 character special file (e.g., a terminal or `/dev/null') or an error results.
1638 This helps prevent accidental destruction of files.  In this case the `!' forms
1639 can be used to suppress this check.
1640 If \fBnotempty\fR is given in \fBnoclobber\fR, `>' is allowed on empty files;
1641 if \fBask\fR is set, an interacive confirmation is presented, rather than an
1642 error.
1643 .PP
1644 The forms involving `&' route the diagnostic output into the specified file as
1645 well as the standard output.  \fIname\fR is expanded in the same way as `<'
1646 input filenames are.
1647 .PD 0
1648 .RE
1649 .PP
1650 >> \fIname
1651 .br
1652 >>& \fIname
1653 .br
1654 >>! \fIname
1655 .TP 8
1656 >>&! \fIname
1657 Like `>', but appends output to the end of \fIname\fR.
1658 If the shell variable \fBnoclobber\fR is set, then it is an error for
1659 the file \fInot\fR to exist, unless one of the `!' forms is given.
1660 .PD
1661 .PP
1662 A command receives the environment in which the shell was invoked as modified
1663 by the input-output parameters and the presence of the command in a pipeline.
1664 Thus, unlike some previous shells, commands run from a file of shell commands
1665 have no access to the text of the commands by default; rather they receive the
1666 original standard input of the shell.  The `<<' mechanism should be used to
1667 present inline data.  This permits shell command scripts to function as
1668 components of pipelines and allows the shell to block read its input.  Note
1669 that the default standard input for a command run detached is \fInot\fR
1670 the empty file \fI/dev/null\fR, but the original standard input of the shell.
1671 If this is a terminal and if the process attempts to read from the terminal,
1672 then the process will block and the user will be notified (see \fBJobs\fR).
1673 .PP
1674 Diagnostic output may be directed through a pipe with the standard output.
1675 Simply use the form `|&' rather than just `|'.
1676 .PP
1677 The shell cannot presently redirect diagnostic output without also redirecting
1678 standard output, but `(\fIcommand\fR > \fIoutput-file\fR) >& \fIerror-file\fR'
1679 is often an acceptable workaround.  Either \fIoutput-file\fR or
1680 \fIerror-file\fR may be `/dev/tty' to send output to the terminal.
1681 .SS Features
1682 Having described how the shell accepts, parses and executes
1683 command lines, we now turn to a variety of its useful features.
1684 .SS "Control flow"
1685 The shell contains a number of commands which can be used to regulate the
1686 flow of control in command files (shell scripts) and (in limited but
1687 useful ways) from terminal input.  These commands all operate by forcing the
1688 shell to reread or skip in its input and, due to the implementation,
1689 restrict the placement of some of the commands.
1690 .PP
1691 The \fIforeach\fR, \fIswitch\fR, and \fIwhile\fR statements, as well as the
1692 \fIif-then-else\fR form of the \fIif\fR statement, require that the major
1693 keywords appear in a single simple command on an input line as shown below.
1694 .PP
1695 If the shell's input is not seekable, the shell buffers up input whenever
1696 a loop is being read and performs seeks in this internal buffer to
1697 accomplish the rereading implied by the loop.  (To the extent that this
1698 allows, backward \fIgoto\fRs will succeed on non-seekable inputs.)
1699 .SS Expressions
1700 The \fIif\fR, \fIwhile\fR and \fIexit\fR builtin commands
1701 use expressions with a common syntax.  The expressions can include any
1702 of the operators described in the next three sections.  Note that the \fI@\fR
1703 builtin command (q.v.) has its own separate syntax.
1704 .SS "Logical, arithmetical and comparison operators"
1705 These operators are similar to those of C and have the same precedence.
1706 They include
1707 .IP "" 4
1708 ||  &&  |  ^  &  ==  !=  =~  !~  <=  >=
1709 .br
1710 <  > <<  >>  +  \-  *  /  %  !  ~  (  )
1711 .PP
1712 Here the precedence increases to the right, `==' `!=' `=~' and `!~', `<='
1713 `>=' `<' and `>', `<<' and `>>', `+' and `\-', `*' `/' and `%' being, in
1714 groups, at the same level.  The `==' `!=' `=~' and `!~' operators compare
1715 their arguments as strings; all others operate on numbers.  The operators
1716 `=~' and `!~' are like `!=' and `==' except that the right hand side is a
1717 glob-pattern (see \fBFilename substitution\fR) against which the left hand
1718 operand is matched.  This reduces the need for use of the \fIswitch\fR
1719 builtin command in shell scripts when all that is really needed is
1720 pattern matching.
1721 .PP
1722 Null or
1723 missing arguments are considered `0'.  The results of all expressions are
1724 strings, which represent decimal numbers.  It is important to note that
1725 no two components of an expression can appear in the same word; except
1726 when adjacent to components of expressions which are syntactically
1727 significant to the parser (`&' `|' `<' `>' `(' `)') they should be
1728 surrounded by spaces.
1729 .SS "Command exit status"
1730 Commands can be executed in expressions and their exit status
1731 returned by enclosing them in braces (`{}').  Remember that the braces should
1732 be separated from the words of the command by spaces.  Command executions
1733 succeed, returning true, i.e., `1', if the command exits with status 0,
1734 otherwise they fail, returning false, i.e., `0'.  If more detailed status
1735 information is required then the command should be executed outside of an
1736 expression and the \fBstatus\fR shell variable examined.
1737 .SS "File inquiry operators"
1738 Some of these operators perform true/false tests on files and related
1739 objects.  They are of the form \fB\-\fIop file\fR, where \fIop\fR is one of
1740 .PP
1741 .PD 0
1742 .RS +4
1743 .TP 4
1744 .B r
1745 Read access
1746 .TP 4
1747 .B w
1748 Write access
1749 .TP 4
1750 .B x
1751 Execute access
1752 .TP 4
1753 .B X
1754 Executable in the path or shell builtin, e.g., `\-X ls' and `\-X ls\-F' are
1755 generally true, but `\-X /bin/ls' is not (+)
1756 .TP 4
1757 .B e
1758 Existence
1759 .TP 4
1760 .B o
1761 Ownership
1762 .TP 4
1763 .B z
1764 Zero size
1765 .TP 4
1766 .B s
1767 Non-zero size (+)
1768 .TP 4
1769 .B f
1770 Plain file
1771 .TP 4
1772 .B d
1773 Directory
1774 .TP 4
1775 .B l
1776 Symbolic link (+) *
1777 .TP 4
1778 .B b
1779 Block special file (+)
1780 .TP 4
1781 .B c
1782 Character special file (+)
1783 .TP 4
1784 .B p
1785 Named pipe (fifo) (+) *
1786 .TP 4
1787 .B S
1788 Socket special file (+) *
1789 .TP 4
1790 .B u
1791 Set-user-ID bit is set (+)
1792 .TP 4
1793 .B g
1794 Set-group-ID bit is set (+)
1795 .TP 4
1796 .B k
1797 Sticky bit is set (+)
1798 .TP 4
1799 .B t
1800 \fIfile\fR (which must be a digit) is an open file descriptor
1801 for a terminal device (+)
1802 .TP 4
1803 .B R
1804 Has been migrated (Convex only) (+)
1805 .TP 4
1806 .B L
1807 Applies subsequent operators in a multiple-operator test to a symbolic link
1808 rather than to the file to which the link points (+) *
1809 .RE
1810 .PD
1811 .PP
1812 \fIfile\fR is command and filename expanded and then tested to
1813 see if it has the specified relationship to the real user.  If \fIfile\fR
1814 does not exist or is inaccessible or, for the operators indicated by `*',
1815 if the specified file type does not exist on the current system,
1816 then all inquiries return false, i.e., `0'.
1817 .PP
1818 These operators may be combined for conciseness: `\-\fIxy file\fR' is
1819 equivalent to `\-\fIx file\fR && \-\fIy file\fR'.  (+) For example, `\-fx' is true
1820 (returns `1') for plain executable files, but not for directories.
1821 .PP
1822 \fBL\fR may be used in a multiple-operator test to apply subsequent operators
1823 to a symbolic link rather than to the file to which the link points.
1824 For example, `\-lLo' is true for links owned by the invoking user.
1825 \fBLr\fR, \fBLw\fR and \fBLx\fR are always true for links and false for
1826 non-links.  \fBL\fR has a different meaning when it is the last operator
1827 in a multiple-operator test; see below.
1828 .PP
1829 It is possible but not useful, and sometimes misleading, to combine operators
1830 which expect \fIfile\fR to be a file with operators which do not
1831 (e.g., \fBX\fR and \fBt\fR).  Following \fBL\fR with a non-file operator
1832 can lead to particularly strange results.
1833 .PP
1834 Other operators return other information, i.e., not just `0' or `1'.  (+)
1835 They have the same format as before; \fIop\fR may be one of
1836 .PP
1837 .PD 0
1838 .RS +4
1839 .TP 8
1840 .B A
1841 Last file access time, as the number of seconds since the epoch
1842 .TP 8
1843 .B A:
1844 Like \fBA\fR, but in timestamp format, e.g., `Fri May 14 16:36:10 1993'
1845 .TP 8
1846 .B M
1847 Last file modification time
1848 .TP 8
1849 .B M:
1850 Like \fBM\fR, but in timestamp format
1851 .TP 8
1852 .B C
1853 Last inode modification time
1854 .TP 8
1855 .B C:
1856 Like \fBC\fR, but in timestamp format
1857 .TP 8
1858 .B D
1859 Device number
1860 .TP 8
1861 .B I
1862 Inode number
1863 .TP 8
1864 .B F
1865 Composite \fBf\fRile identifier, in the form \fIdevice\fR:\fIinode\fR
1866 .TP 8
1867 .B L
1868 The name of the file pointed to by a symbolic link
1869 .TP 8
1870 .B N
1871 Number of (hard) links
1872 .TP 8
1873 .B P
1874 Permissions, in octal, without leading zero
1875 .TP 8
1876 .B P:
1877 Like \fBP\fR, with leading zero
1878 .TP 8
1879 .B P\fImode
1880 Equivalent to `\-P \fIfile\fR & \fImode\fR', e.g., `\-P22 \fIfile\fR' returns
1881 `22' if \fIfile\fR is writable by group and other, `20' if by group only,
1882 and `0' if by neither
1883 .TP 8
1884 .B P\fImode\fB:
1885 Like \fBP\fImode\fR, with leading zero
1886 .TP 8
1887 .B U
1888 Numeric userid
1889 .TP 8
1890 .B U:
1891 Username, or the numeric userid if the username is unknown
1892 .TP 8
1893 .B G
1894 Numeric groupid
1895 .TP 8
1896 .B G:
1897 Groupname, or the numeric groupid if the groupname is unknown
1898 .TP 8
1899 .B Z
1900 Size, in bytes
1901 .RE
1902 .PD
1903 .PP
1904 Only one of these operators may appear in a multiple-operator test, and it
1905 must be the last.  Note that \fBL\fR has a different meaning at the end of and
1906 elsewhere in a multiple-operator test.  Because `0' is a valid return value
1907 for many of these operators, they do not return `0' when they fail: most
1908 return `\-1', and \fBF\fR returns `:'.
1909 .PP
1910 If the shell is compiled with POSIX defined (see the \fBversion\fR shell
1911 variable), the result of a file inquiry is based on the permission bits of
1912 the file and not on the result of the \fIaccess\fR(2) system call.
1913 For example, if one tests a file with \fB\-w\fR whose permissions would
1914 ordinarily allow writing but which is on a file system mounted read-only,
1915 the test will succeed in a POSIX shell but fail in a non-POSIX shell.
1916 .PP
1917 File inquiry operators can also be evaluated with the \fIfiletest\fR builtin
1918 command (q.v.) (+).
1919 .SS Jobs
1920 The shell associates a \fIjob\fR with each pipeline.  It keeps a table of
1921 current jobs, printed by the \fIjobs\fR command, and assigns them small integer
1922 numbers.  When a job is started asynchronously with `&', the shell prints a
1923 line which looks like
1924 .IP "" 4
1925 [1] 1234
1926 .PP
1927 indicating that the job which was started asynchronously was job number 1 and
1928 had one (top-level) process, whose process id was 1234.
1929 .PP
1930 If you are running a job and wish to do something else you may hit the suspend
1931 key (usually `^Z'),
1932 which sends a STOP signal to the current job.  The shell will then normally
1933 indicate that the job has been `Suspended' and print another prompt.
1934 If the \fBlistjobs\fR shell variable is set, all jobs will be listed
1935 like the \fIjobs\fR builtin command; if it is set to `long' the listing will
1936 be in long format, like `jobs \-l'.
1937 You can then manipulate the state of the suspended job.
1938 You can put it in the
1939 ``background'' with the \fIbg\fR command or run some other commands and
1940 eventually bring the job back into the ``foreground'' with \fIfg\fR.
1941 (See also the \fIrun-fg-editor\fR editor command.)
1942 A `^Z' takes effect immediately and is like an interrupt
1943 in that pending output and unread input are discarded when it is typed.
1944 The \fIwait\fR builtin command causes the shell to wait for all background
1945 jobs to complete.
1946 .PP
1947 The `^]' key sends a delayed suspend signal, which does not generate a STOP
1948 signal until a program attempts to \fIread\fR(2) it, to the current job.
1949 This can usefully be typed ahead when you have prepared some commands for a
1950 job which you wish to stop after it has read them.
1951 The `^Y' key performs this function in \fIcsh\fR(1); in \fItcsh\fR,
1952 `^Y' is an editing command.  (+)
1953 .PP
1954 A job being run in the background stops if it tries to read from the
1955 terminal.  Background jobs are normally allowed to produce output, but this can
1956 be disabled by giving the command `stty tostop'.  If you set this tty option,
1957 then background jobs will stop when they try to produce output like they do
1958 when they try to read input.
1959 .PP
1960 There are several ways to refer to jobs in the shell.  The character `%'
1961 introduces a job name.  If you wish to refer to job number 1, you can name it
1962 as `%1'.  Just naming a job brings it to the foreground; thus `%1' is a synonym
1963 for `fg %1', bringing job 1 back into the foreground.  Similarly, saying `%1 &'
1964 resumes job 1 in the background, just like `bg %1'.  A job can also be named
1965 by an unambiguous prefix of the string typed in to start it: `%ex' would
1966 normally restart a suspended \fIex\fR(1) job, if there were only one suspended
1967 job whose name began with the string `ex'.  It is also possible to say
1968 `%?\fIstring\fR' to specify a job whose text contains \fIstring\fR, if there
1969 is only one such job.
1970 .PP
1971 The shell maintains a notion of the current and previous jobs.  In output
1972 pertaining to jobs, the current job is marked with a `+' and the previous job
1973 with a `\-'.  The abbreviations `%+', `%', and (by analogy with the syntax of
1974 the \fIhistory\fR mechanism) `%%' all refer to the current job, and `%\-' refers
1975 to the previous job.
1976 .PP
1977 The job control mechanism requires that the \fIstty\fR(1) option `new' be set
1978 on some systems.  It is an artifact from a `new' implementation of the tty
1979 driver which allows generation of interrupt characters from the keyboard to
1980 tell jobs to stop.  See \fIstty\fR(1) and the \fIsetty\fR builtin command for
1981 details on setting options in the new tty driver.
1982 .SS "Status reporting"
1983 The shell learns immediately whenever a process changes state.  It normally
1984 informs you whenever a job becomes blocked so that no further progress is
1985 possible, but only right before it prints a prompt.  This is done so that it
1986 does not otherwise disturb your work.  If, however, you set the shell variable
1987 \fBnotify\fR, the shell will notify you immediately of changes of status in
1988 background jobs.  There is also a shell command \fInotify\fR which marks a
1989 single process so that its status changes will be immediately reported.  By
1990 default \fInotify\fR marks the current process; simply say `notify' after
1991 starting a background job to mark it.
1992 .PP
1993 When you try to leave the shell while jobs are stopped, you will be
1994 warned that `There are suspended jobs.' You may use the \fIjobs\fR command to
1995 see what they are.  If you do this or immediately try to exit again, the shell
1996 will not warn you a second time, and the suspended jobs will be terminated.
1997 .SS "Automatic, periodic and timed events (+)"
1998 There are various ways to run commands and take other actions automatically
1999 at various times in the ``life cycle'' of the shell.  They are summarized here,
2000 and described in detail under the appropriate \fBBuiltin commands\fR,
2001 \fBSpecial shell variables\fR and \fBSpecial aliases\fR.
2002 .PP
2003 The \fIsched\fR builtin command puts commands in a scheduled-event list,
2004 to be executed by the shell at a given time.
2005 .PP
2006 The \fIbeepcmd\fR, \fIcwdcmd\fR, \fIperiodic\fR, \fIprecmd\fR, \fIpostcmd\fR,
2007 and \fIjobcmd\fR
2008 \fBSpecial aliases\fR can be set, respectively, to execute commands when the shell wants
2009 to ring the bell, when the working directory changes, every \fBtperiod\fR
2010 minutes, before each prompt, before each command gets executed, after each
2011 command gets executed, and when a job is started or is brought into the
2012 foreground.
2013 .PP
2014 The \fBautologout\fR shell variable can be set to log out or lock the shell
2015 after a given number of minutes of inactivity.
2016 .PP
2017 The \fBmail\fR shell variable can be set to check for new mail periodically.
2018 .PP
2019 The \fBprintexitvalue\fR shell variable can be set to print the exit status
2020 of commands which exit with a status other than zero.
2021 .PP
2022 The \fBrmstar\fR shell variable can be set to ask the user, when `rm *' is
2023 typed, if that is really what was meant.
2024 .PP
2025 The \fBtime\fR shell variable can be set to execute the \fItime\fR builtin
2026 command after the completion of any process that takes more than a given
2027 number of CPU seconds.
2028 .PP
2029 The \fBwatch\fR and \fBwho\fR shell variables can be set to report when
2030 selected users log in or out, and the \fIlog\fR builtin command reports
2031 on those users at any time.
2032 .SS "Native Language System support (+)"
2033 The shell is eight bit clean
2034 (if so compiled; see the \fBversion\fR shell variable)
2035 and thus supports character sets needing this capability.
2036 NLS support differs depending on whether or not
2037 the shell was compiled to use the system's NLS (again, see \fBversion\fR).
2038 In either case, 7-bit ASCII is the default character code
2039 (e.g., the classification of which characters are printable) and sorting,
2040 and changing the \fBLANG\fR or \fBLC_CTYPE\fR environment variables
2041 causes a check for possible changes in these respects.
2042 .PP
2043 When using the system's NLS, the \fIsetlocale\fR(3) function is called
2044 to determine appropriate character code/classification and sorting
2045 (e.g., a 'en_CA.UTF-8' would yield "UTF-8" as a character code).
2046 This function typically examines the \fBLANG\fR and \fBLC_CTYPE\fR
2047 environment variables; refer to the system documentation for further details.
2048 When not using the system's NLS, the shell simulates it by assuming that the
2049 ISO 8859-1 character set is used
2050 whenever either of the \fBLANG\fR and \fBLC_CTYPE\fR variables are set, regardless of
2051 their values.  Sorting is not affected for the simulated NLS.
2052 .PP
2053 In addition, with both real and simulated NLS, all printable
2054 characters in the range \e200\-\e377, i.e., those that have
2055 M-\fIchar\fR bindings, are automatically rebound to \fIself-insert-command\fR.
2056 The corresponding binding for the escape-\fIchar\fR sequence, if any, is
2057 left alone.
2058 These characters are not rebound if the \fBNOREBIND\fR environment variable
2059 is set.  This may be useful for the simulated NLS or a primitive real NLS
2060 which assumes full ISO 8859-1.  Otherwise, all M-\fIchar\fR bindings in the
2061 range \e240\-\e377 are effectively undone.
2062 Explicitly rebinding the relevant keys with \fIbindkey\fR
2063 is of course still possible.
2064 .PP
2065 Unknown characters (i.e., those that are neither printable nor control
2066 characters) are printed in the format \ennn.
2067 If the tty is not in 8 bit mode, other 8 bit characters are printed by
2068 converting them to ASCII and using standout mode.  The shell
2069 never changes the 7/8 bit mode of the tty and tracks user-initiated
2070 changes of 7/8 bit mode.  NLS users (or, for that matter, those who want to
2071 use a meta key) may need to explicitly set
2072 the tty in 8 bit mode through the appropriate \fIstty\fR(1)
2073 command in, e.g., the \fI~/.login\fR file.
2074 .SS "OS variant support (+)"
2075 A number of new builtin commands are provided to support features in
2076 particular operating systems.  All are described in detail in the
2077 \fBBuiltin commands\fR section.
2078 .PP
2079 On systems that support TCF (aix-ibm370, aix-ps2),
2080 \fIgetspath\fR and \fIsetspath\fR get and set the system execution path,
2081 \fIgetxvers\fR and \fIsetxvers\fR get and set the experimental version prefix
2082 and \fImigrate\fR migrates processes between sites.  The \fIjobs\fR builtin
2083 prints the site on which each job is executing.
2084 .PP
2085 Under BS2000, \fIbs2cmd\fR executes commands of the underlying BS2000/OSD
2086 operating system.
2087 .PP
2088 Under Domain/OS, \fIinlib\fR adds shared libraries to the current environment,
2089 \fIrootnode\fR changes the rootnode and \fIver\fR changes the systype.
2090 .PP
2091 Under Mach, \fIsetpath\fR is equivalent to Mach's \fIsetpath\fR(1).
2092 .PP
2093 Under Masscomp/RTU and Harris CX/UX, \fIuniverse\fR sets the universe.
2094 .PP
2095 Under Harris CX/UX, \fIucb\fR or \fIatt\fR runs a command under the specified
2096 universe.
2097 .PP
2098 Under Convex/OS, \fIwarp\fR prints or sets the universe.
2099 .PP
2100 The \fBVENDOR\fR, \fBOSTYPE\fR and \fBMACHTYPE\fR environment variables
2101 indicate respectively the vendor, operating system and machine type
2102 (microprocessor class or machine model) of the
2103 system on which the shell thinks it is running.
2104 These are particularly useful when sharing one's home directory between several
2105 types of machines; one can, for example,
2106 .IP "" 4
2107 set path = (~/bin.$MACHTYPE /usr/ucb /bin /usr/bin .)
2108 .PP
2109 in one's \fI~/.login\fR and put executables compiled for each machine in the
2110 appropriate directory.
2111 .PP
2112 The \fBversion\fR shell
2113 variable indicates what options were chosen when the shell was compiled.
2114 .PP
2115 Note also the \fInewgrp\fR builtin, the \fBafsuser\fR and
2116 \fBecho_style\fR shell variables and the system-dependent locations of
2117 the shell's input files (see \fBFILES\fR).
2118 .SS "Signal handling"
2119 Login shells ignore interrupts when reading the file \fI~/.logout\fR.
2120 The shell ignores quit signals unless started with \fB\-q\fR.
2121 Login shells catch the terminate signal, but non-login shells inherit the
2122 terminate behavior from their parents.
2123 Other signals have the values which the shell inherited from its parent.
2124 .PP
2125 In shell scripts, the shell's handling of interrupt and terminate signals
2126 can be controlled with \fIonintr\fR, and its handling of hangups can be
2127 controlled with \fIhup\fR and \fInohup\fR.
2128 .PP
2129 The shell exits on a hangup (see also the \fBlogout\fR shell variable).  By
2130 default, the shell's children do too, but the shell does not send them a
2131 hangup when it exits.  \fIhup\fR arranges for the shell to send a hangup to
2132 a child when it exits, and \fInohup\fR sets a child to ignore hangups.
2133 .SS "Terminal management (+)"
2134 The shell uses three different sets of terminal (``tty'') modes:
2135 `edit', used when editing, `quote', used when quoting literal characters,
2136 and `execute', used when executing commands.
2137 The shell holds some settings in each mode constant, so commands which leave
2138 the tty in a confused state do not interfere with the shell.
2139 The shell also matches changes in the speed and padding of the tty.
2140 The list of tty modes that are kept constant
2141 can be examined and modified with the \fIsetty\fR builtin.
2142 Note that although the editor uses CBREAK mode (or its equivalent),
2143 it takes typed-ahead characters anyway.
2144 .PP
2145 The \fIechotc\fR, \fIsettc\fR and \fItelltc\fR commands can be used to
2146 manipulate and debug terminal capabilities from the command line.
2147 .PP
2148 On systems that support SIGWINCH or SIGWINDOW, the shell
2149 adapts to window resizing automatically and adjusts the environment
2150 variables \fBLINES\fR and \fBCOLUMNS\fR if set.  If the environment
2151 variable \fBTERMCAP\fR contains li# and co# fields, the shell adjusts
2152 them to reflect the new window size.
2153 .SH REFERENCE
2154 The next sections of this manual describe all of the available
2155 \fBBuiltin commands\fR, \fBSpecial aliases\fR and
2156 \fBSpecial shell variables\fR.
2157 .SS "Builtin commands"
2158 .TP 8
2159 .B %\fIjob
2160 A synonym for the \fIfg\fR builtin command.
2161 .TP 8
2162 .B %\fIjob \fB&
2163 A synonym for the \fIbg\fR builtin command.
2164 .TP 8
2165 .B :
2166 Does nothing, successfully.
2167 .PP
2168 .B @
2169 .br
2170 .B @ \fIname\fB = \fIexpr
2171 .br
2172 .B @ \fIname\fR[\fIindex\fR]\fB = \fIexpr
2173 .br
2174 .B @ \fIname\fB++\fR|\fB--
2175 .PD 0
2176 .TP 8
2177 .B @ \fIname\fR[\fIindex\fR]\fB++\fR|\fB--
2178 The first form prints the values of all shell variables.
2179 .PD
2180 .RS +8
2181 .PP
2182 The second form assigns the value of \fIexpr\fR to \fIname\fR.
2183 The third form assigns the value of \fIexpr\fR to the \fIindex\fR'th
2184 component of \fIname\fR; both \fIname\fR and its \fIindex\fR'th component
2185 must already exist.
2186 .PP
2187 \fIexpr\fR may contain the operators `*', `+', etc., as in C.
2188 If \fIexpr\fR contains `<', `>', `&' or `' then at least that part of
2189 \fIexpr\fR must be placed within `()'.
2190 Note that the syntax of \fIexpr\fR has nothing to do with that described
2191 under \fBExpressions\fR.
2192 .PP
2193 The fourth and fifth forms increment (`++') or decrement (`\-\-') \fIname\fR
2194 or its \fIindex\fR'th component.
2195 .PP
2196 The space between `@' and \fIname\fR is required.  The spaces between
2197 \fIname\fR and `=' and between `=' and \fIexpr\fR are optional.  Components of
2198 \fIexpr\fR must be separated by spaces.
2199 .RE
2200 .PD
2201 .TP 8
2202 .B alias \fR[\fIname \fR[\fIwordlist\fR]]
2203 Without arguments, prints all aliases.
2204 With \fIname\fR, prints the alias for name.
2205 With \fIname\fR and \fIwordlist\fR, assigns
2206 \fIwordlist\fR as the alias of \fIname\fR.
2207 \fIwordlist\fR is command and filename substituted.
2208 \fIname\fR may not be `alias' or `unalias'.
2209 See also the \fIunalias\fR builtin command.
2210 .TP 8
2211 .B alloc
2212 Shows the amount of dynamic memory acquired, broken down into used and free
2213 memory.  With an argument shows the number of free and used blocks in each size
2214 category.  The categories start at size 8 and double at each step.  This
2215 command's output may vary across system types, because systems other than the VAX
2216 may use a different memory allocator.
2217 .TP 8
2218 .B bg \fR[\fB%\fIjob\fR ...]
2219 Puts the specified jobs (or, without arguments, the current job)
2220 into the background, continuing each if it is stopped.
2221 \fIjob\fR may be a number, a string, `', `%', `+' or `\-' as described
2222 under \fBJobs\fR.
2223 .PP
2224 .B bindkey \fR[\fB\-l\fR|\fB\-d\fR|\fB\-e\fR|\fB\-v\fR|\fB\-u\fR] (+)
2225 .br
2226 \fBbindkey \fR[\fB\-a\fR] [\fB\-b\fR] [\fB\-k\fR] [\fB\-r\fR] [\fB\-\-\fR] \fIkey \fR(+)
2227 .PD 0
2228 .TP 8
2229 \fBbindkey \fR[\fB\-a\fR] [\fB\-b\fR] [\fB\-k\fR] [\fB\-c\fR|\fB\-s\fR] [\fB\-\-\fR] \fIkey command \fR(+)
2230 .\" .B macro can't take too many words, so I used \fB in the previous tags
2231 Without options, the first form lists all bound keys and the editor command to which each is bound,
2232 the second form lists the editor command to which \fIkey\fR is bound and
2233 the third form binds the editor command \fIcommand\fR to \fIkey\fR.
2234 Options include:
2235 .PD
2236 .PP
2237 .PD 0
2238 .RS +8
2239 .TP 4
2240 .B \-l
2241 Lists all editor commands and a short description of each.
2242 .TP 4
2243 .B \-d
2244 Binds all keys to the standard bindings for the default editor,
2245 as per \fB-e\fR and \fB-v\fR below.
2246 .TP 4
2247 .B \-e
2248 Binds all keys to \fIemacs\fR(1)\-style bindings.
2249 Unsets \fBvimode\fR.
2250 .TP 4
2251 .B \-v
2252 Binds all keys to \fIvi\fR(1)\-style bindings.
2253 Sets \fBvimode\fR.
2254 .TP 4
2255 .B \-a
2256 Lists or changes key-bindings in the alternative key map.
2257 This is the key map used in \fBvimode\fR command mode.
2258 .TP 4
2259 .B \-b
2260 \fIkey\fR is interpreted as
2261 a control character written ^\fIcharacter\fR (e.g., `^A') or
2262 C-\fIcharacter\fR (e.g., `C-A'),
2263 a meta character written M-\fIcharacter\fR (e.g., `M-A'),
2264 a function key written F-\fIstring\fR (e.g., `F-string'),
2265 or an extended prefix key written X-\fIcharacter\fR (e.g., `X-A').
2266 .TP 4
2267 .B \-k
2268 \fIkey\fR is interpreted as a symbolic arrow key name, which may be one of
2269 `down', `up', `left' or `right'.
2270 .TP 4
2271 .B \-r
2272 Removes \fIkey\fR's binding.
2273 Be careful: `bindkey \-r' does \fInot\fR bind \fIkey\fR to
2274 \fIself-insert-command\fR (q.v.), it unbinds \fIkey\fR completely.
2275 .TP 4
2276 .B \-c
2277 \fIcommand\fR is interpreted as a builtin or external command instead of an
2278 editor command.
2279 .TP 4
2280 .B \-s
2281 \fIcommand\fR is taken as a literal string and treated as terminal input
2282 when \fIkey\fR is typed.  Bound keys in \fIcommand\fR are themselves
2283 reinterpreted, and this continues for ten levels of interpretation.
2284 .TP 4
2285 .B \-\-
2286 Forces a break from option processing, so the next word is taken as \fIkey\fR
2287 even if it begins with '\-'.
2288 .TP 4
2289 .B \-u \fR(or any invalid option)
2290 Prints a usage message.
2291 .PD
2292 .PP
2293 \fIkey\fR may be a single character or a string.
2294 If a command is bound to a string, the first character of the string is bound to
2295 \fIsequence-lead-in\fR and the entire string is bound to the command.
2296 .PP
2297 Control characters in \fIkey\fR can be literal (they can be typed by preceding
2298 them with the editor command \fIquoted-insert\fR, normally bound to `^V') or
2299 written caret-character style, e.g., `^A'.  Delete is written `^?'
2300 (caret-question mark).  \fIkey\fR and \fIcommand\fR can contain backslashed
2301 escape sequences (in the style of System V \fIecho\fR(1)) as follows:
2302 .RS +4
2303 .TP 8
2304 .PD 0
2305 .B \ea
2306 Bell
2307 .TP 8
2308 .B \eb
2309 Backspace
2310 .TP 8
2311 .B \ee
2312 Escape
2313 .TP 8
2314 .B \ef
2315 Form feed
2316 .TP 8
2317 .B \en
2318 Newline
2319 .TP 8
2320 .B \er
2321 Carriage return
2322 .TP 8
2323 .B \et
2324 Horizontal tab
2325 .TP 8
2326 .B \ev
2327 Vertical tab
2328 .TP 8
2329 .B \e\fInnn
2330 The ASCII character corresponding to the octal number \fInnn\fR
2331 .PD
2332 .RE
2333 .PP
2334 `\e' nullifies the special meaning of the following character, if it has
2335 any, notably `\e' and `^'.
2336 .RE
2337 .TP 8
2338 .B bs2cmd \fIbs2000-command\fR (+)
2339 Passes \fIbs2000-command\fR to the BS2000 command interpreter for
2340 execution. Only non-interactive commands can be executed, and it is
2341 not possible to execute any command that would overlay the image
2342 of the current process, like /EXECUTE or /CALL-PROCEDURE. (BS2000 only)
2343 .TP 8
2344 .B break
2345 Causes execution to resume after the \fIend\fR of the nearest
2346 enclosing \fIforeach\fR or \fIwhile\fR.  The remaining commands on the
2347 current line are executed.  Multi-level breaks are thus
2348 possible by writing them all on one line.
2349 .TP 8
2350 .B breaksw
2351 Causes a break from a \fIswitch\fR, resuming after the \fIendsw\fR.
2352 .TP 8
2353 .B builtins \fR(+)
2354 Prints the names of all builtin commands.
2355 .TP 8
2356 .B bye \fR(+)
2357 A synonym for the \fIlogout\fR builtin command.
2358 Available only if the shell was so compiled;
2359 see the \fBversion\fR shell variable.
2360 .TP 8
2361 .B case \fIlabel\fB:
2362 A label in a \fIswitch\fR statement as discussed below.
2363 .TP 8
2364 .B cd \fR[\fB\-p\fR] [\fB\-l\fR] [\fB\-n\fR|\fB\-v\fR] [\I--\fR] [\fIname\fR]
2365 If a directory \fIname\fR is given, changes the shell's working directory
2366 to \fIname\fR.  If not, changes to \fBhome\fR, unless the \fBcdtohome\fR
2367 variable is not set, in which case a \fIname\fR is required.
2368 If \fIname\fR is `\-' it is interpreted as the previous working directory
2369 (see \fBOther substitutions\fR).  (+)
2370 If \fIname\fR is not a subdirectory of the current directory
2371 (and does not begin with `/', `./' or `../'), each component of the variable
2372 \fBcdpath\fR is checked to see if it has a subdirectory \fIname\fR.  Finally, if
2373 all else fails but \fIname\fR is a shell variable whose value
2374 begins with `/' or '.', then this is tried to see if it is a directory, and
2375 the \fB\-p\fR option is implied.
2376 .RS +8
2377 .PP
2378 With \fB\-p\fR, prints the final directory stack, just like \fIdirs\fR.
2379 The \fB\-l\fR, \fB\-n\fR and \fB\-v\fR flags have the same effect on \fIcd\fR
2380 as on \fIdirs\fR, and they imply \fB\-p\fR.  (+)
2381 Using \fB\-\-\fR forces a break from option processing so the next word
2382 is taken as the directory \fIname\fR even if it begins with '\-'. (+)
2383 .PP
2384 See also the \fBimplicitcd\fR and \fBcdtohome\fR shell variables.
2385 .RE
2386 .TP 8
2387 .B chdir
2388 A synonym for the \fIcd\fR builtin command.
2389 .TP 8
2390 .B complete \fR[\fIcommand\fR [\fIword\fB/\fIpattern\fB/\fIlist\fR[\fB:\fIselect\fR]\fB/\fR[[\fIsuffix\fR]\fB/\fR] ...]] (+)
2391 Without arguments, lists all completions.
2392 With \fIcommand\fR, lists completions for \fIcommand\fR.
2393 With \fIcommand\fR and \fIword\fR etc., defines completions.
2394 .RS +8
2395 .PP
2396 \fIcommand\fR may be a full command name or a glob-pattern
2397 (see \fBFilename substitution\fR).  It can begin with `\-' to indicate that
2398 completion should be used only when \fIcommand\fR is ambiguous.
2399 .PP
2400 \fIword\fR specifies which word relative to the current word
2401 is to be completed, and may be one of the following:
2402 .PP
2403 .PD 0
2404 .RS +4
2405 .TP 4
2406 .B c
2407 Current-word completion.
2408 \fIpattern\fR is a glob-pattern which must match the beginning of the current word on
2409 the command line.  \fIpattern\fR is ignored when completing the current word.
2410 .TP 4
2411 .B C
2412 Like \fBc\fR, but includes \fIpattern\fR when completing the current word.
2413 .TP 4
2414 .B n
2415 Next-word completion.
2416 \fIpattern\fR is a glob-pattern which must match the beginning of the previous word on
2417 the command line.
2418 .TP 4
2419 .B N
2420 Like \fBn\fR, but must match the beginning of the word two before the current word.
2421 .TP 4
2422 .B p
2423 Position-dependent completion.
2424 \fIpattern\fR is a numeric range, with the same syntax used to index shell
2425 variables, which must include the current word.
2426 .PD
2427 .RE
2428 .PP
2429 \fIlist\fR, the list of possible completions, may be one of the following:
2430 .PP
2431 .PD 0
2432 .RS +4
2433 .TP 8
2434 .B a
2435 Aliases
2436 .TP 8
2437 .B b
2438 Bindings (editor commands)
2439 .TP 8
2440 .B c
2441 Commands (builtin or external commands)
2442 .TP 8
2443 .B C
2444 External commands which begin with the supplied path prefix
2445 .TP 8
2446 .B d
2447 Directories
2448 .TP 8
2449 .B D
2450 Directories which begin with the supplied path prefix
2451 .TP 8
2452 .B e
2453 Environment variables
2454 .TP 8
2455 .B f
2456 Filenames
2457 .TP 8
2458 .B F
2459 Filenames which begin with the supplied path prefix
2460 .TP 8
2461 .B g
2462 Groupnames
2463 .TP 8
2464 .B j
2465 Jobs
2466 .TP 8
2467 .B l
2468 Limits
2469 .TP 8
2470 .B n
2471 Nothing
2472 .TP 8
2473 .B s
2474 Shell variables
2475 .TP 8
2476 .B S
2477 Signals
2478 .TP 8
2479 .B t
2480 Plain (``text'') files
2481 .TP 8
2482 .B T
2483 Plain (``text'') files which begin with the supplied path prefix
2484 .TP 8
2485 .B v
2486 Any variables
2487 .TP 8
2488 .B u
2489 Usernames
2490 .TP 8
2491 .B x
2492 Like \fBn\fR, but prints \fIselect\fR when \fIlist-choices\fR is used.
2493 .TP 8
2494 .B X
2495 Completions
2496 .TP 8
2497 $\fIvar\fR
2498 Words from the variable \fIvar\fR
2499 .TP 8
2500 (...)
2501 Words from the given list
2502 .TP 8
2503 \`...\`
2504 Words from the output of command
2505 .PD
2506 .RE
2507 .PP
2508 \fIselect\fR is an optional glob-pattern.
2509 If given, words from only \fIlist\fR that match \fIselect\fR are considered
2510 and the \fBfignore\fR shell variable is ignored.
2511 The last three types of completion may not have a \fIselect\fR
2512 pattern, and \fBx\fR uses \fIselect\fR as an explanatory message when
2513 the \fIlist-choices\fR editor command is used.
2514 .PP
2515 \fIsuffix\fR is a single character to be appended to a successful
2516 completion.  If null, no character is appended.  If omitted (in which
2517 case the fourth delimiter can also be omitted), a slash is appended to
2518 directories and a space to other words.
2519 .PP
2520 \fIcommand\fR invoked from \`...\` version has additional environment
2521 variable set, the variable name is \%\fBCOMMAND_LINE\fR\% and
2522 contains (as its name indicates) contents of the current (already
2523 typed in) command line. One can examine and use contents of the
2524 \%\fBCOMMAND_LINE\fR\% variable in her custom script to build more
2525 sophisticated completions (see completion for svn(1) included in
2526 this package).
2527 .PP
2528 Now for some examples.  Some commands take only directories as arguments,
2529 so there's no point completing plain files.
2530 .IP "" 4
2531 > complete cd 'p/1/d/'
2532 .PP
2533 completes only the first word following `cd' (`p/1') with a directory.
2534 \fBp\fR-type completion can also be used to narrow down command completion:
2535 .IP "" 4
2536 > co[^D]
2537 .br
2538 complete compress
2539 .br
2540 > complete \-co* 'p/0/(compress)/'
2541 .br
2542 > co[^D]
2543 .br
2544 > compress
2545 .PP
2546 This completion completes commands (words in position 0, `p/0')
2547 which begin with `co' (thus matching `co*') to `compress' (the only
2548 word in the list).
2549 The leading `\-' indicates that this completion is to be used with only
2550 ambiguous commands.
2551 .IP "" 4
2552 > complete find 'n/\-user/u/'
2553 .PP
2554 is an example of \fBn\fR-type completion.  Any word following `find' and
2555 immediately following `\-user' is completed from the list of users.
2556 .IP "" 4
2557 > complete cc 'c/\-I/d/'
2558 .PP
2559 demonstrates \fBc\fR-type completion.  Any word following `cc' and beginning
2560 with `\-I' is completed as a directory.  `\-I' is not taken as part of the
2561 directory because we used lowercase \fBc\fR.
2562 .PP
2563 Different \fIlist\fRs are useful with different commands.
2564 .IP "" 4
2565 > complete alias 'p/1/a/'
2566 .br
2567 > complete man 'p/*/c/'
2568 .br
2569 > complete set 'p/1/s/'
2570 .br
2571 > complete true 'p/1/x:Truth has no options./'
2572 .PP
2573 These complete words following `alias' with aliases, `man' with commands,
2574 and `set' with shell variables.
2575 `true' doesn't have any options, so \fBx\fR does nothing when completion
2576 is attempted and prints `Truth has no options.' when completion choices are listed.
2577 .PP
2578 Note that the \fIman\fR example, and several other examples below, could
2579 just as well have used 'c/*' or 'n/*' as 'p/*'.
2580 .PP
2581 Words can be completed from a variable evaluated at completion time,
2582 .IP "" 4
2583 > complete ftp 'p/1/$hostnames/'
2584 .br
2585 > set hostnames = (rtfm.mit.edu tesla.ee.cornell.edu)
2586 .br
2587 > ftp [^D]
2588 .br
2589 rtfm.mit.edu tesla.ee.cornell.edu
2590 .br
2591 > ftp [^C]
2592 .br
2593 > set hostnames = (rtfm.mit.edu tesla.ee.cornell.edu uunet.uu.net)
2594 .br
2595 > ftp [^D]
2596 .br
2597 rtfm.mit.edu tesla.ee.cornell.edu uunet.uu.net
2598 .PP
2599 or from a command run at completion time:
2600 .IP "" 4
2601 > complete kill 'p/*/\`ps | awk \e{print\e \e$1\e}\`/'
2602 .br
2603 > kill \-9 [^D]
2604 .br
2605 23113 23377 23380 23406 23429 23529 23530 PID
2606 .PP
2607 Note that the \fIcomplete\fR command does not itself quote its arguments,
2608 so the braces, space and `$' in `{print $1}' must be quoted explicitly.
2609 .PP
2610 One command can have multiple completions:
2611 .IP "" 4
2612 > complete dbx 'p/2/(core)/' 'p/*/c/'
2613 .PP
2614 completes the second argument to `dbx' with the word `core' and all other
2615 arguments with commands.  Note that the positional completion is specified
2616 before the next-word completion.
2617 Because completions are evaluated from left to right, if
2618 the next-word completion were specified first it would always match
2619 and the positional completion would never be executed.  This is a
2620 common mistake when defining a completion.
2621 .PP
2622 The \fIselect\fR pattern is useful when a command takes files with only
2623 particular forms as arguments.  For example,
2624 .IP "" 4
2625 > complete cc 'p/*/f:*.[cao]/'
2626 .PP
2627 completes `cc' arguments to files ending in only `.c', `.a', or `.o'.
2628 \fIselect\fR can also exclude files, using negation of a glob-pattern as
2629 described under \fBFilename substitution\fR.  One might use
2630 .IP "" 4
2631 > complete rm 'p/*/f:^*.{c,h,cc,C,tex,1,man,l,y}/'
2632 .PP
2633 to exclude precious source code from `rm' completion.  Of course, one
2634 could still type excluded names manually or override the completion
2635 mechanism using the \fIcomplete-word-raw\fR or \fIlist-choices-raw\fR
2636 editor commands (q.v.).
2637 .PP
2638 The `C', `D', `F' and `T' \fIlist\fRs are like `c', `d', `f' and `t'
2639 respectively, but they use the \fIselect\fR argument in a different way: to
2640 restrict completion to files beginning with a particular path prefix.  For
2641 example, the Elm mail program uses `=' as an abbreviation for one's mail
2642 directory.  One might use
2643 .IP "" 4
2644 > complete elm c@=@F:$HOME/Mail/@
2645 .PP
2646 to complete `elm \-f =' as if it were `elm \-f ~/Mail/'.  Note that we used `@'
2647 instead of `/' to avoid confusion with the \fIselect\fR argument, and we used
2648 `$HOME' instead of `~' because home directory substitution works at only the
2649 beginning of a word.
2650 .PP
2651 \fIsuffix\fR is used to add a nonstandard suffix
2652 (not space or `/' for directories) to completed words.
2653 .IP "" 4
2654 > complete finger 'c/*@/$hostnames/' 'p/1/u/@'
2655 .PP
2656 completes arguments to `finger' from the list of users, appends an `@',
2657 and then completes after the `@' from the `hostnames' variable.  Note
2658 again the order in which the completions are specified.
2659 .PP
2660 Finally, here's a complex example for inspiration:
2661 .IP "" 4
2662 > complete find \e
2663 .br
2664 \&'n/\-name/f/' 'n/\-newer/f/' 'n/\-{,n}cpio/f/' \e
2665 .br
2666 \&\'n/\-exec/c/' 'n/\-ok/c/' 'n/\-user/u/' \e
2667 .br
2668 \&'n/\-group/g/' 'n/\-fstype/(nfs 4.2)/' \e
2669 .br
2670 \&'n/\-type/(b c d f l p s)/' \e
2671 .br
2672 \'c/\-/(name newer cpio ncpio exec ok user \e
2673 .br
2674 group fstype type atime ctime depth inum \e
2675 .br
2676 ls mtime nogroup nouser perm print prune \e
2677 .br
2678 size xdev)/' \e
2679 .br
2680 \&'p/*/d/'
2681 .PP
2682 This completes words following `\-name', `\-newer', `\-cpio' or `ncpio'
2683 (note the pattern which matches both) to files,
2684 words following `\-exec' or `\-ok' to commands, words following `user'
2685 and `group' to users and groups respectively
2686 and words following `\-fstype' or `\-type' to members of the
2687 given lists.  It also completes the switches themselves from the given list
2688 (note the use of \fBc\fR-type completion)
2689 and completes anything not otherwise completed to a directory.  Whew.
2690 .PP
2691 Remember that programmed completions are ignored if the word being completed
2692 is a tilde substitution (beginning with `~') or a variable (beginning with `$').
2693 See also the \fIuncomplete\fR builtin command.
2694 .RE
2695 .TP 8
2696 .B continue
2697 Continues execution of the nearest enclosing \fIwhile\fR or \fIforeach\fR.
2698 The rest of the commands on the current line are executed.
2699 .TP 8
2700 .B default:
2701 Labels the default case in a \fIswitch\fR statement.
2702 It should come after all \fIcase\fR labels.
2703 .PP
2704 .B dirs \fR[\fB\-l\fR] [\fB\-n\fR|\fB\-v\fR]
2705 .br
2706 .B dirs \-S\fR|\fB\-L \fR[\fIfilename\fR] (+)
2707 .PD 0
2708 .TP 8
2709 .B dirs \-c \fR(+)
2710 The first form prints the directory stack.  The top of the stack is at the
2711 left and the first directory in the stack is the current directory.
2712 With \fB\-l\fR, `~' or `~\fIname\fP' in the output is expanded explicitly
2713 to \fBhome\fR or the pathname of the home directory for user \fIname\fP.  (+)
2714 With \fB\-n\fR, entries are wrapped before they reach the edge of the screen.  (+)
2715 With \fB\-v\fR, entries are printed one per line, preceded by their stack positions.  (+)
2716 If more than one of \fB\-n\fR or \fB\-v\fR is given, \fB\-v\fR takes precedence.
2717 \fB\-p\fR is accepted but does nothing.
2718 .PD
2719 .RS +8
2720 .PP
2721 With \fB\-S\fR, the second form saves the directory stack to \fIfilename\fR
2722 as a series of \fIcd\fR and \fIpushd\fR commands.
2723 With \fB\-L\fR, the shell sources \fIfilename\fR, which is presumably
2724 a directory stack file saved by the \fB\-S\fR option or the \fBsavedirs\fR
2725 mechanism.
2726 In either case, \fBdirsfile\fR is used if \fIfilename\fR is not given and
2727 \fI~/.cshdirs\fR is used if \fBdirsfile\fR is unset.
2728 .PP
2729 Note that login shells do the equivalent of `dirs \-L' on startup
2730 and, if \fBsavedirs\fR is set, `dirs \-S' before exiting.
2731 Because only \fI~/.tcshrc\fR is normally sourced before \fI~/.cshdirs\fR,
2732 \fBdirsfile\fR should be set in \fI~/.tcshrc\fR rather than \fI~/.login\fR.
2733 .PP
2734 The last form clears the directory stack.
2735 .RE
2736 .TP 8
2737 .B echo \fR[\fB\-n\fR] \fIword\fR ...
2738 Writes each \fIword\fR to the shell's standard
2739 output, separated by spaces and terminated with a newline.
2740 The \fBecho_style\fR shell variable may be set to emulate (or not) the flags and escape
2741 sequences of the BSD and/or System V versions of \fIecho\fR; see \fIecho\fR(1).
2742 .TP 8
2743 .B echotc \fR[\fB\-sv\fR] \fIarg\fR ... (+)
2744 Exercises the terminal capabilities (see \fItermcap\fR(5)) in \fIargs\fR.
2745 For example, 'echotc home' sends the cursor to the home position,
2746 \&'echotc cm 3 10' sends it to column 3 and row 10, and
2747 \&'echotc ts 0; echo "This is a test."; echotc fs' prints "This is a test."
2748 in the status line.
2749 .RS +8
2750 .PP
2751 If \fIarg\fR is 'baud', 'cols', 'lines', 'meta' or 'tabs', prints the
2752 value of that capability ("yes" or "no" indicating that the terminal does
2753 or does not have that capability).  One might use this to make the output
2754 from a shell script less verbose on slow terminals, or limit command
2755 output to the number of lines on the screen:
2756 .IP "" 4
2757 > set history=\`echotc lines\`
2758 .br
2759 > @ history\-\-
2760 .PP
2761 Termcap strings may contain wildcards which will not echo correctly.
2762 One should use double quotes when setting a shell variable to a terminal
2763 capability string, as in the following example that places the date in
2764 the status line:
2765 .IP "" 4
2766 > set tosl="\`echotc ts 0\`"
2767 .br
2768 > set frsl="\`echotc fs\`"
2769 .br
2770 > echo \-n "$tosl";date; echo \-n "$frsl"
2771 .PP
2772 With \fB\-s\fR, nonexistent capabilities return the empty string rather
2773 than causing an error.
2774 With \fB\-v\fR, messages are verbose.
2775 .RE
2776 .PP
2777 .B else
2778 .br
2779 .B end
2780 .br
2781 .B endif
2782 .PD 0
2783 .TP 8
2784 .B endsw
2785 See the description of the \fIforeach\fR, \fIif\fR, \fIswitch\fR, and
2786 \fIwhile\fR statements below.
2787 .PD
2788 .TP 8
2789 .B eval \fIarg\fR ...
2790 Treats the arguments as input to the
2791 shell and executes the resulting command(s) in the context
2792 of the current shell.  This is usually used to execute commands
2793 generated as the result of command or variable substitution,
2794 because parsing occurs before these substitutions.
2795 See \fItset\fR(1) for a sample use of \fIeval\fR.
2796 .TP 8
2797 .B exec \fIcommand\fR
2798 Executes the specified command in place of the current shell.
2799 .TP 8
2800 .B exit \fR[\fIexpr\fR]
2801 The shell exits either with the value of the specified \fIexpr\fR
2802 (an expression, as described under \fBExpressions\fR)
2803 or, without \fIexpr\fR, with the value 0.
2804 .TP 8
2805 .B fg \fR[\fB%\fIjob\fR ...]
2806 Brings the specified jobs (or, without arguments, the current job)
2807 into the foreground, continuing each if it is stopped.
2808 \fIjob\fR may be a number, a string, `', `%', `+' or `\-' as described
2809 under \fBJobs\fR.
2810 See also the \fIrun-fg-editor\fR editor command.
2811 .TP 8
2812 .B filetest \-\fIop file\fR ... (+)
2813 Applies \fIop\fR (which is a file inquiry operator as described under
2814 \fBFile inquiry operators\fR) to each \fIfile\fR and returns the results as a
2815 space-separated list.
2816 .PP
2817 .B foreach \fIname \fB(\fIwordlist\fB)
2818 .br
2819 \&...
2820 .PD 0
2821 .TP 8
2822 .B end
2823 Successively sets the variable \fIname\fR to each member of
2824 \fIwordlist\fR and executes the sequence of commands between this command
2825 and the matching \fIend\fR.  (Both \fIforeach\fR and \fIend\fR
2826 must appear alone on separate lines.)  The builtin command
2827 \fIcontinue\fR may be used to continue the loop prematurely and
2828 the builtin command \fIbreak\fR to terminate it prematurely.
2829 When this command is read from the terminal, the loop is read once
2830 prompting with `foreach? ' (or \fBprompt2\fR) before any statements in
2831 the loop are executed.  If you make a mistake typing in a
2832 loop at the terminal you can rub it out.
2833 .PD
2834 .TP 8
2835 .B getspath \fR(+)
2836 Prints the system execution path.  (TCF only)
2837 .TP 8
2838 .B getxvers \fR(+)
2839 Prints the experimental version prefix.  (TCF only)
2840 .TP 8
2841 .B glob \fIwordlist
2842 Like \fIecho\fR, but the `-n' parameter is not recognized and words are
2843 delimited by null characters in the output.  Useful for
2844 programs which wish to use the shell to filename expand a list of words.
2845 .TP 8
2846 .B goto \fIword
2847 \fIword\fR is filename and command-substituted to
2848 yield a string of the form `label'.  The shell rewinds its
2849 input as much as possible, searches for a line of the
2850 form `label:', possibly preceded by blanks or tabs, and
2851 continues execution after that line.
2852 .TP 8
2853 .B hashstat
2854 Prints a statistics line indicating how effective the
2855 internal hash table has been at locating commands (and avoiding
2856 \fIexec\fR's).  An \fIexec\fR is attempted for each component of the
2857 \fBpath\fR where the hash function indicates a possible hit, and
2858 in each component which does not begin with a `/'.
2859 .IP
2860 On machines without \fIvfork\fR(2), prints only the number and size of
2861 hash buckets.
2862 .PP
2863 .B history \fR[\fB\-hTr\fR] [\fIn\fR]
2864 .br
2865 .B history \-S\fR|\fB\-L|\fB\-M \fR[\fIfilename\fR] (+)
2866 .PD 0
2867 .TP 8
2868 .B history \-c \fR(+)
2869 The first form prints the history event list.
2870 If \fIn\fR is given only the \fIn\fR most recent events are printed or saved.
2871 With \fB\-h\fR, the history list is printed without leading numbers.  If
2872 \fB-T\fR is specified, timestamps are printed also in comment form.
2873 (This can be used to
2874 produce files suitable for loading with 'history \-L' or 'source \-h'.)
2875 With \fB\-r\fR, the order of printing is most recent
2876 first rather than oldest first.
2877 .PD
2878 .RS +8
2879 .PP
2880 With \fB\-S\fR, the second form saves the history list to \fIfilename\fR.
2881 If the first word of the \fBsavehist\fR shell variable is set to a
2882 number, at most that many lines are saved.  If the second word of
2883 \fBsavehist\fR is set to `merge', the history list is merged with the
2884 existing history file instead of replacing it (if there is one) and
2885 sorted by time stamp.  (+) Merging is intended for an environment like
2886 the X Window System
2887 with several shells in simultaneous use.  If the second word of \fBsavehist\fR
2888 is `merge' and the third word is set to `lock', the history file update
2889 will be serialized with other shell sessions that would possibly like
2890 to merge history at exactly the same time.
2891 .PP
2892 With \fB\-L\fR, the shell appends \fIfilename\fR, which is presumably a
2893 history list saved by the \fB\-S\fR option or the \fBsavehist\fR mechanism,
2894 to the history list.
2895 \fB\-M\fR is like \fB\-L\fR, but the contents of \fIfilename\fR are merged
2896 into the history list and sorted by timestamp.
2897 In either case, \fBhistfile\fR is used if \fIfilename\fR is not given and
2898 \fI~/.history\fR is used if \fBhistfile\fR is unset.
2899 `history \-L' is exactly like 'source \-h' except that it does not require a
2900 filename.
2901 .PP
2902 Note that login shells do the equivalent of `history \-L' on startup
2903 and, if \fBsavehist\fR is set, `history \-S' before exiting.
2904 Because only \fI~/.tcshrc\fR is normally sourced before \fI~/.history\fR,
2905 \fBhistfile\fR should be set in \fI~/.tcshrc\fR rather than \fI~/.login\fR.
2906 .PP
2907 If \fBhistlit\fR is set, the first and second forms print and save the literal
2908 (unexpanded) form of the history list.
2909 .PP
2910 The last form clears the history list.
2911 .RE
2912 .TP 8
2913 .B hup \fR[\fIcommand\fR] \fR(+)
2914 With \fIcommand\fR, runs \fIcommand\fR such that it will exit on a hangup
2915 signal and arranges for the shell to send it a hangup signal when the shell
2916 exits.
2917 Note that commands may set their own response to hangups, overriding \fIhup\fR.
2918 Without an argument, causes the non-interactive shell only to
2919 exit on a hangup for the remainder of the script.
2920 See also \fBSignal handling\fR and the \fInohup\fR builtin command.
2921 .TP 8
2922 .B if (\fIexpr\fB) \fIcommand
2923 If \fIexpr\fR (an expression, as described under \fBExpressions\fR)
2924 evaluates true, then \fIcommand\fR is executed.
2925 Variable substitution on \fIcommand\fR happens early, at the same time it
2926 does for the rest of the \fIif\fR command.
2927 \fIcommand\fR must be a simple command, not an alias, a pipeline, a command list
2928 or a parenthesized command list, but it may have arguments.
2929 Input/output redirection occurs even if \fIexpr\fR is
2930 false and \fIcommand\fR is thus \fInot\fR executed; this is a bug.
2931 .PP
2932 .B if (\fIexpr\fB) then
2933 .br
2934 \&...
2935 .br
2936 .B else if (\fIexpr2\fB) then
2937 .br
2938 \&...
2939 .br
2940 .B else
2941 .br
2942 \&...
2943 .PD 0
2944 .TP 8
2945 .B endif
2946 If the specified \fIexpr\fR is true then the commands to the
2947 first \fIelse\fR are executed; otherwise if \fIexpr2\fR is true then
2948 the commands to the second \fIelse\fR are executed, etc.  Any
2949 number of \fIelse-if\fR pairs are possible; only one \fIendif\fR is
2950 needed.  The \fIelse\fR part is likewise optional.  (The words
2951 \fIelse\fR and \fIendif\fR must appear at the beginning of input lines;
2952 the \fIif\fR must appear alone on its input line or after an
2953 \fIelse\fR.)
2954 .PD
2955 .TP 8
2956 .B inlib \fIshared-library\fR ... (+)
2957 Adds each \fIshared-library\fR to the current environment.  There is no way
2958 to remove a shared library.  (Domain/OS only)
2959 .TP 8
2960 .B jobs \fR[\fB\-l\fR]
2961 Lists the active jobs.  With \fB\-l\fR, lists process
2962 IDs in addition to the normal information.  On TCF systems, prints
2963 the site on which each job is executing.
2964 .PP
2965 .PD 0
2966 .TP 8
2967 .B kill \fR[\fB\-s \fIsignal\fR] \fB%\fIjob\fR|\fIpid\fR ...
2968 .PD 0
2969 .TP 8
2970 .B kill \-l
2971 The first and second forms sends the specified \fIsignal\fR (or, if none
2972 is given, the TERM (terminate) signal) to the specified jobs or processes.
2973 \fIjob\fR may be a number, a string, `', `%', `+' or `\-' as described
2974 under \fBJobs\fR.
2975 Signals are either given by number or by name (as given in
2976 \fI/usr/include/signal.h\fR, stripped of the prefix `SIG').
2977 There is no default \fIjob\fR; saying just `kill' does not send a signal
2978 to the current job.  If the signal being sent is TERM (terminate)
2979 or HUP (hangup), then the job or process is sent a
2980 CONT (continue) signal as well.
2981 The third form lists the signal names.
2982 .PD
2983 .TP 8
2984 .B limit \fR[\fB\-h\fR] [\fIresource\fR [\fImaximum-use\fR]]
2985 Limits the consumption by the current process and each
2986 process it creates to not individually exceed \fImaximum-use\fR on
2987 the specified \fIresource\fR.  If no \fImaximum-use\fR is given, then
2988 the current limit is printed; if no \fIresource\fR is given, then
2989 all limitations are given.  If the \fB\-h\fR flag is given, the
2990 hard limits are used instead of the current limits.  The
2991 hard limits impose a ceiling on the values of the current
2992 limits.  Only the super-user may raise the hard limits, but
2993 a user may lower or raise the current limits within the legal range.
2994 .RS +8
2995 .PP
2996 Controllable resources currently include (if supported by the OS):
2997 .TP
2998 \fIcputime\fR
2999 the maximum number of cpu-seconds to be used by each process
3000 .TP
3001 \fIfilesize\fR
3002 the largest single file which can be created
3003 .TP
3004 \fIdatasize\fR
3005 the maximum growth of the data+stack region via sbrk(2) beyond
3006 the end of the program text
3007 .TP
3008 \fIstacksize\fR
3009 the maximum size of the automatically-extended stack region
3010 .TP
3011 \fIcoredumpsize\fR
3012 the size of the largest core dump that will be created
3013 .TP
3014 \fImemoryuse\fR
3015 the maximum amount of physical memory a process
3016 may have allocated to it at a given time
3017 .TP
3018 \fIvmemoryuse\fR
3019 the maximum amount of virtual memory a process
3020 may have allocated to it at a given time (address space)
3021 .TP
3022 \fIvmemoryuse\fR
3023 the maximum amount of virtual memory a process
3024 may have allocated to it at a given time
3025 .TP
3026 \fIheapsize\fR
3027 the maximum amount of memory a process
3028 may allocate per \fIbrk()\fR system call
3029 .TP
3030 \fIdescriptors\fR or \fIopenfiles\fR
3031 the maximum number of open files for this process
3032 .TP
3033 \fIpseudoterminals\fR
3034 the maximum number of pseudo-terminals for this user
3035 .TP
3036 \fIkqueues\fR
3037 the maximum number of kqueues allocated for this process
3038 .TP
3039 \fIconcurrency\fR
3040 the maximum number of threads for this process
3041 .TP
3042 \fImemorylocked\fR
3043 the maximum size which a process may lock into memory using mlock(2)
3044 .TP
3045 \fImaxproc\fR
3046 the maximum number of simultaneous processes for this user id
3047 .TP
3048 \fImaxthread\fR
3049 the maximum number of simultaneous threads (lightweight processes) for this
3050 user id
3051 .TP
3052 \fIthreads\fR
3053 the maximum number of threads for this process
3054 .TP
3055 \fIsbsize\fR
3056 the maximum size of socket buffer usage for this user
3057 .TP
3058 \fIswapsize\fR
3059 the maximum amount of swap space reserved or used for this user
3060 .TP
3061 \fImaxlocks\fR
3062 the maximum number of locks for this user
3063 .TP
3064 \fIposixlocks\fR
3065 the maximum number of POSIX advisory locks for this user
3066 .TP
3067 \fImaxsignal\fR
3068 the maximum number of pending signals for this user
3069 .TP
3070 \fImaxmessage\fR
3071 the maximum number of bytes in POSIX mqueues for this user
3072 .TP
3073 \fImaxnice\fR
3074 the maximum nice priority the user is allowed to raise mapped from [19...-20]
3075 to [0...39] for this user
3076 .TP
3077 \fImaxrtprio\fR
3078 the maximum realtime priority for this user
3079 \fImaxrttime\fR
3080 the timeout for RT tasks in microseconds for this user.
3081 .PP
3082 \fImaximum-use\fR may be given as a (floating point or
3083 integer) number followed by a scale factor.  For all limits
3084 other than \fIcputime\fR the default scale is `k' or `kilobytes'
3085 (1024 bytes); a scale factor of `m' or `megabytes' or `g' or `gigabytes'
3086 may also be used.  For \fIcputime\fR the default scaling is `seconds',
3087 while `m' for minutes or `h' for hours, or a time of the
3088 form `mm:ss' giving minutes and seconds may be used.
3089 .PP
3090 If \fImaximum-use\fR  is `unlimited',
3091 then the limitation on the specified \fIresource\fR
3092 is removed (this is equivalent to the \fIunlimit\fR builtin command).
3093 .PP
3094 For both \fIresource\fR names and scale factors, unambiguous
3095 prefixes of the names suffice.
3096 .RE
3097 .TP 8
3098 .B log \fR(+)
3099 Prints the \fBwatch\fR shell variable and reports on each user indicated
3100 in \fBwatch\fR who is logged in, regardless of when they last logged in.
3101 See also \fIwatchlog\fR.
3102 .TP 8
3103 .B login
3104 Terminates a login shell, replacing it with an instance of
3105 \fI/bin/login\fR. This is one way to log off, included for
3106 compatibility with \fIsh\fR(1).
3107 .TP 8
3108 .B logout
3109 Terminates a login shell.  Especially useful if \fBignoreeof\fR is set.
3110 .TP 8
3111 .B ls\-F \fR[\-\fIswitch\fR ...] [\fIfile\fR ...] (+)
3112 Lists files like `ls \-F', but much faster.  It identifies each type of
3113 special file in the listing with a special character:
3114 .PP
3115 .RS +8
3116 .PD 0
3117 .TP 4
3118 /
3119 Directory
3120 .TP 4
3121 *
3122 Executable
3123 .TP 4
3124 #
3125 Block device
3126 .TP 4
3127 %
3128 Character device
3129 .TP 4
3130 |
3131 Named pipe (systems with named pipes only)
3132 .TP 4
3133 =
3134 Socket (systems with sockets only)
3135 .TP 4
3136 @
3137 Symbolic link (systems with symbolic links only)
3138 .TP 4
3139 +
3140 Hidden directory (AIX only) or context dependent (HP/UX only)
3141 .TP 4
3142 :
3143 Network special (HP/UX only)
3144 .PD
3145 .PP
3146 If the \fBlistlinks\fR shell variable is set, symbolic links are identified
3147 in more detail (on only systems that have them, of course):
3148 .PP
3149 .PD 0
3150 .TP 4
3151 @
3152 Symbolic link to a non-directory
3153 .TP 4
3154 >
3155 Symbolic link to a directory
3156 .TP 4
3157 &
3158 Symbolic link to nowhere
3159 .PD
3160 .PP
3161 \fBlistlinks\fR also slows down \fIls\-F\fR and causes partitions holding
3162 files pointed to by symbolic links to be mounted.
3163 .PP
3164 If the \fBlistflags\fR shell variable is set to `x', `a' or `A', or any
3165 combination thereof (e.g., `xA'), they are used as flags to \fIls\-F\fR,
3166 making it act like `ls \-xF', `ls \-Fa', `ls \-FA' or a combination
3167 (e.g., `ls \-FxA').
3168 On machines where `ls \-C' is not the default, \fIls\-F\fR acts like `ls \-CF',
3169 unless \fBlistflags\fR contains an `x', in which case it acts like `ls \-xF'.
3170 \fIls\-F\fR passes its arguments to \fIls\fR(1) if it is given any switches,
3171 so `alias ls ls\-F' generally does the right thing.
3172 .PP
3173 The \fBls\-F\fR builtin can list files using different colors depending on the
3174 filetype or extension.  See the \fBcolor\fR shell variable and the
3175 \fBLS_COLORS\fR environment variable.
3176 .RE
3177 .PP
3178 .B migrate \fR[\fB\-\fIsite\fR] \fIpid\fR|\fB%\fIjobid\fR ... (+)
3179 .PD 0
3180 .TP 8
3181 .B migrate \-\fIsite\fR (+)
3182 The first form migrates the process or job to the site specified or the
3183 default site determined by the system path.
3184 The second form is equivalent to `migrate \-\fIsite\fR $$': it migrates the
3185 current process to the specified site.  Migrating the shell
3186 itself can cause unexpected behavior, because the shell
3187 does not like to lose its tty.  (TCF only)
3188 .PD
3189 .TP 8
3190 .B newgrp \fR[\fB\-\fR] \fI[group]\fR (+)
3191 Equivalent to `exec newgrp'; see \fInewgrp\fR(1).
3192 Available only if the shell was so compiled;
3193 see the \fBversion\fR shell variable.
3194 .TP 8
3195 .B nice \fR[\fB+\fInumber\fR] [\fIcommand\fR]
3196 Sets the scheduling priority for the shell to \fInumber\fR, or, without
3197 \fInumber\fR, to 4.  With \fIcommand\fR, runs \fIcommand\fR at the appropriate
3198 priority.
3199 The greater the \fInumber\fR, the less cpu
3200 the process gets.  The super-user may specify negative
3201 priority by using `nice \-number ...'.  Command is always
3202 executed in a sub-shell, and the restrictions placed on
3203 commands in simple \fIif\fR statements apply.
3204 .TP 8
3205 .B nohup \fR[\fIcommand\fR]
3206 With \fIcommand\fR, runs \fIcommand\fR such that it will ignore hangup signals.
3207 Note that commands may set their own response to hangups, overriding \fInohup\fR.
3208 Without an argument, causes the non-interactive shell only to
3209 ignore hangups for the remainder of the script.
3210 See also \fBSignal handling\fR and the \fIhup\fR builtin command.
3211 .TP 8
3212 .B notify \fR[\fB%\fIjob\fR ...]
3213 Causes the shell to notify the user asynchronously when the status of any
3214 of the specified jobs (or, without %\fIjob\fR, the current job) changes,
3215 instead of waiting until the next prompt as is usual.
3216 \fIjob\fR may be a number, a string, `', `%', `+' or `\-' as described
3217 under \fBJobs\fR.
3218 See also the \fBnotify\fR shell variable.
3219 .TP 8
3220 .B onintr \fR[\fB\-\fR|\fIlabel\fR]
3221 Controls the action of the shell on interrupts.  Without arguments,
3222 restores the default action of the shell on interrupts,
3223 which is to terminate shell scripts or to return to the
3224 terminal command input level.
3225 With `\-', causes all interrupts to be ignored.
3226 With \fIlabel\fR, causes the shell to execute a `goto \fIlabel\fR'
3227 when an interrupt is received or a child process terminates because it was
3228 interrupted.
3229 .IP "" 8
3230 \fIonintr\fR is ignored if the shell is running detached and in system
3231 startup files (see \fBFILES\fR), where interrupts are disabled anyway.
3232 .TP 8
3233 .B popd \fR[\fB\-p\fR] [\fB\-l\fR] [\fB\-n\fR|\fB\-v\fR] \fR[\fB+\fIn\fR]
3234 Without arguments, pops the directory stack and returns to the new top directory.
3235 With a number `+\fIn\fR', discards the \fIn\fR'th entry in the stack.
3236 .IP "" 8
3237 Finally, all forms of \fIpopd\fR print the final directory stack,
3238 just like \fIdirs\fR.  The \fBpushdsilent\fR shell variable can be set to
3239 prevent this and the \fB\-p\fR flag can be given to override \fBpushdsilent\fR.
3240 The \fB\-l\fR, \fB\-n\fR and \fB\-v\fR flags have the same effect on \fIpopd\fR
3241 as on \fIdirs\fR.  (+)
3242 .TP 8
3243 .B printenv \fR[\fIname\fR] (+)
3244 Prints the names and values of all environment variables or,
3245 with \fIname\fR, the value of the environment variable \fIname\fR.
3246 .TP 8
3247 .B pushd \fR[\fB\-p\fR] [\fB\-l\fR] [\fB\-n\fR|\fB\-v\fR] [\fIname\fR|\fB+\fIn\fR]
3248 Without arguments, exchanges the top two elements of the directory stack.
3249 If \fBpushdtohome\fR is set, \fIpushd\fR without arguments does `pushd ~',
3250 like \fIcd\fR.  (+)
3251 With \fIname\fR, pushes the current working directory onto the directory
3252 stack and changes to \fIname\fR.
3253 If \fIname\fR is `\-' it is interpreted as the previous working directory
3254 (see \fBFilename substitution\fR).  (+)
3255 If \fBdunique\fR is set, \fIpushd\fR removes any instances of \fIname\fR
3256 from the stack before pushing it onto the stack.  (+)
3257 With a number `+\fIn\fR', rotates the \fIn\fRth element of the
3258 directory stack around to be the top element and changes to it.
3259 If \fBdextract\fR is set, however, `pushd +\fIn\fR' extracts the \fIn\fRth
3260 directory, pushes it onto the top of the stack and changes to it.  (+)
3261 .IP "" 8
3262 Finally, all forms of \fIpushd\fR print the final directory stack,
3263 just like \fIdirs\fR.  The \fBpushdsilent\fR shell variable can be set to
3264 prevent this and the \fB\-p\fR flag can be given to override \fBpushdsilent\fR.
3265 The \fB\-l\fR, \fB\-n\fR and \fB\-v\fR flags have the same effect on \fIpushd\fR
3266 as on \fIdirs\fR.  (+)
3267 .TP 8
3268 .B rehash
3269 Causes the internal hash table of the contents of the
3270 directories in the \fBpath\fR variable to be recomputed.  This is
3271 needed if the \fBautorehash\fR shell variable is not set and new
3272 commands are added to directories in \fBpath\fR while you are logged
3273 in.  With \fBautorehash\fR, a new command will be found
3274 automatically, except in the special case where another command of
3275 the same name which is located in a different directory already
3276 exists in the hash table.  Also flushes the cache of home directories
3277 built by tilde expansion.
3278 .TP 8
3279 .B repeat \fIcount command
3280 The specified \fIcommand\fR,
3281 which is subject to the same restrictions as the \fIcommand\fR
3282 in the one line \fIif\fR statement above, is executed \fIcount\fR times.
3283 I/O redirections occur exactly once, even if \fIcount\fR is 0.
3284 .TP 8
3285 .B rootnode //\fInodename \fR(+)
3286 Changes the rootnode to //\fInodename\fR, so that `/' will be interpreted
3287 as `//\fInodename\fR'.  (Domain/OS only)
3288 .PP
3289 .B sched \fR(+)
3290 .br
3291 .B sched \fR[\fB+\fR]\fIhh:mm command\fR \fR(+)
3292 .PD 0
3293 .TP 8
3294 .B sched \-\fIn\fR (+)
3295 The first form prints the scheduled-event list.
3296 The \fBsched\fR shell variable may be set to define the format in which
3297 the scheduled-event list is printed.
3298 The second form adds \fIcommand\fR to the scheduled-event list.
3299 For example,
3300 .PD
3301 .RS +8
3302 .IP "" 4
3303 > sched 11:00 echo It\e's eleven o\e'clock.
3304 .PP
3305 causes the shell to echo `It's eleven o'clock.' at 11 AM.
3306 The time may be in 12-hour AM/PM format
3307 .IP "" 4
3308 .\" TODO
3309 > sched 5pm set prompt='[%h] It\e's after 5; go home: >'
3310 .PP
3311 or may be relative to the current time:
3312 .IP "" 4
3313 > sched +2:15 /usr/lib/uucp/uucico \-r1 \-sother
3314 .PP
3315 A relative time specification may not use AM/PM format.
3316 The third form removes item \fIn\fR from the event list:
3317 .IP "" 4
3318 > sched
3319 .br
3320      1  Wed Apr  4 15:42  /usr/lib/uucp/uucico \-r1 \-sother
3321 .br
3322      2  Wed Apr  4 17:00  set prompt=[%h] It's after 5; go home: >
3323 .br
3324 > sched \-2
3325 .br
3326 > sched
3327 .br
3328      1  Wed Apr  4 15:42  /usr/lib/uucp/uucico \-r1 \-sother
3329 .PP
3330 A command in the scheduled-event list is executed just before the first
3331 prompt is printed after the time when the command is scheduled.
3332 It is possible to miss the exact time when the command is to be run, but
3333 an overdue command will execute at the next prompt.
3334 A command which comes due while the shell
3335 is waiting for user input is executed immediately.
3336 However, normal operation of an already-running command will not
3337 be interrupted so that a scheduled-event list element may be run.
3338 .PP
3339 This mechanism is similar to, but not the same as, the \fIat\fR(1)
3340 command on some Unix systems.
3341 Its major disadvantage is that it may not run a command at exactly the
3342 specified time.
3343 Its major advantage is that because \fIsched\fR runs directly from
3344 the shell, it has access to shell variables and other structures.
3345 This provides a mechanism for changing one's working environment
3346 based on the time of day.
3347 .RE
3348 .PP
3349 .B set
3350 .br
3351 .B set \fIname\fR ...
3352 .br
3353 .B set \fIname\fR\fB=\fIword\fR ...
3354 .br
3355 .B set [\-r] [\-f|\-l] \fIname\fR\fB=(\fIwordlist\fB)\fR ... (+)
3356 .br
3357 .B set \fIname[index]\fR\fB=\fIword\fR ...
3358 .br
3359 .B set \-r \fR(+)
3360 .br
3361 .B set \-r \fIname\fR ... (+)
3362 .PD 0
3363 .TP 8
3364 .B set \-r \fIname\fR\fB=\fIword\fR ... (+)
3365 The first form of the command prints the value of all shell variables.
3366 Variables which contain more than a single word print as a
3367 parenthesized word list.
3368 The second form sets \fIname\fR to the null string.
3369 The third form sets \fIname\fR to the single \fIword\fR.
3370 The fourth form sets \fIname\fR to the list of words in
3371 \fIwordlist\fR.  In all cases the value is command and filename expanded.
3372 If \fB\-r\fR is specified, the value is set read-only.  If \fB\-f\fR or
3373 \fB\-l\fR are specified, set only unique words keeping their order.
3374 \fB\-f\fR prefers the first occurrence of a word, and \fB\-l\fR the last.
3375 The fifth form sets the \fIindex\fR'th component of \fIname\fR to \fIword\fR;
3376 this component must already exist.
3377 The sixth form lists only the names of all shell variables that are read-only.
3378 The seventh form makes \fIname\fR read-only, whether or not it has a value.
3379 The eighth form is the same as the third form, but
3380 make \fIname\fR read-only at the same time.
3381 .PD
3382 .IP "" 8
3383 These arguments can be repeated to set and/or make read-only multiple variables
3384 in a single set command.  Note, however, that variable expansion
3385 happens for all arguments before any setting occurs.  Note also that `=' can
3386 be adjacent to both \fIname\fR and \fIword\fR or separated from both by
3387 whitespace, but cannot be adjacent to only one or the other.
3388 See also the \fIunset\fR builtin command.
3389 .TP 8
3390 .B setenv \fR[\fIname \fR[\fIvalue\fR]]
3391 Without arguments, prints the names and values of all environment variables.
3392 Given \fIname\fR, sets the environment variable \fIname\fR to \fIvalue\fR
3393 or, without \fIvalue\fR, to the null string.
3394 .TP 8
3395 .B setpath \fIpath \fR(+)
3396 Equivalent to \fIsetpath\fR(1).  (Mach only)
3397 .TP 8
3398 .B setspath\fR LOCAL|\fIsite\fR|\fIcpu\fR ...  (+)
3399 Sets the system execution path.  (TCF only)
3400 .TP 8
3401 .B settc \fIcap value \fR(+)
3402 Tells the shell to believe that the terminal capability \fIcap\fR
3403 (as defined in \fItermcap\fR(5)) has the value \fIvalue\fR.
3404 No sanity checking is done.
3405 Concept terminal users may have to `settc xn no' to get proper
3406 wrapping at the rightmost column.
3407 .TP 8
3408 .B setty \fR[\fB\-d\fR|\fB\-q\fR|\fB\-x\fR] [\fB\-a\fR] [[\fB+\fR|\fB\-\fR]\fImode\fR] (+)
3409 Controls which tty modes (see \fBTerminal management\fR)
3410 the shell does not allow to change.
3411 \fB\-d\fR, \fB\-q\fR or \fB\-x\fR tells \fIsetty\fR to act
3412 on the `edit', `quote' or `execute' set of tty modes respectively; without
3413 \fB\-d\fR, \fB\-q\fR or \fB\-x\fR, `execute' is used.
3414 .IP "" 8
3415 Without other arguments, \fIsetty\fR lists the modes in the chosen set
3416 which are fixed on (`+mode') or off (`\-mode').
3417 The available modes, and thus the display, vary from system to system.
3418 With \fB\-a\fR, lists all tty modes in the chosen set
3419 whether or not they are fixed.
3420 With \fB+\fImode\fR, \fB\-\fImode\fR or \fImode\fR, fixes \fImode\fR on or off
3421 or removes control from \fImode\fR in the chosen set.
3422 For example, `setty +echok echoe' fixes `echok' mode on and allows commands
3423 to turn `echoe' mode on or off, both when the shell is executing commands.
3424 .TP 8
3425 .B setxvers\fR [\fIstring\fR] (+)
3426 Set the experimental version prefix to \fIstring\fR, or removes it
3427 if \fIstring\fR is omitted.  (TCF only)
3428 .TP 8
3429 .B shift \fR[\fIvariable\fR]
3430 Without arguments, discards \fBargv\fR[1] and shifts the members of
3431 \fBargv\fR to the left.  It is an error for \fBargv\fR not to be set or to have
3432 less than one word as value.  With \fIvariable\fR, performs the
3433 same function on \fIvariable\fR.
3434 .TP 8
3435 .B source \fR[\fB\-h\fR] \fIname\fR [\fIargs\fR ...]
3436 The shell reads and executes commands from \fIname\fR.
3437 The commands are not placed on the history list.
3438 If any \fIargs\fR are given, they are placed in \fBargv\fR.  (+)
3439 \fIsource\fR commands may be nested;
3440 if they are nested too deeply the shell may run out of file descriptors.
3441 An error in a \fIsource\fR at any level terminates all nested
3442 \fIsource\fR commands.
3443 With \fB\-h\fR, commands are placed on the history list instead of being
3444 executed, much like `history \-L'.
3445 .TP 8
3446 .B stop \fB%\fIjob\fR|\fIpid\fR ...
3447 Stops the specified jobs or processes which are executing in the background.
3448 \fIjob\fR may be a number, a string, `', `%', `+' or `\-' as described
3449 under \fBJobs\fR.
3450 There is no default \fIjob\fR; saying just `stop' does not stop
3451 the current job.
3452 .TP 8
3453 .B suspend
3454 Causes the shell to stop in its tracks, much as if it had
3455 been sent a stop signal with \fB^Z\fR.  This is most often used to
3456 stop shells started by \fIsu\fR(1).
3457 .PP
3458 .B switch (\fIstring\fB)
3459 .br
3460 .B case \fIstr1\fB:
3461 .PD 0
3462 .IP "" 4
3463 \&...
3464 .br
3465 .B breaksw
3466 .PP
3467 \&...
3468 .PP
3469 .B default:
3470 .IP "" 4
3471 \&...
3472 .br
3473 .B breaksw
3474 .TP 8
3475 .B endsw
3476 Each case label is successively matched, against the
3477 specified \fIstring\fR which is first command and filename expanded.
3478 The file metacharacters `*', `?' and `[...]'  may be used
3479 in the case labels, which are variable expanded.  If none
3480 of the labels match before a `default' label is found, then
3481 the execution begins after the default label.  Each case
3482 label and the default label must appear at the beginning of
3483 a line.  The command \fIbreaksw\fR causes execution to continue
3484 after the \fIendsw\fR.  Otherwise control may fall through case
3485 labels and default labels as in C.  If no label matches and
3486 there is no default, execution continues after the \fIendsw\fR.
3487 .PD
3488 .TP 8
3489 .B telltc \fR(+)
3490 Lists the values of all terminal capabilities (see \fItermcap\fR(5)).
3491 .TP 8
3492 .B termname \fR[\fIterminal type\fR] \fR(+)
3493 Tests if \fIterminal type\fR (or the current value of \fBTERM\fR if no
3494 \fIterminal type\fR is given) has an entry in the hosts termcap(5) or
3495 terminfo(5) database. Prints the terminal type to stdout and returns 0
3496 if an entry is present otherwise returns 1.
3497 .TP 8
3498 .B time \fR[\fIcommand\fR]
3499 Executes \fIcommand\fR (which must be a simple command, not an alias,
3500 a pipeline, a command list or a parenthesized command list)
3501 and prints a time summary as described under the \fBtime\fR variable.
3502 If necessary, an extra shell is created to print the time statistic when
3503 the command completes.
3504 Without \fIcommand\fR, prints a time summary for the current shell and its
3505 children.
3506 .TP 8
3507 .B umask \fR[\fIvalue\fR]
3508 Sets the file creation mask to \fIvalue\fR, which is given in octal.
3509 Common values for the mask are
3510 002, giving all access to the group and read and execute access to others, and
3511 022, giving read and execute access to the group and others.
3512 Without \fIvalue\fR, prints the current file creation mask.
3513 .TP 8
3514 .B unalias \fIpattern\fR
3515 .br
3516 Removes all aliases whose names match \fIpattern\fR.
3517 `unalias *' thus removes all aliases.
3518 It is not an error for nothing to be \fIunalias\fRed.
3519 .TP 8
3520 .B uncomplete \fIpattern\fR (+)
3521 Removes all completions whose names match \fIpattern\fR.
3522 `uncomplete *' thus removes all completions.
3523 It is not an error for nothing to be \fIuncomplete\fRd.
3524 .TP 8
3525 .B unhash
3526 Disables use of the internal hash table to speed location of
3527 executed programs.
3528 .TP 8
3529 .B universe \fIuniverse\fR (+)
3530 Sets the universe to \fIuniverse\fR.  (Masscomp/RTU only)
3531 .TP 8
3532 .B unlimit \fR[\fB\-hf\fR] [\fIresource\fR]
3533 Removes the limitation on \fIresource\fR or, if no \fIresource\fR is
3534 specified, all \fIresource\fR limitations.
3535 With \fB\-h\fR, the corresponding hard limits are removed.
3536 Only the super-user may do this.
3537 Note that \fBunlimit\fR may not exit successful, since most systems
3538 do not allow \fIdescriptors\fR to be unlimited.
3539 With \fB\-f\fR errors are ignored.
3540 .TP 8
3541 .B unset \fIpattern
3542 Removes all variables whose names match \fIpattern\fR, unless they are read-only.
3543 `unset *' thus removes all variables unless they are read-only;
3544 this is a bad idea.
3545 It is not an error for nothing to be \fIunset\fR.
3546 .TP 8
3547 .B unsetenv \fIpattern
3548 Removes all environment variables whose names match \fIpattern\fR.
3549 `unsetenv *' thus removes all environment variables;
3550 this is a bad idea.
3551 It is not an error for nothing to be \fIunsetenv\fRed.
3552 .TP 8
3553 .B ver \fR[\fIsystype\fR [\fIcommand\fR]] (+)
3554 Without arguments, prints \fBSYSTYPE\fR.  With \fIsystype\fR, sets \fBSYSTYPE\fR
3555 to \fIsystype\fR.  With \fIsystype\fR and \fIcommand\fR, executes \fIcommand\fR
3556 under \fIsystype\fR.  \fIsystype\fR may be `bsd4.3' or `sys5.3'.
3557 (Domain/OS only)
3558 .TP 8
3559 .B wait
3560 The shell waits for all background jobs.  If the shell is interactive, an
3561 interrupt will disrupt the wait and cause the shell to print the names and job
3562 numbers of all outstanding jobs.
3563 .TP 8
3564 .B warp \fIuniverse\fR (+)
3565 Sets the universe to \fIuniverse\fR.  (Convex/OS only)
3566 .TP 8
3567 .B watchlog \fR(+)
3568 An alternate name for the \fIlog\fR builtin command (q.v.).
3569 Available only if the shell was so compiled;
3570 see the \fBversion\fR shell variable.
3571 .TP 8
3572 .B where \fIcommand\fR (+)
3573 Reports all known instances of \fIcommand\fR, including aliases, builtins and
3574 executables in \fBpath\fR.
3575 .TP 8
3576 .B which\fR \fIcommand\fR (+)
3577 Displays the command that will be executed by the shell after substitutions,
3578 \fBpath\fR searching, etc.
3579 The builtin command is just like \fIwhich\fR(1), but it correctly reports
3580 \fItcsh\fR aliases and builtins and is 10 to 100 times faster.
3581 See also the \fIwhich-command\fR editor command.
3582 .PP
3583 .B while (\fIexpr\fB)\fR
3584 .br
3585 \&...
3586 .PD 0
3587 .TP 8
3588 .B end
3589 Executes the commands between the \fIwhile\fR and the matching \fIend\fR
3590 while \fIexpr\fR (an expression, as described under \fBExpressions\fR)
3591 evaluates non-zero.
3592 \fIwhile\fR and \fIend\fR must appear alone on their input lines.
3593 \fIbreak\fR and \fIcontinue\fR may be used to terminate or continue the
3594 loop prematurely.
3595 If the input is a terminal, the user is prompted the first time
3596 through the loop as with \fIforeach\fR.
3597 .PD
3598 .SS "Special aliases (+)"
3599 If set, each of these aliases executes automatically at the indicated time.
3600 They are all initially undefined.
3601 .TP 8
3602 .B beepcmd
3603 Runs when the shell wants to ring the terminal bell.
3604 .TP 8
3605 .B cwdcmd
3606 Runs after every change of working directory.  For example, if the user is
3607 working on an X window system using \fIxterm\fR(1) and a re-parenting window
3608 manager that supports title bars such as \fItwm\fR(1) and does
3609 .RS +8
3610 .IP "" 4
3611 > alias cwdcmd  'echo \-n "^[]2;${HOST}:$cwd ^G"'
3612 .PP
3613 then the shell will change the title of the running \fIxterm\fR(1)
3614 to be the name of the host, a colon, and the full current working directory.
3615 A fancier way to do that is
3616 .IP "" 4
3617 > alias cwdcmd 'echo \-n "^[]2;${HOST}:$cwd^G^[]1;${HOST}^G"'
3618 .PP
3619 This will put the hostname and working directory on the title bar but
3620 only the hostname in the icon manager menu.
3621 .PP
3622 Note that putting a \fIcd\fR, \fIpushd\fR or \fIpopd\fR in \fIcwdcmd\fR
3623 may cause an infinite loop.  It is the author's opinion that anyone doing
3624 so will get what they deserve.
3625 .RE
3626 .TP 8
3627 .B jobcmd
3628 Runs before each command gets executed, or when the command changes state.
3629 This is similar to \fIpostcmd\fR, but it does not print builtins.
3630 .RS +8
3631 .IP "" 4
3632 > alias jobcmd  'echo \-n "^[]2\e;\e!#:q^G"'
3633 .PP
3634 then executing \fIvi foo.c\fR will put the command string in the xterm title bar.
3635 .RE
3636 .TP 8
3637 .B helpcommand
3638 Invoked by the \fBrun-help\fR editor command.  The command name for which help
3639 is sought is passed as sole argument.
3640 For example, if one does
3641 .RS +8
3642 .IP "" 4
3643 > alias helpcommand '\e!:1 --help'
3644 .PP
3645 then the help display of the command itself will be invoked, using the GNU
3646 help calling convention.
3647 Currently there is no easy way to account for various calling conventions (e.g.,
3648 the customary Unix `-h'), except by using a table of many commands.
3649 .RE
3650 .TP 8
3651 .B periodic
3652 Runs every \fBtperiod\fR minutes.  This provides a convenient means for
3653 checking on common but infrequent changes such as new mail.  For example,
3654 if one does
3655 .RS +8
3656 .IP "" 4
3657 > set tperiod = 30
3658 .br
3659 > alias periodic checknews
3660 .PP
3661 then the \fIchecknews\fR(1) program runs every 30 minutes.
3662 If \fIperiodic\fR is set but \fBtperiod\fR is unset or set to 0,
3663 \fIperiodic\fR behaves like \fIprecmd\fR.
3664 .RE
3665 .TP 8
3666 .B precmd
3667 Runs just before each prompt is printed.  For example, if one does
3668 .RS +8
3669 .IP "" 4
3670 > alias precmd date
3671 .PP
3672 then \fIdate\fR(1) runs just before the shell prompts for each command.
3673 There are no limits on what \fIprecmd\fR can be set to do, but discretion
3674 should be used.
3675 .RE
3676 .TP 8
3677 .B postcmd
3678 Runs before each command gets executed.
3679 .RS +8
3680 .IP "" 4
3681 > alias postcmd  'echo \-n "^[]2\e;\e!#:q^G"'
3682 .PP
3683 then executing \fIvi foo.c\fR will put the command string in the xterm title bar.
3684 .RE
3685 .TP 8
3686 .B shell
3687 Specifies the interpreter for executable scripts which do not themselves
3688 specify an interpreter.  The first word should be a full path name to the
3689 desired interpreter (e.g., `/bin/csh' or `/usr/local/bin/tcsh').
3690 .SS "Special shell variables"
3691 The variables described in this section have special meaning to the shell.
3692 .PP
3693 The shell sets \fBaddsuffix\fR, \fBargv\fR, \fBautologout\fR, \fBcsubstnonl\fR, \fBcommand\fR, \fBecho_style\fR,
3694 \fBedit\fR, \fBgid\fR, \fBgroup\fR, \fBhome\fR, \fBloginsh\fR, \fBoid\fR, \fBpath\fR,
3695 \fBprompt\fR, \fBprompt2\fR, \fBprompt3\fR, \fBshell\fR, \fBshlvl\fR,
3696 \fBtcsh\fR, \fBterm\fR, \fBtty\fR, \fBuid\fR, \fBuser\fR and \fBversion\fR at
3697 startup; they do not change thereafter unless changed by the user.  The shell
3698 updates \fBcwd\fR, \fBdirstack\fR, \fBowd\fR and \fBstatus\fR when necessary,
3699 and sets \fBlogout\fR on logout.
3700 .PP
3701 The shell synchronizes \fBgroup\fR, \fBhome\fR, \fBpath\fR, \fBshlvl\fR,
3702 \fBterm\fR and \fBuser\fR with the environment variables of the same names:
3703 whenever the environment variable changes the shell changes the corresponding
3704 shell variable to match (unless the shell variable is read-only) and vice
3705 versa.  Note that although \fBcwd\fR and \fBPWD\fR have identical meanings, they
3706 are not synchronized in this manner, and that the shell automatically
3707 converts between the different formats of \fBpath\fR and \fBPATH\fR.
3708 .TP 8
3709 .B addsuffix \fR(+)
3710 If set, filename completion adds `/' to the end of directories and a space
3711 to the end of normal files when they are matched exactly.
3712 Set by default.
3713 .TP 8
3714 .B afsuser \fR(+)
3715 If set, \fBautologout\fR's autolock feature uses its value instead of
3716 the local username for kerberos authentication.
3717 .TP 8
3718 .B ampm \fR(+)
3719 If set, all times are shown in 12-hour AM/PM format.
3720 .TP 8
3721 .B anyerror \fR(+)
3722 This variable selects what is propagated to the value of the
3723 \fBstatus\fR variable. For more information see the description of the
3724 \fBstatus\fR variable below.
3725 .TP 8
3726 .B argv
3727 The arguments to the shell.  Positional parameters are taken from \fBargv\fR,
3728 i.e., `$1' is replaced by `$argv[1]', etc.
3729 Set by default, but usually empty in interactive shells.
3730 .TP 8
3731 .B autocorrect \fR(+)
3732 If set, the \fIspell-word\fR editor command is invoked automatically before
3733 each completion attempt.
3734 .TP 8
3735 .B autoexpand \fR(+)
3736 If set, the \fIexpand-history\fR editor command is invoked automatically
3737 before each completion attempt. If this is set to \fIonlyhistory\fR, then
3738 only history will be expanded and a second completion will expand filenames.
3739 .TP 8
3740 .B autolist \fR(+)
3741 If set, possibilities are listed after an ambiguous completion.
3742 If set to `ambiguous', possibilities are listed only when no new
3743 characters are added by completion.
3744 .TP 8
3745 .B autologout \fR(+)
3746 The first word is the number of minutes of inactivity before automatic
3747 logout.  The optional second word is the number of minutes of inactivity
3748 before automatic locking.
3749 When the shell automatically logs out, it prints `auto-logout', sets the
3750 variable \fBlogout\fR to `automatic' and exits.
3751 When the shell automatically locks, the user is required to enter his password
3752 to continue working.  Five incorrect attempts result in automatic logout.
3753 Set to `60' (automatic logout after 60 minutes, and no locking) by default
3754 in login and superuser shells, but not if the shell thinks it is running
3755 under a window system (i.e., the \fBDISPLAY\fR environment variable is set),
3756 the tty is a pseudo-tty (pty) or the shell was not so compiled (see the
3757 \fBversion\fR shell variable).
3758 See also the \fBafsuser\fR and \fBlogout\fR shell variables.
3759 .TP 8
3760 .B autorehash \fR(+)
3761 If set, the internal hash table of the contents of the directories in the
3762 \fBpath\fR variable will be recomputed if a command is not found in the hash
3763 table.  In addition, the list of available commands will be rebuilt for each
3764 command completion or spelling correction attempt if set to `complete' or
3765 `correct' respectively; if set to `always', this will be done for both
3766 cases.
3767 .TP 8
3768 .B backslash_quote \fR(+)
3769 .\" TODO
3770 If set, backslashes (`\e') always quote `\e', `'', and `"'.  This may make
3771 complex quoting tasks easier, but it can cause syntax errors in \fIcsh\fR(1)
3772 scripts.
3773 .TP 8
3774 .B catalog
3775 The file name of the message catalog.
3776 If set, tcsh use `tcsh.${catalog}' as a message catalog instead of
3777 default `tcsh'.
3778 .TP 8
3779 .B cdpath
3780 A list of directories in which \fIcd\fR should search for
3781 subdirectories if they aren't found in the current directory.
3782 .TP 8
3783 .B cdtohome \fR(+)
3784 If not set, \fIcd\fR requires a directory \fIname\fR, and will not go to the
3785 \fBhome\fR directory if it's omitted.
3786 This is set by default.
3787 .TP 8
3788 .B color
3789 If set, it enables color display for the builtin \fBls\-F\fR and it passes
3790 \fB\-\-color=auto\fR to \fBls\fR.  Alternatively, it can be set to only
3791 \fBls\-F\fR or only \fBls\fR to enable color to only one command.  Setting
3792 it to nothing is equivalent to setting it to \fB(ls\-F ls)\fR.
3793 .TP 8
3794 .B colorcat
3795 If set, it enables color escape sequence for NLS message files.
3796 And display colorful NLS messages.
3797 .TP 8
3798 .B command \fR(+)
3799 If set, the command which was passed to the shell with the \fB-c\fR flag (q.v.).
3800 .TP 8
3801 .B compat_expr \fR(+)
3802 If set, the shell will evaluate expressions right to left, like the original
3803 \fIcsh\fR.
3804 .TP 8
3805 .B complete \fR(+)
3806 If set to `igncase', the completion becomes case insensitive.
3807 If set to `enhance', completion ignores case and considers
3808 hyphens and underscores to be equivalent; it will also treat
3809 periods, hyphens and underscores (`.', `\-' and `_') as word
3810 separators.
3811 If set to `Enhance', completion matches uppercase and underscore
3812 characters explicitly and matches lowercase and hyphens in a
3813 case-insensitive manner; it will treat periods, hyphens and underscores
3814 as word separators.
3815 .TP 8
3816 .B continue \fR(+)
3817 If set to a list of commands, the shell will continue the listed
3818 commands, instead of starting a new one.
3819 .TP 8
3820 .B continue_args \fR(+)
3821 Same as continue, but the shell will execute:
3822 .RS +8
3823 .IP "" 4
3824 echo \`pwd\` $argv > ~/.<cmd>_pause; %<cmd>
3825 .RE
3826 .TP 8
3827 .B correct \fR(+)
3828 If set to `cmd', commands are automatically spelling-corrected.
3829 If set to `complete', commands are automatically completed.
3830 If set to `all', the entire command line is corrected.
3831 .TP 8
3832 .B csubstnonl \fR(+)
3833 If set, newlines and carriage returns in command substitution are
3834 replaced by spaces.  Set by default.
3835 .TP 8
3836 .B cwd
3837 The full pathname of the current directory.
3838 See also the \fBdirstack\fR and \fBowd\fR shell variables.
3839 .TP 8
3840 .B dextract \fR(+)
3841 If set, `pushd +\fIn\fR' extracts the \fIn\fRth directory from the directory
3842 stack rather than rotating it to the top.
3843 .TP 8
3844 .B dirsfile \fR(+)
3845 The default location in which `dirs \-S' and `dirs \-L' look for
3846 a history file.  If unset, \fI~/.cshdirs\fR is used.
3847 Because only \fI~/.tcshrc\fR is normally sourced before \fI~/.cshdirs\fR,
3848 \fBdirsfile\fR should be set in \fI~/.tcshrc\fR rather than \fI~/.login\fR.
3849 .TP 8
3850 .B dirstack \fR(+)
3851 An array of all the directories on the directory stack.
3852 `$dirstack[1]' is the current working directory, `$dirstack[2]'
3853 the first directory on the stack, etc.
3854 Note that the current working directory is `$dirstack[1]' but `=0' in
3855 directory stack substitutions, etc.
3856 One can change the stack arbitrarily by setting \fBdirstack\fR,
3857 but the first element (the current working directory) is always correct.
3858 See also the \fBcwd\fR and \fBowd\fR shell variables.
3859 .TP 8
3860 .B dspmbyte \fR(+)
3861 Has an effect iff 'dspm' is listed as part of the \fBversion\fR shell variable.
3862 If set to `euc', it enables display and editing EUC-kanji(Japanese) code.
3863 If set to `sjis', it enables display and editing Shift-JIS(Japanese) code.
3864 If set to `big5', it enables display and editing Big5(Chinese) code.
3865 If set to `utf8', it enables display and editing Utf8(Unicode) code.
3866 If set to the following format, it enables display and editing of original
3867 multi-byte code format:
3868 .RS +8
3869 .IP "" 4
3870 > set dspmbyte = 0000....(256 bytes)....0000
3871 .PP
3872 The table requires \fBjust\fR 256 bytes.  Each character of 256 characters
3873 corresponds (from left to right) to the ASCII codes 0x00, 0x01, ... 0xff.  Each
3874 character
3875 .\" (position in this table?)
3876 is set to number 0,1,2 and 3.  Each number has the following meaning:
3877 .br
3878   0 ... not used for multi-byte characters.
3879 .br
3880   1 ... used for the first byte of a multi-byte character.
3881 .br
3882   2 ... used for the second byte of a multi-byte character.
3883 .br
3884   3 ... used for both the first byte and second byte of a multi-byte character.
3885 .\" SHK: I tried my best to get the following to be grammatically correct.
3886 .\" However, I still don't understand what's going on here.  In the
3887 .\" following example, there are three bytes, but the text seems to refer to
3888 .\" each nybble as a character.  What's going on here?  It this 3-byte code
3889 .\" in the table?  The text above seems to imply that there are 256
3890 .\" characters/bytes in the table.  If I get some more info on this (perhaps
3891 .\" a complete example), I could fix the text to be grammatically correct.
3892 .\" (steve.kelem@xilinx.com 1999/09/13)
3893 .PP
3894   Example:
3895 .br
3896 If set to `001322', the first character (means 0x00 of the ASCII code) and
3897 second character (means 0x01 of ASCII code) are set to `0'.  Then, it is not
3898 used for multi-byte characters.  The 3rd character (0x02) is set to '1',
3899 indicating that it is used for the first byte of a multi-byte character.
3900 The 4th character(0x03) is set '3'.  It is used for both the first byte and
3901 the second byte of a multi-byte character.  The 5th and 6th characters
3902 (0x04,0x05) are set to '2', indicating that they are used for the second
3903 byte of a multi-byte character.
3904 .PP
3905 The GNU fileutils version of ls cannot display multi-byte
3906 filenames without the -N ( --literal ) option.   If you are using
3907 this version, set the second word of dspmbyte to "ls".  If not, for
3908 example, "ls-F -l" cannot display multi-byte filenames.
3909 .PP
3910   Note:
3911 .br
3912 This variable can only be used if KANJI and DSPMBYTE has been defined at
3913 compile time.
3914 .RE
3915 .TP 8
3916 .B dunique \fR(+)
3917 If set, \fIpushd\fR removes any instances of \fIname\fR
3918 from the stack before pushing it onto the stack.
3919 .TP 8
3920 .B echo
3921 If set, each command with its arguments is echoed just before it is
3922 executed.  For non-builtin commands all expansions occur before
3923 echoing.  Builtin commands are echoed before command and filename
3924 substitution, because these substitutions are then done selectively.
3925 Set by the \fB\-x\fR command line option.
3926 .TP 8
3927 .B echo_style \fR(+)
3928 The style of the \fIecho\fR builtin.  May be set to
3929 .PP
3930 .RS +8
3931 .PD 0
3932 .TP 8
3933 bsd
3934 Don't echo a newline if the first argument is `\-n'; the default for \fIcsh\fR.
3935 .TP 8
3936 sysv
3937 Recognize backslashed escape sequences in echo strings.
3938 .TP 8
3939 both
3940 Recognize both the `\-n' flag and backslashed escape sequences; the default
3941 for \fItcsh\fR.
3942 .TP 8
3943 none
3944 Recognize neither.
3945 .PD
3946 .PP
3947 Set by default to the local system default.  The BSD and System V
3948 options are described in the \fIecho\fR(1) man pages on the appropriate
3949 systems.
3950 .RE
3951 .TP 8
3952 .B edit \fR(+)
3953 If set, the command-line editor is used.  Set by default in interactive
3954 shells.
3955 .TP 8
3956 .B editors \fR(+)
3957 A list of command names for the \fIrun-fg-editor\fR editor command to match.
3958 If not set, the \fBEDITOR\fR (`ed' if unset) and \fBVISUAL\fR (`vi' if unset)
3959 environment variables will be used instead.
3960 .TP 8
3961 .B ellipsis \fR(+)
3962 If set, the `%c'/`%.' and `%C' prompt sequences (see the \fBprompt\fR
3963 shell variable) indicate skipped directories with an ellipsis (`...')
3964 instead of `/<skipped>'.
3965 .TP 8
3966 .B euid \fR(+)
3967 The user's effective user ID.
3968 .TP 8
3969 .B euser \fR(+)
3970 The first matching passwd entry name corresponding to the effective user ID.
3971 .TP 8
3972 .B fignore \fR(+)
3973 Lists file name suffixes to be ignored by completion.
3974 .TP 8
3975 .B filec
3976 In \fItcsh\fR, completion is always used and this variable is ignored
3977 by default. If 
3978 .B edit
3979 is unset, then the traditional \fIcsh\fR completion is used.
3980 If set in \fIcsh\fR, filename completion is used.
3981 .TP 8
3982 .B gid \fR(+)
3983 The user's real group ID.
3984 .TP 8
3985 .B globdot \fR(+)
3986 If set, wild-card glob patterns will match files and directories beginning
3987 with `.' except for `.' and `..'
3988 .TP 8
3989 .B globstar \fR(+)
3990 If set, the `**' and `***' file glob patterns will match any string of 
3991 characters including `/' traversing any existing sub-directories.  (e.g. 
3992 `ls **.c' will list all the .c files in the current directory tree).
3993 If used by itself, it will match zero or more sub-directories
3994 (e.g. `ls /usr/include/**/time.h' will list any file named `time.h'
3995 in the /usr/include directory tree; whereas `ls /usr/include/**time.h'
3996 will match any file in the /usr/include directory tree ending in `time.h').
3997 To prevent problems with recursion, the `**' glob-pattern will not 
3998 descend into a symbolic link containing a directory.  To override this,
3999 use `***'
4000 .TP 8
4001 .B group \fR(+)
4002 The user's group name.
4003 .TP 8
4004 .B highlight
4005 If set, the incremental search match (in \fIi-search-back\fR and
4006 \fIi-search-fwd\fR) and the region between the mark and the cursor are
4007 highlighted in reverse video.
4008 .IP "" 8
4009 Highlighting requires more frequent terminal writes, which introduces extra
4010 overhead. If you care about terminal performance, you may want to leave this
4011 unset.
4012 .TP 8
4013 .B histchars
4014 A string value determining the characters used in \fBHistory
4015 substitution\fR (q.v.).  The first character of its value is used as
4016 the history substitution character, replacing the default character
4017 `!'.  The second character of its value replaces the character `^' in
4018 quick substitutions.
4019 .TP 8
4020 .B histdup \fR(+)
4021 Controls handling of duplicate entries in the history list.  If set to
4022 `all' only unique history events are entered in the history list.  If
4023 set to `prev' and the last history event is the same as the current
4024 command, then the current command is not entered in the history.  If
4025 set to `erase' and the same event is found in the history list, that
4026 old event gets erased and the current one gets inserted.  Note that the
4027 `prev' and `all' options renumber history events so there are no gaps.
4028 .TP 8
4029 .B histfile \fR(+)
4030 The default location in which `history \-S' and `history \-L' look for
4031 a history file.  If unset, \fI~/.history\fR is used.  \fBhistfile\fR is
4032 useful when sharing the same home directory between different machines,
4033 or when saving separate histories on different terminals.  Because only
4034 \fI~/.tcshrc\fR is normally sourced before \fI~/.history\fR,
4035 \fBhistfile\fR should be set in \fI~/.tcshrc\fR rather than
4036 \fI~/.login\fR.
4037 .TP 8
4038 .B histlit \fR(+)
4039 If set, builtin and editor commands and the \fBsavehist\fR mechanism
4040 use the literal (unexpanded) form of lines in the history list.  See
4041 also the \fItoggle-literal-history\fR editor command.
4042 .TP 8
4043 .B history
4044 The first word indicates the number of history events to save.  The
4045 optional second word (+) indicates the format in which history is
4046 printed; if not given, `%h\et%T\et%R\en' is used.  The format sequences
4047 are described below under \fBprompt\fR; note the variable meaning of
4048 `%R'.  Set to `100' by default.
4049 .TP 8
4050 .B home
4051 Initialized to the home directory of the invoker.  The filename
4052 expansion of `\fI~\fR' refers to this variable.
4053 .TP 8
4054 .B ignoreeof
4055 If set to the empty string or `0' and the input device is a terminal,
4056 the \fIend-of-file\fR command (usually generated by the user by typing
4057 `^D' on an empty line) causes the shell to print `Use "exit" to leave
4058 tcsh.' instead of exiting.  This prevents the shell from accidentally
4059 being killed.  Historically this setting exited after 26 successive
4060 EOF's to avoid infinite loops.  If set to a number \fIn\fR, the shell
4061 ignores \fIn - 1\fR consecutive \fIend-of-file\fRs and exits on the
4062 \fIn\fRth.  (+) If unset, `1' is used, i.e., the shell exits on a
4063 single `^D'.
4064 .TP 8
4065 .B implicitcd \fR(+)
4066 If set, the shell treats a directory name typed as a command as though
4067 it were a request to change to that directory.  If set to \fIverbose\fR,
4068 the change of directory is echoed to the standard output.  This behavior
4069 is inhibited in non-interactive shell scripts, or for command strings
4070 with more than one word.  Changing directory takes precedence over
4071 executing a like-named command, but it is done after alias
4072 substitutions.  Tilde and variable expansions work as expected.
4073 .TP 8
4074 .B inputmode \fR(+)
4075 If set to `insert' or `overwrite', puts the editor into that input mode
4076 at the beginning of each line.
4077 .TP 8
4078 .B killdup \fR(+)
4079 Controls handling of duplicate entries in the kill ring.  If set to
4080 `all' only unique strings are entered in the kill ring.  If set to
4081 `prev' and the last killed string is the same as the current killed
4082 string, then the current string is not entered in the ring.  If set
4083 to `erase' and the same string is found in the kill ring, the old
4084 string is erased and the current one is inserted.
4085 .TP 8
4086 .B killring \fR(+)
4087 Indicates the number of killed strings to keep in memory.  Set to `30'
4088 by default.  If unset or set to less than `2', the shell will only
4089 keep the most recently killed string.
4090 Strings are put in the killring by the editor commands that delete
4091 (kill) strings of text, e.g. \fIbackward-delete-word\fR,
4092 \fIkill-line\fR, etc, as well as the \fIcopy-region-as-kill\fR command.
4093 The \fIyank\fR editor command will yank the most recently killed string
4094 into the command-line, while \fIyank-pop\fR (see \fBEditor commands\fR)
4095 can be used to yank earlier killed strings.
4096 .TP 8
4097 .B listflags \fR(+)
4098 If set to `x', `a' or `A', or any combination thereof (e.g., `xA'), they
4099 are used as flags to \fIls\-F\fR, making it act like `ls \-xF', `ls
4100 \-Fa', `ls \-FA' or a combination (e.g., `ls \-FxA'): `a' shows all
4101 files (even if they start with a `.'), `A' shows all files but `.' and
4102 `..', and `x' sorts across instead of down.  If the second word of
4103 \fBlistflags\fR is set, it is used as the path to `ls(1)'.
4104 .TP 8
4105 .B listjobs \fR(+)
4106 If set, all jobs are listed when a job is suspended.  If set to `long',
4107 the listing is in long format.
4108 .TP 8
4109 .B listlinks \fR(+)
4110 If set, the \fIls\-F\fR builtin command shows the type of file to which
4111 each symbolic link points.
4112 .TP 8
4113 .B listmax \fR(+)
4114 The maximum number of items which the \fIlist-choices\fR editor command
4115 will list without asking first.
4116 .TP 8
4117 .B listmaxrows \fR(+)
4118 The maximum number of rows of items which the \fIlist-choices\fR editor
4119 command will list without asking first.
4120 .TP 8
4121 .B loginsh \fR(+)
4122 Set by the shell if it is a login shell.  Setting or unsetting it
4123 within a shell has no effect.  See also \fBshlvl\fR.
4124 .TP 8
4125 .B logout \fR(+)
4126 Set by the shell to `normal' before a normal logout, `automatic' before
4127 an automatic logout, and `hangup' if the shell was killed by a hangup
4128 signal (see \fBSignal handling\fR).  See also the \fBautologout\fR
4129 shell variable.
4130 .TP 8
4131 .B mail
4132 A list of files and directories to check for incoming mail, optionally
4133 preceded by a numeric word.  Before each prompt, if 10 minutes have
4134 passed since the last check, the shell checks each file and says `You
4135 have new mail.' (or, if \fBmail\fR contains multiple files, `You have
4136 new mail in \fIname\fR.') if the filesize is greater than zero in size
4137 and has a modification time greater than its access time.
4138 .PP
4139 .RS +8
4140 .PD
4141 .PP
4142 If you are in a login shell, then no mail file is reported unless it has
4143 been modified after the time the shell has started up, to prevent
4144 redundant notifications.  Most login programs will tell you whether or not
4145 you have mail when you log in.
4146 .PP
4147 If a file specified in \fBmail\fR is a directory, the shell will count each
4148 file within that directory as a separate message, and will report `You have
4149 \fIn\fR mails.' or `You have \fIn\fR mails in \fIname\fR.' as appropriate.
4150 This functionality is provided primarily for those systems which store mail
4151 in this manner, such as the Andrew Mail System.
4152 .PP
4153 If the first word of \fBmail\fR is numeric it is taken as a different mail
4154 checking interval, in seconds.
4155 .PP
4156 Under very rare circumstances, the shell may report `You have mail.' instead
4157 of `You have new mail.'
4158 .RE
4159 .TP 8
4160 .B matchbeep \fR(+)
4161 If set to `never', completion never beeps.
4162 If set to `nomatch', it beeps only when there is no match.
4163 If set to `ambiguous', it beeps when there are multiple matches.
4164 If set to `notunique', it beeps when there is one exact and other longer matches.
4165 If unset, `ambiguous' is used.
4166 .TP 8
4167 .B nobeep \fR(+)
4168 If set, beeping is completely disabled.
4169 See also \fBvisiblebell\fR.
4170 .TP 8
4171 .B noclobber
4172 If set, restrictions are placed on output redirection to insure that files
4173 are not accidentally destroyed and that `>>' redirections refer to existing
4174 files, as described in the \fBInput/output\fR section.
4175 .TP 8
4176 .B noding
4177 If set, disable the printing of `DING!' in the \fBprompt\fR time
4178 specifiers at the change of hour.
4179 .TP 8
4180 .B noglob
4181 If set, \fBFilename substitution\fR and \fBDirectory stack substitution\fR
4182 (q.v.) are inhibited.  This is most useful in shell scripts which do not deal
4183 with filenames, or after a list of filenames has been obtained and further
4184 expansions are not desirable.
4185 .TP 8
4186 .B nokanji \fR(+)
4187 If set and the shell supports Kanji (see the \fBversion\fR shell variable),
4188 it is disabled so that the meta key can be used.
4189 .TP 8
4190 .B nonomatch
4191 If set, a \fBFilename substitution\fR or \fBDirectory stack substitution\fR
4192 (q.v.) which does not match any
4193 existing files is left untouched rather than causing an error.
4194 It is still an error for the substitution to be
4195 malformed, e.g., `echo [' still gives an error.
4196 .TP 8
4197 .B nostat \fR(+)
4198 A list of directories (or glob-patterns which match directories; see
4199 \fBFilename substitution\fR) that should not be \fIstat\fR(2)ed during a
4200 completion operation.  This is usually used to exclude directories which
4201 take too much time to \fIstat\fR(2), for example \fI/afs\fR.
4202 .TP 8
4203 .B notify
4204 If set, the shell announces job completions asynchronously.
4205 The default is to present job completions just before printing a prompt.
4206 .TP 8
4207 .B oid \fR(+)
4208 The user's real organization ID.  (Domain/OS only)
4209 .TP 8
4210 .B owd \fR(+)
4211 The old working directory, equivalent to the `\-' used by \fIcd\fR and \fIpushd\fR.
4212 See also the \fBcwd\fR and \fBdirstack\fR shell variables.
4213 .TP 8
4214 .B padhour
4215 If set, enable the printing of padding '0' for hours, in 24 and 12 hour
4216 formats.  E.G.: 07:45:42 vs. 7:45:42.
4217 .TP 8
4218 .B parseoctal
4219 To retain compatibily with older versions numeric variables starting with
4220 0 are not interpreted as octal. Setting this variable enables proper octal
4221 parsing.
4222 .TP 8
4223 .B path
4224 A list of directories in which to look for executable commands.
4225 A null word specifies the current directory.
4226 If there is no \fBpath\fR variable then only full path names will execute.
4227 \fBpath\fR is set by the shell at startup from the \fBPATH\fR environment
4228 variable or, if \fBPATH\fR does not exist, to a system-dependent default
4229 something like `(/usr/local/bin /usr/bsd /bin /usr/bin .)'.
4230 The shell may put `.' first or last in \fBpath\fR or omit it entirely
4231 depending on how it was compiled; see the \fBversion\fR shell variable.
4232 A shell which is given neither the \fB\-c\fR nor the \fB\-t\fR option
4233 hashes the contents of the directories in \fBpath\fR after
4234 reading \fI~/.tcshrc\fR and each time \fBpath\fR is reset.
4235 If one adds a new command to a directory in \fBpath\fR while the shell
4236 is active, one may need to do a \fIrehash\fR for the shell to find it.
4237 .TP 8
4238 .B printexitvalue \fR(+)
4239 If set and an interactive program exits with a non-zero status, the shell
4240 prints `Exit \fBstatus\fR'.
4241 .TP 8
4242 .B prompt
4243 The string which is printed before reading each command from the terminal.
4244 \fBprompt\fR may include any of the following formatting sequences (+), which
4245 are replaced by the given information:
4246 .PP
4247 .RS +8
4248 .PD 0
4249 .TP 4
4250 %/
4251 The current working directory.
4252 .TP 4
4253 %~
4254 The current working directory, but with one's home directory
4255 represented by `~' and other users' home directories represented by
4256 `~user' as per \fBFilename substitution\fR.  `~user' substitution
4257 happens only if the shell has already used `~\fIuser\fR' in a pathname
4258 in the current session.
4259 .TP 4
4260 %c[[0]\fIn\fR], %.[[0]\fIn\fR]
4261 The trailing component of the current working directory, or \fIn\fR
4262 trailing components if a digit \fIn\fR is given.
4263 If \fIn\fR begins with `0', the number of skipped components precede
4264 the trailing component(s) in the format `/<\fIskipped\fR>trailing'.
4265 If the \fBellipsis\fR shell variable is set, skipped components
4266 are represented by an ellipsis so the whole becomes `...trailing'.
4267 `~' substitution is done as in `%~' above, but the `~' component
4268 is ignored when counting trailing components.
4269 .TP 4
4270 %C
4271 Like %c, but without `~' substitution.
4272 .TP 4
4273 %h, %!, !
4274 The current history event number.
4275 .TP 4
4276 %M
4277 The full hostname.
4278 .TP 4
4279 %m
4280 The hostname up to the first `.'.
4281 .TP 4
4282 %S (%s)
4283 Start (stop) standout mode.
4284 .TP 4
4285 %B (%b)
4286 Start (stop) boldfacing mode.
4287 .TP 4
4288 %U (%u)
4289 Start (stop) underline mode.
4290 .TP 4
4291 %t, %@
4292 The time of day in 12-hour AM/PM format.
4293 .TP 4
4294 %T
4295 Like `%t', but in 24-hour format (but see the \fBampm\fR shell variable).
4296 .TP 4
4297 %p
4298 The `precise' time of day in 12-hour AM/PM format, with seconds.
4299 .TP 4
4300 %P
4301 Like `%p', but in 24-hour format (but see the \fBampm\fR shell variable).
4302 .TP 4
4303 \e\fIc\fR
4304 \fIc\fR is parsed as in \fIbindkey\fR.
4305 .TP 4
4306 ^\fIc\fR
4307 \fIc\fR is parsed as in \fIbindkey\fR.
4308 .TP 4
4309 %%
4310 A single `%'.
4311 .TP 4
4312 %n
4313 The user name.
4314 .TP 4
4315 %N
4316 The effective user name.
4317 .TP 4
4318 %j
4319 The number of jobs.
4320 .TP 4
4321 %d
4322 The weekday in `Day' format.
4323 .TP 4
4324 %D
4325 The day in `dd' format.
4326 .TP 4
4327 %w
4328 The month in `Mon' format.
4329 .TP 4
4330 %W
4331 The month in `mm' format.
4332 .TP 4
4333 %y
4334 The year in `yy' format.
4335 .TP 4
4336 %Y
4337 The year in `yyyy' format.
4338 .TP 4
4339 %l
4340 The shell's tty.
4341 .TP 4
4342 %L
4343 Clears from the end of the prompt to end of the display or the end of the line.
4344 .TP 4
4345 %$
4346 Expands the shell or environment variable name immediately after the `$'.
4347 .TP 4
4348 %#
4349 `>' (or the first character of the \fBpromptchars\fR shell variable)
4350 for normal users, `#' (or the second character of \fBpromptchars\fR)
4351 for the superuser.
4352 .TP 4
4353 %{\fIstring\fR%}
4354 Includes \fIstring\fR as a literal escape sequence.
4355 It should be used only to change terminal attributes and
4356 should not move the cursor location.  This
4357 cannot be the last sequence in \fBprompt\fR.
4358 .TP 4
4359 %?
4360 The return code of the command executed just before the prompt.
4361 .TP 4
4362 %R
4363 In \fBprompt2\fR, the status of the parser.
4364 In \fBprompt3\fR, the corrected string.
4365 In \fBhistory\fR, the history string.
4366 .PD
4367 .PP
4368 `%B', `%S', `%U' and `%{\fIstring\fR%}' are available in only
4369 eight-bit-clean shells; see the \fBversion\fR shell variable.
4370 .PP
4371 The bold, standout and underline sequences are often used to distinguish a
4372 superuser shell.  For example,
4373 .IP "" 4
4374 > set prompt = "%m [%h] %B[%@]%b [%/] you rang? "
4375 .br
4376 tut [37] \fB[2:54pm]\fR [/usr/accts/sys] you rang? _
4377 .PP
4378 If `%t', `%@', `%T', `%p', or `%P' is used, and \fBnoding\fR is not set,
4379 then print `DING!' on the change of hour (i.e, `:00' minutes) instead of
4380 the actual time.
4381 .PP
4382 Set by default to `%# ' in interactive shells.
4383 .RE
4384 .TP 8
4385 .B prompt2 \fR(+)
4386 The string with which to prompt in \fIwhile\fR and \fIforeach\fR loops and
4387 after lines ending in `\e'.
4388 The same format sequences may be used as in \fBprompt\fR (q.v.);
4389 note the variable meaning of `%R'.
4390 Set by default to `%R? ' in interactive shells.
4391 .TP 8
4392 .B prompt3 \fR(+)
4393 The string with which to prompt when confirming automatic spelling correction.
4394 The same format sequences may be used as in \fBprompt\fR (q.v.);
4395 note the variable meaning of `%R'.
4396 Set by default to `CORRECT>%R (y|n|e|a)? ' in interactive shells.
4397 .TP 8
4398 .B promptchars \fR(+)
4399 If set (to a two-character string), the `%#' formatting sequence in the
4400 \fBprompt\fR shell variable is replaced with the first character for
4401 normal users and the second character for the superuser.
4402 .TP 8
4403 .B pushdtohome \fR(+)
4404 If set, \fIpushd\fR without arguments does `pushd ~', like \fIcd\fR.
4405 .TP 8
4406 .B pushdsilent \fR(+)
4407 If set, \fIpushd\fR and \fIpopd\fR do not print the directory stack.
4408 .TP 8
4409 .B recexact \fR(+)
4410 If set, completion completes on an exact match even if a longer match is
4411 possible.
4412 .TP 8
4413 .B recognize_only_executables \fR(+)
4414 If set, command listing displays only files in the path that are
4415 executable.  Slow.
4416 .TP 8
4417 .B rmstar \fR(+)
4418 If set, the user is prompted before `rm *' is executed.
4419 .TP 8
4420 .B rprompt \fR(+)
4421 The string to print on the right-hand side of the screen (after
4422 the command input) when the prompt is being displayed on the left.
4423 It recognizes the same formatting characters as \fBprompt\fR.
4424 It will automatically disappear and reappear as necessary, to ensure that
4425 command input isn't obscured, and will appear only if the prompt,
4426 command input, and itself will fit together on the first line.
4427 If \fBedit\fR isn't set, then \fBrprompt\fR will be printed after
4428 the prompt and before the command input.
4429 .TP 8
4430 .B savedirs \fR(+)
4431 If set, the shell does `dirs \-S' before exiting.
4432 If the first word is set to a number, at most that many directory stack
4433 entries are saved.
4434 .TP 8
4435 .B savehist
4436 If set, the shell does `history \-S' before exiting.
4437 If the first word is set to a number, at most that many lines are saved.
4438 (The number should be less than or equal to the number \fBhistory\fR entries;
4439 if it is set to greater than the number of \fBhistory\fR settings, only
4440 \fBhistory\fR entries will be saved)
4441 If the second word is set to `merge', the history list is merged with
4442 the existing history file instead of replacing it (if there is one) and
4443 sorted by time stamp and the most recent events are retained.
4444 If the second word of \fBsavehist\fR is `merge' and the third word is set to
4445 `lock', the history file update will be serialized with other shell sessions
4446 that would possibly like to merge history at exactly the same time. (+)
4447 .TP 8
4448 .B sched \fR(+)
4449 The format in which the \fIsched\fR builtin command prints scheduled events;
4450 if not given, `%h\et%T\et%R\en' is used.
4451 The format sequences are described above under \fBprompt\fR;
4452 note the variable meaning of `%R'.
4453 .TP 8
4454 .B shell
4455 The file in which the shell resides.  This is used in forking
4456 shells to interpret files which have execute bits set, but
4457 which are not executable by the system.  (See the description
4458 of \fBBuiltin and non-builtin command execution\fR.)  Initialized to the
4459 (system-dependent) home of the shell.
4460 .TP 8
4461 .B shlvl \fR(+)
4462 The number of nested shells.
4463 Reset to 1 in login shells.
4464 See also \fBloginsh\fR.
4465 .TP 8
4466 .B status
4467 The exit status from the last command or backquote expansion, or any
4468 command in a pipeline is propagated to \fBstatus\fR.  (This is also the
4469 default \fBcsh\fR behavior.)
4470 This default does not match what POSIX mandates (to return the
4471 status of the last command only). To match the POSIX behavior, you need
4472 to unset \fBanyerror\fR.
4473 .RS +8
4474 .PP
4475 If the \fBanyerror\fR variable is unset, the exit status of a pipeline
4476 is determined only from the last command in the pipeline, and the exit
4477 status of a backquote expansion is \fInot\fR propagated to \fBstatus\fR.
4478 .PP
4479 If a command terminated abnormally, then 0200 is added to the status.
4480 Builtin commands which fail return exit status `1', all other builtin
4481 commands return status `0'.
4482 .RE
4483 .TP 8
4484 .B symlinks \fR(+)
4485 Can be set to several different values to control symbolic link (`symlink')
4486 resolution:
4487 .RS +8
4488 .PP
4489 If set to `chase', whenever the current directory changes to a directory
4490 containing a symbolic link, it is expanded to the real name of the directory
4491 to which the link points.  This does not work for the user's home directory;
4492 this is a bug.
4493 .PP
4494 If set to `ignore', the shell tries to construct a current directory
4495 relative to the current directory before the link was crossed.
4496 This means that \fIcd\fRing through a symbolic link and then `cd ..'ing
4497 returns one to the original directory.  This affects only builtin commands
4498 and filename completion.
4499 .PP
4500 If set to `expand', the shell tries to fix symbolic links by actually expanding
4501 arguments which look like path names.  This affects any command, not just
4502 builtins.  Unfortunately, this does not work for hard-to-recognize filenames,
4503 such as those embedded in command options.  Expansion may be prevented by
4504 quoting.  While this setting is usually the most convenient, it is sometimes
4505 misleading and sometimes confusing when it fails to recognize an argument
4506 which should be expanded.  A compromise is to use `ignore' and use the
4507 editor command \fInormalize-path\fR (bound by default to ^X-n) when necessary.
4508 .PP
4509 Some examples are in order.  First, let's set up some play directories:
4510 .IP "" 4
4511 > cd /tmp
4512 .br
4513 > mkdir from from/src to
4514 .br
4515 > ln \-s from/src to/dst
4516 .PP
4517 Here's the behavior with \fBsymlinks\fR unset,
4518 .IP "" 4
4519 > cd /tmp/to/dst; echo $cwd
4520 .br
4521 /tmp/to/dst
4522 .br
4523 > cd ..; echo $cwd
4524 .br
4525 /tmp/from
4526 .PP
4527 here's the behavior with \fBsymlinks\fR set to `chase',
4528 .IP "" 4
4529 > cd /tmp/to/dst; echo $cwd
4530 .br
4531 /tmp/from/src
4532 .br
4533 > cd ..; echo $cwd
4534 .br
4535 /tmp/from
4536 .PP
4537 here's the behavior with \fBsymlinks\fR set to `ignore',
4538 .IP "" 4
4539 > cd /tmp/to/dst; echo $cwd
4540 .br
4541 /tmp/to/dst
4542 .br
4543 > cd ..; echo $cwd
4544 .br
4545 /tmp/to
4546 .PP
4547 and here's the behavior with \fBsymlinks\fR set to `expand'.
4548 .IP "" 4
4549 > cd /tmp/to/dst; echo $cwd
4550 .br
4551 /tmp/to/dst
4552 .br
4553 > cd ..; echo $cwd
4554 .br
4555 /tmp/to
4556 .br
4557 > cd /tmp/to/dst; echo $cwd
4558 .br
4559 /tmp/to/dst
4560 .br
4561 > cd ".."; echo $cwd
4562 .br
4563 /tmp/from
4564 .br
4565 > /bin/echo ..
4566 .br
4567 /tmp/to
4568 .br
4569 > /bin/echo ".."
4570 .br
4571 \&..
4572 .PP
4573 Note that `expand' expansion 1) works just like `ignore' for builtins
4574 like \fIcd\fR, 2) is prevented by quoting, and 3) happens before
4575 filenames are passed to non-builtin commands.
4576 .RE
4577 .TP 8
4578 .B tcsh \fR(+)
4579 The version number of the shell in the format `R.VV.PP',
4580 where `R' is the major release number, `VV' the current version
4581 and `PP' the patchlevel.
4582 .TP 8
4583 .B term
4584 The terminal type.  Usually set in \fI~/.login\fR as described under
4585 \fBStartup and shutdown\fR.
4586 .TP 8
4587 .B time
4588 If set to a number, then the \fItime\fR builtin (q.v.) executes automatically
4589 after each command which takes more than that many CPU seconds.
4590 If there is a second word, it is used as a format string for the output
4591 of the \fItime\fR builtin.  (u) The following sequences may be used in the
4592 format string:
4593 .PP
4594 .RS +8
4595 .PD 0
4596 .TP 4
4597 %U
4598 The time the process spent in user mode in cpu seconds.
4599 .TP 4
4600 %S
4601 The time the process spent in kernel mode in cpu seconds.
4602 .TP 4
4603 %E
4604 The elapsed (wall clock) time in seconds.
4605 .TP 4
4606 %P
4607 The CPU percentage computed as (%U + %S) / %E.
4608 .TP 4
4609 %W
4610 Number of times the process was swapped.
4611 .TP 4
4612 %X
4613 The average amount in (shared) text space used in Kbytes.
4614 .TP 4
4615 %D
4616 The average amount in (unshared) data/stack space used in Kbytes.
4617 .TP 4
4618 %K
4619 The total space used (%X + %D) in Kbytes.
4620 .TP 4
4621 %M
4622 The maximum memory the process had in use at any time in Kbytes.
4623 .TP 4
4624 %F
4625 The number of major page faults (page needed to be brought from disk).
4626 .TP 4
4627 %R
4628 The number of minor page faults.
4629 .TP 4
4630 %I
4631 The number of input operations.
4632 .TP 4
4633 %O
4634 The number of output operations.
4635 .TP 4
4636 %r
4637 The number of socket messages received.
4638 .TP 4
4639 %s
4640 The number of socket messages sent.
4641 .TP 4
4642 %k
4643 The number of signals received.
4644 .TP 4
4645 %w
4646 The number of voluntary context switches (waits).
4647 .TP 4
4648 %c
4649 The number of involuntary context switches.
4650 .PD
4651 .PP
4652 Only the first four sequences are supported on systems without BSD resource
4653 limit functions.
4654 The default time format is `%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww' for
4655 systems that support resource usage reporting and `%Uu %Ss %E %P' for
4656 systems that do not.
4657 .PP
4658 Under Sequent's DYNIX/ptx, %X, %D, %K, %r and %s are not
4659 available, but the following additional sequences are:
4660 .PP
4661 .PD 0
4662 .TP 4
4663 %Y
4664 The number of system calls performed.
4665 .TP 4
4666 %Z
4667 The number of pages which are zero-filled on demand.
4668 .TP 4
4669 %i
4670 The number of times a process's resident set size was increased by the kernel.
4671 .TP 4
4672 %d
4673 The number of times a process's resident set size was decreased by the kernel.
4674 .TP 4
4675 %l
4676 The number of read system calls performed.
4677 .TP 4
4678 %m
4679 The number of write system calls performed.
4680 .TP 4
4681 %p
4682 The number of reads from raw disk devices.
4683 .TP 4
4684 %q
4685 The number of writes to raw disk devices.
4686 .PD
4687 .PP
4688 and the default time format is `%Uu %Ss %E %P %I+%Oio %Fpf+%Ww'.
4689 Note that the CPU percentage can be higher than 100% on multi-processors.
4690 .RE
4691 .TP 8
4692 .B tperiod \fR(+)
4693 The period, in minutes, between executions of the \fIperiodic\fR special alias.
4694 .TP 8
4695 .B tty \fR(+)
4696 The name of the tty, or empty if not attached to one.
4697 .TP 8
4698 .B uid \fR(+)
4699 The user's real user ID.
4700 .TP 8
4701 .B user
4702 The user's login name.
4703 .TP 8
4704 .B verbose
4705 If set, causes the words of each
4706 command to be printed, after history substitution (if any).
4707 Set by the \fB\-v\fR command line option.
4708 .TP 8
4709 .B version \fR(+)
4710 The version ID stamp.  It contains the shell's version number (see \fBtcsh\fR),
4711 origin, release date, vendor, operating system and machine (see \fBVENDOR\fR,
4712 \fBOSTYPE\fR and \fBMACHTYPE\fR) and a comma-separated
4713 list of options which were set at compile time.
4714 Options which are set by default in the distribution are noted.
4715 .PP
4716 .RS +8
4717 .PD 0
4718 .TP 6
4719 8b
4720 The shell is eight bit clean; default
4721 .TP 6
4722 7b
4723 The shell is not eight bit clean
4724 .TP 6
4725 wide
4726 The shell is multibyte encoding clean (like UTF-8)
4727 .TP 6
4728 nls
4729 The system's NLS is used; default for systems with NLS
4730 .TP 6
4731 lf
4732 Login shells execute \fI/etc/csh.login\fR before instead of after
4733 \fI/etc/csh.cshrc\fR and \fI~/.login\fR before instead of after
4734 \fI~/.tcshrc\fR and \fI~/.history\fR.
4735 .TP 6
4736 dl
4737 `.' is put last in \fBpath\fR for security; default
4738 .TP 6
4739 nd
4740 `.' is omitted from \fBpath\fR for security
4741 .TP 6
4742 vi
4743 \fIvi\fR(1)\-style editing is the default rather than \fIemacs\fR(1)\-style
4744 .TP 6
4745 dtr
4746 Login shells drop DTR when exiting
4747 .TP 6
4748 bye
4749 \fIbye\fR is a synonym for \fIlogout\fR and \fIlog\fR
4750 is an alternate name for \fIwatchlog\fR
4751 .TP 6
4752 al
4753 \fBautologout\fR is enabled; default
4754 .TP 6
4755 kan
4756 Kanji is used if appropriate according to locale settings,
4757 unless the \fBnokanji\fR shell variable is set
4758 .TP 6
4759 sm
4760 The system's \fImalloc\fR(3) is used
4761 .TP 6
4762 hb
4763 The `#!<program> <args>' convention is emulated when executing shell scripts
4764 .TP 6
4765 ng
4766 The \fInewgrp\fR builtin is available
4767 .TP 6
4768 rh
4769 The shell attempts to set the \fBREMOTEHOST\fR environment variable
4770 .TP 6
4771 afs
4772 The shell verifies your password with the kerberos server if local
4773 authentication fails.  The \fBafsuser\fR shell variable or the
4774 \fBAFSUSER\fR environment variable override your local username if set.
4775 .PD
4776 .PP
4777 An administrator may enter additional strings to indicate differences
4778 in the local version.
4779 .RE
4780 .TP 8
4781 .B vimode \fR(+)
4782 .RS +8
4783 If unset, various key bindings change behavior to be more \fBemacs\fR(1)\-style:
4784 word boundaries are determined by \fBwordchars\fR versus other characters.
4785 .PP
4786 If set, various key bindings change behavior to be more \fBvi\fR(1)\-style:
4787 word boundaries are determined by \fBwordchars\fR versus whitespace
4788 versus other characters;
4789 cursor behavior depends upon current vi mode (command, delete, insert, replace).
4790 .PP
4791 This variable is unset by \fIbindkey\fR \fB-e\fR and
4792 set by \fIbindkey\fR \fB-v\fR.
4793 .B vimode
4794 may be explicitly set or unset by the user after those \fIbindkey\fR
4795 operations if required.
4796 .RE
4797 .TP 8
4798 .B visiblebell \fR(+)
4799 If set, a screen flash is used rather than the audible bell.
4800 See also \fBnobeep\fR.
4801 .TP 8
4802 .B watch \fR(+)
4803 A list of user/terminal pairs to watch for logins and logouts.
4804 If either the user is `any' all terminals are watched for the given user
4805 and vice versa.
4806 Setting \fBwatch\fR to `(any any)' watches all users and terminals.
4807 For example,
4808 .RS +8
4809 .IP "" 4
4810 set watch = (george ttyd1 any console $user any)
4811 .PP
4812 reports activity of the user `george' on ttyd1, any user on the console, and
4813 oneself (or a trespasser) on any terminal.
4814 .PP
4815 Logins and logouts are checked every 10 minutes by default, but the first
4816 word of \fBwatch\fR can be set to a number to check every so many minutes.
4817 For example,
4818 .IP "" 4
4819 set watch = (1 any any)
4820 .PP
4821 reports any login/logout once every minute.  For the impatient, the \fIlog\fR
4822 builtin command triggers a \fBwatch\fR report at any time.  All current logins
4823 are reported (as with the \fIlog\fR builtin) when \fBwatch\fR is first set.
4824 .PP
4825 The \fBwho\fR shell variable controls the format of \fBwatch\fR reports.
4826 .RE
4827 .TP 8
4828 .B who \fR(+)
4829 The format string for \fBwatch\fR messages.  The following sequences
4830 are replaced by the given information:
4831 .PP
4832 .RS +8
4833 .PD 0
4834 .TP 4
4835 %n
4836 The name of the user who logged in/out.
4837 .TP 4
4838 %a
4839 The observed action, i.e., `logged on', `logged off' or `replaced \fIolduser\fR on'.
4840 .TP 4
4841 %l
4842 The terminal (tty) on which the user logged in/out.
4843 .TP 4
4844 %M
4845 The full hostname of the remote host, or `local' if the login/logout was
4846 from the local host.
4847 .TP 4
4848 %m
4849 The hostname of the remote host up to the first `.'.
4850 The full name is printed if it is an IP address or an X Window System display.
4851 .PD
4852 .PP
4853 %M and %m are available on only systems that store the remote hostname in
4854 \fI/etc/utmp\fR.
4855 If unset, `%n has %a %l from %m.' is used, or `%n has %a %l.' on systems
4856 which don't store the remote hostname.
4857 .RE
4858 .TP 8
4859 .B wordchars \fR(+)
4860 A list of non-alphanumeric characters to be considered part of a word by the
4861 \fIforward-word\fR, \fIbackward-word\fR etc., editor commands.
4862 If unset, the default value is determined based on the state of \fBvimode\fR:
4863 if \fBvimode\fR is unset, `*?_\-.[]~=' is used as the default;
4864 if \fBvimode\fR is set, `_' is used as the default.
4865 .SH ENVIRONMENT
4866 .TP 8
4867 .B AFSUSER \fR(+)
4868 Equivalent to the \fBafsuser\fR shell variable.
4869 .TP 8
4870 .B COLUMNS
4871 The number of columns in the terminal.  See \fBTerminal management\fR.
4872 .TP 8
4873 .B DISPLAY
4874 Used by X Window System (see \fIX\fR(1)).
4875 If set, the shell does not set \fBautologout\fR (q.v.).
4876 .TP 8
4877 .B EDITOR
4878 The pathname to a default editor.
4879 Used by the \fIrun-fg-editor\fR editor command if the
4880 the \fBeditors\fR shell variable is unset.
4881 See also the \fBVISUAL\fR environment variable.
4882 .TP 8
4883 .B GROUP \fR(+)
4884 Equivalent to the \fBgroup\fR shell variable.
4885 .TP 8
4886 .B HOME
4887 Equivalent to the \fBhome\fR shell variable.
4888 .TP 8
4889 .B HOST \fR(+)
4890 Initialized to the name of the machine on which the shell
4891 is running, as determined by the \fIgethostname\fR(2) system call.
4892 .TP 8
4893 .B HOSTTYPE \fR(+)
4894 Initialized to the type of machine on which the shell
4895 is running, as determined at compile time.  This variable is obsolete and
4896 will be removed in a future version.
4897 .TP 8
4898 .B HPATH \fR(+)
4899 A colon-separated list of directories in which the \fIrun-help\fR editor
4900 command looks for command documentation.
4901 .TP 8
4902 .B LANG
4903 Gives the preferred character environment.
4904 See \fBNative Language System support\fR.
4905 .TP 8
4906 .B LC_CTYPE
4907 If set, only ctype character handling is changed.
4908 See \fBNative Language System support\fR.
4909 .TP 8
4910 .B LINES
4911 The number of lines in the terminal.  See \fBTerminal management\fR.
4912 .TP 8
4913 .B LS_COLORS
4914 The format of this variable is reminiscent of the \fBtermcap(5)\fR
4915 file format; a colon-separated list of expressions of the form
4916 "\fIxx=string\fR", where "\fIxx\fR" is a two-character variable name.  The
4917 variables with their associated defaults are:
4918 .PP
4919 .RS +8
4920 .RS +4
4921 .PD 0
4922 .TP 12
4923 no      0
4924 Normal (non-filename) text
4925 .TP 12
4926 fi      0
4927 Regular file
4928 .TP 12
4929 di      01;34
4930 Directory
4931 .TP 12
4932 ln      01;36
4933 Symbolic link
4934 .TP 12
4935 pi      33
4936 Named pipe (FIFO)
4937 .TP 12
4938 so      01;35
4939 Socket
4940 .TP 12
4941 do      01;35
4942 Door
4943 .TP 12
4944 bd      01;33
4945 Block device
4946 .TP 12
4947 cd      01;32
4948 Character device
4949 .TP 12
4950 ex      01;32
4951 Executable file
4952 .TP 12
4953 mi      (none)
4954 Missing file (defaults to fi)
4955 .TP 12
4956 or      (none)
4957 Orphaned symbolic link (defaults to ln)
4958 .TP 12
4959 lc      ^[[
4960 Left code
4961 .TP 12
4962 rc      m
4963 Right code
4964 .TP 12
4965 ec      (none)
4966 End code (replaces lc+no+rc)
4967 .PD
4968 .RE
4969 .PP
4970 You need to include only the variables you want to change from
4971 the default.
4972 .PP
4973 File names can also be colorized based on filename extension.
4974 This is specified in the \fBLS_COLORS\fR variable using the syntax
4975 \fB"*ext=string"\fR.  For example, using ISO 6429 codes, to color
4976 all C\-language source files blue you would specify \fB"*.c=34"\fR.
4977 This would color all files ending in \fB.c\fR in blue (34) color.
4978 .PP
4979 Control characters can be written either in C\-style\-escaped
4980 notation, or in stty\-like ^\-notation.  The C\-style notation
4981 adds \fB^[\fR for Escape, \fB\_\fR for a normal space character,
4982 and \fB?\fR for Delete.  In addition, the \fB^[\fR escape character
4983 can be used to override the default interpretation of \fB^[\fR,
4984 \fB^\fR, \fB:\fR and \fB=\fR.
4985 .PP
4986 Each file will be written as \fB<lc>\fR \fB<color-code>\fR
4987 \fB<rc>\fR \fB<filename>\fR \fB<ec>\fR.  If the \fB<ec>\fR
4988 code is undefined, the sequence \fB<lc>\fR \fB<no>
4989 \fB<rc>\fR will be used instead.  This is generally more convenient
4990 to use, but less general.  The left, right and end codes are
4991 provided so you don't have to type common parts over and over
4992 again and to support weird terminals; you will generally not
4993 need to change them at all unless your terminal does not use
4994 ISO 6429 color sequences but a different system.
4995 .PP
4996 If your terminal does use ISO 6429 color codes, you can
4997 compose the type codes (i.e., all except the \fBlc\fR, \fBrc\fR,
4998 and \fBec\fR codes) from numerical commands separated by semicolons.  The
4999 most common commands are:
5000 .PP
5001 .RS +8
5002 .PD 0
5003 .TP 4
5004 0
5005 to restore default color
5006 .TP 4
5007 1
5008 for brighter colors
5009 .TP 4
5010 4
5011 for underlined text
5012 .TP 4
5013 5
5014 for flashing text
5015 .TP 4
5016 30
5017 for black foreground
5018 .TP 4
5019 31
5020 for red foreground
5021 .TP 4
5022 32
5023 for green foreground
5024 .TP 4
5025 33
5026 for yellow (or brown) foreground
5027 .TP 4
5028 34
5029 for blue foreground
5030 .TP 4
5031 35
5032 for purple foreground
5033 .TP 4
5034 36
5035 for cyan foreground
5036 .TP 4
5037 37
5038 for white (or gray) foreground
5039 .TP 4
5040 40
5041 for black background
5042 .TP 4
5043 41
5044 for red background
5045 .TP 4
5046 42
5047 for green background
5048 .TP 4
5049 43
5050 for yellow (or brown) background
5051 .TP 4
5052 44
5053 for blue background
5054 .TP 4
5055 45
5056 for purple background
5057 .TP 4
5058 46
5059 for cyan background
5060 .TP 4
5061 47
5062 for white (or gray) background
5063 .PD
5064 .RE
5065 .PP
5066 Not all commands will work on all systems or display devices.
5067 .PP
5068 A few terminal programs do not recognize the default end code
5069 properly.  If all text gets colorized after you do a directory
5070 listing, try changing the \fBno\fR and \fBfi\fR codes from 0 to the
5071 numerical codes for your standard fore- and background colors.
5072 .RE
5073 .TP 8
5074 .B MACHTYPE \fR(+)
5075 The machine type (microprocessor class or machine model), as determined at compile time.
5076 .TP 8
5077 .B NOREBIND \fR(+)
5078 If set, printable characters are not rebound to \fIself-insert-command\fR.
5079 See \fBNative Language System support\fR.
5080 .TP 8
5081 .B OSTYPE \fR(+)
5082 The operating system, as determined at compile time.
5083 .TP 8
5084 .B PATH
5085 A colon-separated list of directories in which to look for executables.
5086 Equivalent to the \fBpath\fR shell variable, but in a different format.
5087 .TP 8
5088 .B PWD \fR(+)
5089 Equivalent to the \fBcwd\fR shell variable, but not synchronized to it;
5090 updated only after an actual directory change.
5091 .TP 8
5092 .B REMOTEHOST \fR(+)
5093 The host from which the user has logged in remotely, if this is the case and
5094 the shell is able to determine it.  Set only if the shell was so compiled;
5095 see the \fBversion\fR shell variable.
5096 .TP 8
5097 .B SHLVL \fR(+)
5098 Equivalent to the \fBshlvl\fR shell variable.
5099 .TP 8
5100 .B SYSTYPE \fR(+)
5101 The current system type.  (Domain/OS only)
5102 .TP 8
5103 .B TERM
5104 Equivalent to the \fBterm\fR shell variable.
5105 .TP 8
5106 .B TERMCAP
5107 The terminal capability string.  See \fBTerminal management\fR.
5108 .TP 8
5109 .B USER
5110 Equivalent to the \fBuser\fR shell variable.
5111 .TP 8
5112 .B VENDOR \fR(+)
5113 The vendor, as determined at compile time.
5114 .TP 8
5115 .B VISUAL
5116 The pathname to a default full-screen editor.
5117 Used by the \fIrun-fg-editor\fR editor command if the
5118 the \fBeditors\fR shell variable is unset.
5119 See also the \fBEDITOR\fR environment variable.
5120 .SH FILES
5121 .PD 0
5122 .TP 16
5123 .I /etc/csh.cshrc
5124 Read first by every shell.
5125 ConvexOS, Stellix and Intel use \fI/etc/cshrc\fR and
5126 NeXTs use \fI/etc/cshrc.std\fR.
5127 A/UX, AMIX, Cray and IRIX have no equivalent in \fIcsh\fR(1),
5128 but read this file in \fItcsh\fR anyway.
5129 Solaris 2.x does not have it either, but \fItcsh\fR reads \fI/etc/.cshrc\fR.  (+)
5130 .TP 16
5131 .I /etc/csh.login
5132 Read by login shells after \fI/etc/csh.cshrc\fR.
5133 ConvexOS, Stellix and Intel use \fI/etc/login\fR,
5134 NeXTs use \fI/etc/login.std\fR, Solaris 2.x uses \fI/etc/.login\fR and
5135 A/UX, AMIX, Cray and IRIX use \fI/etc/cshrc\fR.
5136 .TP 16
5137 .I ~/.tcshrc \fR(+)
5138 Read by every shell after \fI/etc/csh.cshrc\fR or its equivalent.
5139 .TP 16
5140 .I ~/.cshrc
5141 Read by every shell, if \fI~/.tcshrc\fR doesn't exist,
5142 after \fI/etc/csh.cshrc\fR or its equivalent.
5143 This manual uses `\fI~/.tcshrc\fR' to mean `\fI~/.tcshrc\fR or,
5144 if \fI~/.tcshrc\fR is not found, \fI~/.cshrc\fR'.
5145 .TP 16
5146 .I ~/.history
5147 Read by login shells after \fI~/.tcshrc\fR
5148 if \fBsavehist\fR is set, but see also \fBhistfile\fR.
5149 .TP 16
5150 .I ~/.login
5151 Read by login shells after \fI~/.tcshrc\fR or \fI~/.history\fR.
5152 The shell may be compiled to read \fI~/.login\fR before instead of after
5153 \fI~/.tcshrc\fR and \fI~/.history\fR; see the \fBversion\fR shell variable.
5154 .TP 16
5155 .I ~/.cshdirs \fR(+)
5156 Read by login shells after \fI~/.login\fR
5157 if \fBsavedirs\fR is set, but see also \fBdirsfile\fR.
5158 .TP 16
5159 .I /etc/csh.logout
5160 Read by login shells at logout.
5161 ConvexOS, Stellix and Intel use \fI/etc/logout\fR and
5162 NeXTs use \fI/etc/logout.std\fR.
5163 A/UX, AMIX, Cray and IRIX have no equivalent in \fIcsh\fR(1),
5164 but read this file in \fItcsh\fR anyway.
5165 Solaris 2.x does not have it either, but \fItcsh\fR reads \fI/etc/.logout\fR.  (+)
5166 .TP 16
5167 .I ~/.logout
5168 Read by login shells at logout after \fI/etc/csh.logout\fR or its equivalent.
5169 .TP 16
5170 .I /bin/sh
5171 Used to interpret shell scripts not starting with a `#'.
5172 .TP 16
5173 .I /tmp/sh*
5174 Temporary file for `<<'.
5175 .TP 16
5176 .I /etc/passwd
5177 Source of home directories for `~name' substitutions.
5178 .PD
5179 .PP
5180 The order in which startup files are read may differ if the shell was so
5181 compiled; see \fBStartup and shutdown\fR and the \fBversion\fR shell variable.
5182 .SH "NEW FEATURES (+)"
5183 This manual describes \fItcsh\fR as a single entity,
5184 but experienced \fIcsh\fR(1) users will want to pay special attention to
5185 \fItcsh\fR's new features.
5186 .PP
5187 A command-line editor, which supports \fIemacs\fR(1)\-style
5188 or \fIvi\fR(1)\-style key bindings.
5189 See \fBThe command-line editor\fR and \fBEditor commands\fR.
5190 .PP
5191 Programmable, interactive word completion and listing.
5192 See \fBCompletion and listing\fR and the \fIcomplete\fR and \fIuncomplete\fR
5193 builtin commands.
5194 .PP
5195 \fBSpelling correction\fR (q.v.) of filenames, commands and variables.
5196 .PP
5197 \fBEditor commands\fR (q.v.) which perform other useful functions in the middle of
5198 typed commands, including documentation lookup (\fIrun-help\fR),
5199 quick editor restarting (\fIrun-fg-editor\fR) and
5200 command resolution (\fIwhich-command\fR).
5201 .PP
5202 An enhanced history mechanism.  Events in the history list are time-stamped.
5203 See also the \fIhistory\fR command and its associated shell variables,
5204 the previously undocumented `#' event specifier and new modifiers
5205 under \fBHistory substitution\fR,
5206 the \fI*-history\fR, \fIhistory-search-*\fR, \fIi-search-*\fR, \fIvi-search-*\fR and
5207 \fItoggle-literal-history\fR editor commands
5208 and the \fBhistlit\fR shell variable.
5209 .PP
5210 Enhanced directory parsing and directory stack handling.
5211 See the \fIcd\fR, \fIpushd\fR, \fIpopd\fR and \fIdirs\fR commands and their associated
5212 shell variables, the description of \fBDirectory stack substitution\fR,
5213 the \fBdirstack\fR, \fBowd\fR and \fBsymlinks\fR shell variables and
5214 the \fInormalize-command\fR and \fInormalize-path\fR editor commands.
5215 .PP
5216 Negation in glob-patterns.  See \fBFilename substitution\fR.
5217 .PP
5218 New \fBFile inquiry operators\fR (q.v.) and a \fIfiletest\fR
5219 builtin which uses them.
5220 .PP
5221 A variety of \fBAutomatic, periodic and timed events\fR (q.v.) including
5222 scheduled events, special aliases, automatic logout and terminal locking,
5223 command timing and watching for logins and logouts.
5224 .PP
5225 Support for the Native Language System
5226 (see \fBNative Language System support\fR),
5227 OS variant features
5228 (see \fBOS variant support\fR and the \fBecho_style\fR shell variable)
5229 and system-dependent file locations (see \fBFILES\fR).
5230 .PP
5231 Extensive terminal-management capabilities.  See \fBTerminal management\fR.
5232 .PP
5233 New builtin commands including \fIbuiltins\fR, \fIhup\fR, \fIls\-F\fR,
5234 \fInewgrp\fR, \fIprintenv\fR, \fIwhich\fR and \fIwhere\fR (q.v.).
5235 .PP
5236 New variables that make useful information easily available to the shell.
5237 See the \fBgid\fR, \fBloginsh\fR, \fBoid\fR, \fBshlvl\fR, \fBtcsh\fR,
5238 \fBtty\fR, \fBuid\fR and \fBversion\fR shell variables and the \fBHOST\fR,
5239 \fBREMOTEHOST\fR, \fBVENDOR\fR, \fBOSTYPE\fR and \fBMACHTYPE\fR environment
5240 variables.
5241 .PP
5242 A new syntax for including useful information in the prompt string
5243 (see \fBprompt\fR),
5244 and special prompts for loops and spelling correction
5245 (see \fBprompt2\fR and \fBprompt3\fR).
5246 .PP
5247 Read-only variables.  See \fBVariable substitution\fR.
5248 .SH BUGS
5249 When a suspended command is restarted, the shell prints the directory
5250 it started in if this is different from the current directory.  This can
5251 be misleading (i.e., wrong) as the job may have changed directories internally.
5252 .PP
5253 Shell builtin functions are not stoppable/restartable.  Command sequences
5254 of the form `a ; b ; c' are also not handled gracefully when stopping is
5255 attempted.  If you suspend `b', the shell will then immediately execute
5256 `c'.  This is especially noticeable if this expansion results from an
5257 \fIalias\fR.  It suffices to place the sequence of commands in ()'s to force it
5258 to a subshell, i.e., `( a ; b ; c )'.
5259 .PP
5260 Control over tty output after processes are started is primitive; perhaps
5261 this will inspire someone to work on a good virtual terminal interface.
5262 In a virtual terminal interface much more interesting things could be
5263 done with output control.
5264 .PP
5265 Alias substitution is most often used to clumsily simulate shell procedures;
5266 shell procedures should be provided rather than aliases.
5267 .PP
5268 Control structures should be parsed rather than being recognized as
5269 built-in commands.  This would allow control commands to be placed anywhere,
5270 to be combined with `|', and to be used with `&' and `;' metasyntax.
5271 .PP
5272 \fIforeach\fR doesn't ignore here documents when looking for its \fIend\fR.
5273 .PP
5274 It should be possible to use the `:' modifiers on the output of command
5275 substitutions.
5276 .PP
5277 The screen update for lines longer than the screen width is very poor
5278 if the terminal cannot move the cursor up (i.e., terminal type `dumb').
5279 .PP
5280 \fBHPATH\fR and \fBNOREBIND\fR don't need to be environment variables.
5281 .PP
5282 Glob-patterns which do not use `?', `*' or `[]' or which use `{}' or `~'
5283 are not negated correctly.
5284 .PP
5285 The single-command form of \fIif\fR does output redirection even if
5286 the expression is false and the command is not executed.
5287 .PP
5288 \fIls\-F\fR includes file identification characters when sorting filenames
5289 and does not handle control characters in filenames well.  It cannot be
5290 interrupted.
5291 .PP
5292 Command substitution supports multiple commands and conditions, but not
5293 cycles or backward \fIgoto\fRs.
5294 .PP
5295 Report bugs at http://bugs.gw.com/, preferably with fixes.  If you want to
5296 help maintain and test tcsh, send mail to tcsh-request@mx.gw.com with the
5297 text `subscribe tcsh' on a line by itself in the body.
5298 .SH THE T IN TCSH
5299 In 1964, DEC produced the PDP-6.  The PDP-10 was a later re-implementation.  It
5300 was re-christened the DECsystem-10 in 1970 or so when DEC brought out the
5301 second model, the KI10.
5302 .PP
5303 TENEX was created at Bolt, Beranek & Newman (a Cambridge, Massachusetts
5304 think tank) in
5305 1972 as an experiment in demand-paged virtual memory operating systems.  They
5306 built a new pager for the DEC PDP-10 and created the OS to go with it.  It was
5307 extremely successful in academia.
5308 .PP
5309 In 1975, DEC brought out a new model of the PDP-10, the KL10; they intended to
5310 have only a version of TENEX, which they had licensed from BBN, for the new
5311 box.  They called their version TOPS-20 (their capitalization is trademarked).
5312 A lot of TOPS-10 users (`The OPerating System for PDP-10') objected; thus DEC
5313 found themselves supporting two incompatible systems on the same hardware--but
5314 then there were 6 on the PDP-11!
5315 .PP
5316 TENEX, and TOPS-20 to version 3, had command completion
5317 via a user-code-level subroutine library called ULTCMD.  With version 3, DEC
5318 moved all that capability and more into the monitor (`kernel' for you Unix
5319 types), accessed by the COMND% JSYS (`Jump to SYStem' instruction, the
5320 supervisor call mechanism [are my IBM roots also showing?]).
5321 .PP
5322 The creator of tcsh was impressed by this feature and several others of TENEX
5323 and TOPS-20, and created a version of csh which mimicked them.
5324 .SH LIMITATIONS
5325 The system limits argument lists to ARG_MAX characters.
5326 .PP
5327 The number of arguments to a command which involves filename expansion is
5328 limited to 1/6th the number of characters allowed in an argument list.
5329 .PP
5330 Command substitutions may substitute no more characters than are allowed in
5331 an argument list.
5332 .PP
5333 To detect looping, the shell restricts the number of \fIalias\fR
5334 substitutions on a single line to 20.
5335 .SH "SEE ALSO"
5336 csh(1), emacs(1), ls(1), newgrp(1), sh(1), setpath(1), stty(1), su(1),
5337 tset(1), vi(1), x(1), access(2), execve(2), fork(2), killpg(2),
5338 pipe(2), setrlimit(2), sigvec(2), stat(2), umask(2), vfork(2), wait(2),
5339 malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
5340 termio(7), Introduction to the C Shell
5341 .SH VERSION
5342 This manual documents tcsh 6.20.00 (Astron) 2016-11-24.
5343 .SH AUTHORS
5344 .PD 0
5345 .TP 2
5346 William Joy
5347 Original author of \fIcsh\fR(1)
5348 .TP 2
5349 J.E. Kulp, IIASA, Laxenburg, Austria
5350 Job control and directory stack features
5351 .TP 2
5352 Ken Greer, HP Labs, 1981
5353 File name completion
5354 .TP 2
5355 Mike Ellis, Fairchild, 1983
5356 Command name recognition/completion
5357 .TP 2
5358 Paul Placeway, Ohio State CIS Dept., 1983-1993
5359 Command line editor, prompt routines, new glob syntax and numerous fixes
5360 and speedups
5361 .TP 2
5362 Karl Kleinpaste, CCI 1983-4
5363 Special aliases, directory stack extraction stuff, login/logout watch,
5364 scheduled events, and the idea of the new prompt format
5365 .TP 2
5366 Rayan Zachariassen, University of Toronto, 1984
5367 \fIls\-F\fR and \fIwhich\fR builtins and numerous bug fixes, modifications
5368 and speedups
5369 .TP 2
5370 Chris Kingsley, Caltech
5371 Fast storage allocator routines
5372 .TP 2
5373 Chris Grevstad, TRW, 1987
5374 Incorporated 4.3BSD \fIcsh\fR into \fItcsh\fR
5375 .TP 2
5376 Christos S. Zoulas, Cornell U. EE Dept., 1987-94
5377 Ports to HPUX, SVR2 and SVR3, a SysV version of getwd.c, SHORT_STRINGS support
5378 and a new version of sh.glob.c
5379 .TP 2
5380 James J Dempsey, BBN, and Paul Placeway, OSU, 1988
5381 A/UX port
5382 .TP 2
5383 Daniel Long, NNSC, 1988
5384 \fBwordchars\fR
5385 .TP 2
5386 Patrick Wolfe, Kuck and Associates, Inc., 1988
5387 \fIvi\fR mode cleanup
5388 .TP 2
5389 David C Lawrence, Rensselaer Polytechnic Institute, 1989
5390 \fBautolist\fR and ambiguous completion listing
5391 .TP 2
5392 Alec Wolman, DEC, 1989
5393 Newlines in the prompt
5394 .TP 2
5395 Matt Landau, BBN, 1989
5396 \fI~/.tcshrc\fR
5397 .TP 2
5398 Ray Moody, Purdue Physics, 1989
5399 Magic space bar history expansion
5400 .TP 2
5401 Mordechai ????, Intel, 1989
5402 printprompt() fixes and additions
5403 .TP 2
5404 Kazuhiro Honda, Dept. of Computer Science, Keio University, 1989
5405 Automatic spelling correction and \fBprompt3\fR
5406 .TP 2
5407 Per Hedeland, Ellemtel, Sweden, 1990-
5408 Various bugfixes, improvements and manual updates
5409 .TP 2
5410 Hans J. Albertsson (Sun Sweden)
5411 \fBampm\fR, \fIsettc\fR and \fItelltc\fR
5412 .TP 2
5413 Michael Bloom
5414 Interrupt handling fixes
5415 .TP 2
5416 Michael Fine, Digital Equipment Corp
5417 Extended key support
5418 .TP 2
5419 Eric Schnoebelen, Convex, 1990
5420 Convex support, lots of \fIcsh\fR bug fixes,
5421 save and restore of directory stack
5422 .TP 2
5423 Ron Flax, Apple, 1990
5424 A/UX 2.0 (re)port
5425 .TP 2
5426 Dan Oscarsson, LTH Sweden, 1990
5427 NLS support and simulated NLS support for non NLS sites, fixes
5428 .TP 2
5429 Johan Widen, SICS Sweden, 1990
5430 \fBshlvl\fR, Mach support, \fIcorrect-line\fR, 8-bit printing
5431 .TP 2
5432 Matt Day, Sanyo Icon, 1990
5433 POSIX termio support, SysV limit fixes
5434 .TP 2
5435 Jaap Vermeulen, Sequent, 1990-91
5436 Vi mode fixes, expand-line, window change fixes, Symmetry port
5437 .TP 2
5438 Martin Boyer, Institut de recherche d'Hydro-Quebec, 1991
5439 \fBautolist\fR beeping options, modified the history search to search for
5440 the whole string from the beginning of the line to the cursor.
5441 .TP 2
5442 Scott Krotz, Motorola, 1991
5443 Minix port
5444 .TP 2
5445 David Dawes, Sydney U. Australia, Physics Dept., 1991
5446 SVR4 job control fixes
5447 .TP 2
5448 Jose Sousa, Interactive Systems Corp., 1991
5449 Extended \fIvi\fR fixes and \fIvi\fR delete command
5450 .TP 2
5451 Marc Horowitz, MIT, 1991
5452 ANSIfication fixes, new exec hashing code, imake fixes, \fIwhere\fR
5453 .TP 2
5454 Bruce Sterling Woodcock, sterling@netcom.com, 1991-1995
5455 ETA and Pyramid port, Makefile and lint fixes, \fBignoreeof\fR=n addition, and
5456 various other portability changes and bug fixes
5457 .TP 2
5458 Jeff Fink, 1992
5459 \fIcomplete-word-fwd\fR and \fIcomplete-word-back\fR
5460 .TP 2
5461 Harry C. Pulley, 1992
5462 Coherent port
5463 .TP 2
5464 Andy Phillips, Mullard Space Science Lab U.K., 1992
5465 VMS-POSIX port
5466 .TP 2
5467 Beto Appleton, IBM Corp., 1992
5468 Walking process group fixes, \fIcsh\fR bug fixes,
5469 POSIX file tests, POSIX SIGHUP
5470 .TP 2
5471 Scott Bolte, Cray Computer Corp., 1992
5472 CSOS port
5473 .TP 2
5474 Kaveh R. Ghazi, Rutgers University, 1992
5475 Tek, m88k, Titan and Masscomp ports and fixes.  Added autoconf support.
5476 .TP 2
5477 Mark Linderman, Cornell University, 1992
5478 OS/2 port
5479 .TP 2
5480 Mika Liljeberg, liljeber@kruuna.Helsinki.FI, 1992
5481 Linux port
5482 .TP 2
5483 Tim P. Starrin, NASA Langley Research Center Operations, 1993
5484 Read-only variables
5485 .TP 2
5486 Dave Schweisguth, Yale University, 1993-4
5487 New man page and tcsh.man2html
5488 .TP 2
5489 Larry Schwimmer, Stanford University, 1993
5490 AFS and HESIOD patches
5491 .TP 2
5492 Luke Mewburn, RMIT University, 1994-6
5493 Enhanced directory printing in prompt,
5494 added \fBellipsis\fR and \fBrprompt\fR.
5495 .TP 2
5496 Edward Hutchins, Silicon Graphics Inc., 1996
5497 Added implicit cd.
5498 .TP 2
5499 Martin Kraemer, 1997
5500 Ported to Siemens Nixdorf EBCDIC machine
5501 .TP 2
5502 Amol Deshpande, Microsoft, 1997
5503 Ported to WIN32 (Windows/95 and Windows/NT); wrote all the missing library
5504 and message catalog code to interface to Windows.
5505 .TP 2
5506 Taga Nayuta, 1998
5507 Color ls additions.
5508 .PD
5509 .PP
5510 .SH "THANKS TO"
5511 Bryan Dunlap, Clayton Elwell, Karl Kleinpaste, Bob Manson, Steve Romig,
5512 Diana Smetters, Bob Sutterfield, Mark Verber, Elizabeth Zwicky and all
5513 the other people at Ohio State for suggestions and encouragement
5514 .PP
5515 All the people on the net, for putting up with,
5516 reporting bugs in, and suggesting new additions to each and every version
5517 .PP
5518 Richard M. Alderson III, for writing the `T in tcsh' section