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