1TCSH(1)                     General Commands Manual                    TCSH(1)
2
3
4

NAME

6       tcsh - C shell with file name completion and command line editing
7

SYNOPSIS

9       tcsh [-bcdefFimnqstvVxX] [-Dname[=value]] [arg ...]
10       tcsh -l
11

DESCRIPTION

13       tcsh  is  an enhanced but completely compatible version of the Berkeley
14       UNIX C shell, csh(1).  It is a command language interpreter usable both
15       as an interactive login shell and a shell script command processor.  It
16       includes a command-line editor (see The command-line editor),  program‐
17       mable word completion (see Completion and listing), spelling correction
18       (see Spelling correction), a history mechanism (see  History  substitu‐
19       tion),  job  control  (see Jobs) and a C-like syntax.  The NEW FEATURES
20       section describes major enhancements of tcsh over  csh(1).   Throughout
21       this  manual, features of tcsh not found in most csh(1) implementations
22       (specifically, the 4.4BSD csh) are labeled  with  `(+)',  and  features
23       which are present in csh(1) but not usually documented are labeled with
24       `(u)'.
25
26   Argument list processing
27       If the first argument (argument 0) to the shell is `-'  then  it  is  a
28       login shell.  A login shell can be also specified by invoking the shell
29       with the -l flag as the only argument.
30
31       The rest of the flag arguments are interpreted as follows:
32
33       -b  Forces a ``break'' from  option  processing,  causing  any  further
34           shell arguments to be treated as non-option arguments.  The remain‐
35           ing arguments will not be interpreted as shell options.   This  may
36           be used to pass options to a shell script without confusion or pos‐
37           sible subterfuge.  The shell will not  run  a  set-user  ID  script
38           without this option.
39
40       -c  Commands  are  read  from  the  following  argument  (which must be
41           present, and must be a single  argument),  stored  in  the  command
42           shell  variable  for  reference, and executed.  Any remaining argu‐
43           ments are placed in the argv shell variable.
44
45       -d  The shell loads the directory stack from  ~/.cshdirs  as  described
46           under Startup and shutdown, whether or not it is a login shell. (+)
47
48       -Dname[=value]
49           Sets the environment variable name to value. (Domain/OS only) (+)
50
51       -e  The  shell  exits  if  any invoked command terminates abnormally or
52           yields a non-zero exit status.
53
54       -f  The shell does not load any resource or startup files,  or  perform
55           any command hashing, and thus starts faster.
56
57       -F  The shell uses fork(2) instead of vfork(2) to spawn processes. (+)
58
59       -i  The  shell is interactive and prompts for its top-level input, even
60           if it appears to not be a terminal.  Shells are interactive without
61           this option if their inputs and outputs are terminals.
62
63       -l  The shell is a login shell.  Applicable only if -l is the only flag
64           specified.
65
66       -m  The shell loads ~/.tcshrc even if it does not belong to the  effec‐
67           tive user.  Newer versions of su(1) can pass -m to the shell. (+)
68
69       -n  The  shell parses commands but does not execute them.  This aids in
70           debugging shell scripts.
71
72       -q  The shell accepts SIGQUIT (see Signal handling) and behaves when it
73           is used under a debugger.  Job control is disabled. (u)
74
75       -s  Command input is taken from the standard input.
76
77       -t  The  shell reads and executes a single line of input.  A `\' may be
78           used to escape the newline at the end of  this  line  and  continue
79           onto another line.
80
81       -v  Sets  the  verbose  shell variable, so that command input is echoed
82           after history substitution.
83
84       -x  Sets the echo shell variable, so that commands are  echoed  immedi‐
85           ately before execution.
86
87       -V  Sets the verbose shell variable even before executing ~/.tcshrc.
88
89       -X  Is to -x as -V is to -v.
90
91       --help
92           Print a help message on the standard output and exit. (+)
93
94       --version
95           Print the version/platform/compilation options on the standard out‐
96           put and exit.  This information is also contained  in  the  version
97           shell variable. (+)
98
99       After processing of flag arguments, if arguments remain but none of the
100       -c, -i, -s, or -t options were given, the first argument  is  taken  as
101       the  name  of  a  file of commands, or ``script'', to be executed.  The
102       shell opens this file and saves its name for possible resubstitution by
103       `$0'.   Because  many systems use either the standard version 6 or ver‐
104       sion 7 shells whose shell scripts are not compatible with  this  shell,
105       the  shell uses such a `standard' shell to execute a script whose first
106       character is not a `#', i.e., that does not start with a comment.
107
108       Remaining arguments are placed in the argv shell variable.
109
110   Startup and shutdown
111       A login shell begins  by  executing  commands  from  the  system  files
112       /etc/csh.cshrc  and  /etc/csh.login.   It  then  executes commands from
113       files in  the  user's  home  directory:  first  ~/.tcshrc  (+)  or,  if
114       ~/.tcshrc  is not found, ~/.cshrc, then ~/.history (or the value of the
115       histfile shell variable), then ~/.login, and finally ~/.cshdirs (or the
116       value  of  the  dirsfile  shell  variable)  (+).   The  shell  may read
117       /etc/csh.login before instead of  after  /etc/csh.cshrc,  and  ~/.login
118       before  instead  of  after  ~/.tcshrc or ~/.cshrc and ~/.history, if so
119       compiled; see the version shell variable. (+)
120
121       Non-login shells read only /etc/csh.cshrc and ~/.tcshrc or ~/.cshrc  on
122       startup.
123
124       For  examples  of  startup  files, please consult http://tcshrc.source
125       forge.net.
126
127       Commands like stty(1) and tset(1), which need  be  run  only  once  per
128       login,  usually  go  in one's ~/.login file.  Users who need to use the
129       same set of files with both csh(1) and tcsh can have  only  a  ~/.cshrc
130       which checks for the existence of the tcsh shell variable (q.v.) before
131       using tcsh-specific commands,  or  can  have  both  a  ~/.cshrc  and  a
132       ~/.tcshrc  which  sources (see the builtin command) ~/.cshrc.  The rest
133       of this manual uses `~/.tcshrc' to mean `~/.tcshrc or, if ~/.tcshrc  is
134       not found, ~/.cshrc'.
135
136       In  the  normal case, the shell begins reading commands from the termi‐
137       nal, prompting with `> '.  (Processing of arguments and the use of  the
138       shell to process files containing command scripts are described later.)
139       The shell repeatedly reads a line of  command  input,  breaks  it  into
140       words,  places  it  on the command history list, parses it and executes
141       each command in the line.
142
143       One can log out by typing `^D' on an empty line, `logout' or `login' or
144       via  the  shell's  autologout mechanism (see the autologout shell vari‐
145       able).  When a login shell terminates it sets the logout shell variable
146       to  `normal' or `automatic' as appropriate, then executes commands from
147       the files /etc/csh.logout and ~/.logout.  The shell  may  drop  DTR  on
148       logout if so compiled; see the version shell variable.
149
150       The names of the system login and logout files vary from system to sys‐
151       tem for compatibility with different csh(1) variants; see FILES.
152
153   Editing
154       We first describe The command-line editor.  The Completion and  listing
155       and  Spelling  correction  sections  describe two sets of functionality
156       that are implemented as editor commands but  which  deserve  their  own
157       treatment.   Finally,  Editor  commands  lists and describes the editor
158       commands specific to the shell and their default bindings.
159
160   The command-line editor (+)
161       Command-line input can be edited using key sequences  much  like  those
162       used  in  GNU  Emacs or vi(1).  The editor is active only when the edit
163       shell variable is set, which it is by default  in  interactive  shells.
164       The  bindkey  builtin can display and change key bindings.  Emacs-style
165       key bindings are used by default (unless the shell was compiled  other‐
166       wise;  see  the version shell variable), but bindkey can change the key
167       bindings to vi-style bindings en masse.
168
169       The shell always binds the arrow keys (as defined in the TERMCAP  envi‐
170       ronment variable) to
171
172           down    down-history
173           up      up-history
174           left    backward-char
175           right   forward-char
176
177       unless  doing so would alter another single-character binding.  One can
178       set the arrow key escape sequences to the empty string  with  settc  to
179       prevent  these  bindings.   The ANSI/VT100 sequences for arrow keys are
180       always bound.
181
182       Other key bindings are, for the most part, what Emacs and  vi(1)  users
183       would  expect  and  can  easily be displayed by bindkey, so there is no
184       need to list them here.  Likewise, bindkey can list the editor commands
185       with a short description of each.
186
187       Note  that editor commands do not have the same notion of a ``word'' as
188       does the shell.  The editor delimits words  with  any  non-alphanumeric
189       characters  not in the shell variable wordchars, while the shell recog‐
190       nizes only whitespace and some of the characters with special  meanings
191       to it, listed under Lexical structure.
192
193   Completion and listing (+)
194       The shell is often able to complete words when given a unique abbrevia‐
195       tion.  Type part of a word (for example `ls /usr/lost') and hit the tab
196       key  to  run the complete-word editor command.  The shell completes the
197       filename `/usr/lost' to `/usr/lost+found/',  replacing  the  incomplete
198       word  with  the  complete word in the input buffer.  (Note the terminal
199       `/'; completion adds a `/' to the end of completed  directories  and  a
200       space  to the end of other completed words, to speed typing and provide
201       a visual indicator of successful completion.  The addsuffix shell vari‐
202       able  can  be  unset  to  prevent this.)  If no match is found (perhaps
203       `/usr/lost+found' doesn't exist), the terminal bell rings.  If the word
204       is  already complete (perhaps there is a `/usr/lost' on your system, or
205       perhaps you were thinking too far ahead and typed the  whole  thing)  a
206       `/' or space is added to the end if it isn't already there.
207
208       Completion  works  anywhere in the line, not at just the end; completed
209       text pushes the rest of the line to the right.  Completion in the  mid‐
210       dle  of a word often results in leftover characters to the right of the
211       cursor that need to be deleted.
212
213       Commands and variables can be completed in  much  the  same  way.   For
214       example,  typing `em[tab]' would complete `em' to `emacs' if emacs were
215       the only command on your system beginning with  `em'.   Completion  can
216       find  a  command  in any directory in path or if given a full pathname.
217       Typing `echo $ar[tab]' would complete `$ar'  to  `$argv'  if  no  other
218       variable began with `ar'.
219
220       The  shell  parses  the  input buffer to determine whether the word you
221       want to complete should be completed as a filename,  command  or  vari‐
222       able.   The  first word in the buffer and the first word following `;',
223       `|', `|&', `&&' or `||' is considered to be a command.  A  word  begin‐
224       ning with `$' is considered to be a variable.  Anything else is a file‐
225       name.  An empty line is `completed' as a filename.
226
227       You can list the possible completions of a word at any time  by  typing
228       `^D'  to  run the delete-char-or-list-or-eof editor command.  The shell
229       lists the possible completions using the ls-F builtin (q.v.)   and  re‐
230       prints the prompt and unfinished command line, for example:
231
232           > ls /usr/l[^D]
233           lbin/       lib/        local/      lost+found/
234           > ls /usr/l
235
236       If  the  autolist  shell variable is set, the shell lists the remaining
237       choices (if any) whenever completion fails:
238
239           > set autolist
240           > nm /usr/lib/libt[tab]
241           libtermcap.a@ libtermlib.a@
242           > nm /usr/lib/libterm
243
244       If autolist is set to `ambiguous', choices are listed only when comple‐
245       tion fails and adds no new characters to the word being completed.
246
247       A  filename  to be completed can contain variables, your own or others'
248       home directories abbreviated with `~' (see Filename  substitution)  and
249       directory  stack entries abbreviated with `=' (see Directory stack sub‐
250       stitution).  For example,
251
252           > ls ~k[^D]
253           kahn    kas     kellogg
254           > ls ~ke[tab]
255           > ls ~kellogg/
256
257       or
258
259           > set local = /usr/local
260           > ls $lo[tab]
261           > ls $local/[^D]
262           bin/ etc/ lib/ man/ src/
263           > ls $local/
264
265       Note that variables can also be expanded explicitly  with  the  expand-
266       variables editor command.
267
268       delete-char-or-list-or-eof  lists  at  only the end of the line; in the
269       middle of a line it deletes the character under the cursor  and  on  an
270       empty  line  it  logs  one  out  or, if ignoreeof is set, does nothing.
271       `M-^D', bound to the editor command list-choices, lists completion pos‐
272       sibilities  anywhere  on  a  line,  and list-choices (or any one of the
273       related editor commands that do or don't delete, list and/or  log  out,
274       listed  under delete-char-or-list-or-eof) can be bound to `^D' with the
275       bindkey builtin command if so desired.
276
277       The complete-word-fwd and complete-word-back editor commands (not bound
278       to  any  keys  by default) can be used to cycle up and down through the
279       list of possible completions, replacing the current word with the  next
280       or previous word in the list.
281
282       The  shell  variable  fignore  can  be  set to a list of suffixes to be
283       ignored by completion.  Consider the following:
284
285           > ls
286           Makefile        condiments.h~   main.o          side.c
287           README          main.c          meal            side.o
288           condiments.h    main.c~
289           > set fignore = (.o \~)
290           > emacs ma[^D]
291           main.c   main.c~  main.o
292           > emacs ma[tab]
293           > emacs main.c
294
295       `main.c~' and `main.o' are ignored by  completion  (but  not  listing),
296       because they end in suffixes in fignore.  Note that a `\' was needed in
297       front of `~' to prevent it from being expanded  to  home  as  described
298       under Filename substitution.  fignore is ignored if only one completion
299       is possible.
300
301       If the complete shell variable  is  set  to  `enhance',  completion  1)
302       ignores  case  and  2) considers periods, hyphens and underscores (`.',
303       `-' and `_') to be word separators and hyphens and  underscores  to  be
304       equivalent.  If you had the following files
305
306           comp.lang.c      comp.lang.perl   comp.std.c++
307           comp.lang.c++    comp.std.c
308
309       and  typed  `mail  -f  c.l.c[tab]',  it  would be completed to `mail -f
310       comp.lang.c', and ^D  would  list  `comp.lang.c'  and  `comp.lang.c++'.
311       `mail  -f  c..c++[^D]'  would  list `comp.lang.c++' and `comp.std.c++'.
312       Typing `rm a--file[^D]' in the following directory
313
314           A_silly_file    a-hyphenated-file    another_silly_file
315
316       would list all three files, because case is  ignored  and  hyphens  and
317       underscores  are  equivalent.   Periods, however, are not equivalent to
318       hyphens or underscores.
319
320       Completion and listing are affected by several other  shell  variables:
321       recexact  can be set to complete on the shortest possible unique match,
322       even if more typing might result in a longer match:
323
324           > ls
325           fodder   foo      food     foonly
326           > set recexact
327           > rm fo[tab]
328
329       just beeps, because `fo' could expand to `fod' or `foo', but if we type
330       another `o',
331
332           > rm foo[tab]
333           > rm foo
334
335       the completion completes on `foo', even though `food' and `foonly' also
336       match.  autoexpand can be set to run the expand-history editor  command
337       before each completion attempt, autocorrect can be set to spelling-cor‐
338       rect the word to be completed (see  Spelling  correction)  before  each
339       completion attempt and correct can be set to complete commands automat‐
340       ically after one hits `return'.  matchbeep can be set to  make  comple‐
341       tion beep or not beep in a variety of situations, and nobeep can be set
342       to never beep at all.  nostat can be  set  to  a  list  of  directories
343       and/or patterns that match directories to prevent the completion mecha‐
344       nism from stat(2)ing those directories.  listmax and listmaxrows can be
345       set  to  limit  the  number  of  items and rows (respectively) that are
346       listed without asking first.  recognize_only_executables can be set  to
347       make  the  shell list only executables when listing commands, but it is
348       quite slow.
349
350       Finally, the complete builtin command can be used to tell the shell how
351       to  complete  words other than filenames, commands and variables.  Com‐
352       pletion and listing do not work on glob-patterns (see Filename  substi‐
353       tution),  but  the  list-glob  and  expand-glob editor commands perform
354       equivalent functions for glob-patterns.
355
356   Spelling correction (+)
357       The shell can sometimes correct the spelling of filenames, commands and
358       variable names as well as completing and listing them.
359
360       Individual  words  can be spelling-corrected with the spell-word editor
361       command (usually bound to M-s and M-S) and the entire input buffer with
362       spell-line  (usually  bound to M-$).  The correct shell variable can be
363       set to `cmd' to correct the command name or `all' to correct the entire
364       line  each  time return is typed, and autocorrect can be set to correct
365       the word to be completed before each completion attempt.
366
367       When spelling correction is invoked in any of these ways and the  shell
368       thinks that any part of the command line is misspelled, it prompts with
369       the corrected line:
370
371           > set correct = cmd
372           > lz /usr/bin
373           CORRECT>ls /usr/bin (y|n|e|a)?
374
375       One can answer `y' or space to execute the corrected line, `e' to leave
376       the  uncorrected  command in the input buffer, `a' to abort the command
377       as if `^C' had been hit, and anything else to execute the original line
378       unchanged.
379
380       Spelling  correction  recognizes user-defined completions (see the com‐
381       plete builtin command).  If an input word in a  position  for  which  a
382       completion is defined resembles a word in the completion list, spelling
383       correction registers a misspelling and suggests the latter  word  as  a
384       correction.   However, if the input word does not match any of the pos‐
385       sible completions for that position, spelling correction does not  reg‐
386       ister a misspelling.
387
388       Like  completion, spelling correction works anywhere in the line, push‐
389       ing the rest of the line to the right and possibly leaving extra  char‐
390       acters to the right of the cursor.
391
392       Beware:  spelling  correction  is  not  guaranteed  to work the way one
393       intends, and is provided mostly as an  experimental  feature.   Sugges‐
394       tions and improvements are welcome.
395
396   Editor commands (+)
397       `bindkey'  lists  key  bindings  and  `bindkey  -l'  lists  and briefly
398       describes editor commands.  Only new or especially  interesting  editor
399       commands  are  described here.  See emacs(1) and vi(1) for descriptions
400       of each editor's key bindings.
401
402       The character or characters to which each command is bound  by  default
403       is  given  in  parentheses.  `^character' means a control character and
404       `M-character' a meta character, typed as escape-character on  terminals
405       without  a  meta key.  Case counts, but commands that are bound to let‐
406       ters by default are bound to both lower- and uppercase letters for con‐
407       venience.
408
409       complete-word (tab)
410               Completes a word as described under Completion and listing.
411
412       complete-word-back (not bound)
413               Like complete-word-fwd, but steps up from the end of the list.
414
415       complete-word-fwd (not bound)
416               Replaces  the  current  word with the first word in the list of
417               possible completions.  May be repeated to step down through the
418               list.   At the end of the list, beeps and reverts to the incom‐
419               plete word.
420
421       complete-word-raw (^X-tab)
422               Like complete-word, but ignores user-defined completions.
423
424       copy-prev-word (M-^_)
425               Copies the previous word in the current  line  into  the  input
426               buffer.  See also insert-last-word.
427
428       dabbrev-expand (M-/)
429               Expands  the  current word to the most recent preceding one for
430               which the current is a leading substring, wrapping  around  the
431               history  list  (once)  if  necessary.  Repeating dabbrev-expand
432               without any intervening typing changes  to  the  next  previous
433               word etc., skipping identical matches much like history-search-
434               backward does.
435
436       delete-char (not bound)
437               Deletes the character under the cursor.  See also  delete-char-
438               or-list-or-eof.
439
440       delete-char-or-eof (not bound)
441               Does  delete-char  if  there is a character under the cursor or
442               end-of-file on an empty line.  See also delete-char-or-list-or-
443               eof.
444
445       delete-char-or-list (not bound)
446               Does  delete-char  if  there is a character under the cursor or
447               list-choices at the end of the line.  See also  delete-char-or-
448               list-or-eof.
449
450       delete-char-or-list-or-eof (^D)
451               Does  delete-char  if  there  is  a character under the cursor,
452               list-choices at the end of the line or end-of-file on an  empty
453               line.  See also those three commands, each of which does only a
454               single action, and delete-char-or-eof, delete-char-or-list  and
455               list-or-eof,  each  of  which  does  a different two out of the
456               three.
457
458       down-history (down-arrow, ^N)
459               Like up-history, but steps down, stopping at the original input
460               line.
461
462       end-of-file (not bound)
463               Signals  an  end  of file, causing the shell to exit unless the
464               ignoreeof shell variable (q.v.) is set to  prevent  this.   See
465               also delete-char-or-list-or-eof.
466
467       expand-history (M-space)
468               Expands history substitutions in the current word.  See History
469               substitution.  See also magic-space, toggle-literal-history and
470               the autoexpand shell variable.
471
472       expand-glob (^X-*)
473               Expands  the glob-pattern to the left of the cursor.  See File‐
474               name substitution.
475
476       expand-line (not bound)
477               Like expand-history, but expands history substitutions in  each
478               word in the input buffer,
479
480       expand-variables (^X-$)
481               Expands  the  variable to the left of the cursor.  See Variable
482               substitution.
483
484       history-search-backward (M-p, M-P)
485               Searches backwards through  the  history  list  for  a  command
486               beginning  with  the current contents of the input buffer up to
487               the cursor and copies it into the  input  buffer.   The  search
488               string  may  be a glob-pattern (see Filename substitution) con‐
489               taining `*', `?', `[]' or `{}'.   up-history  and  down-history
490               will  proceed  from  the appropriate point in the history list.
491               Emacs mode only.  See also history-search-forward and i-search-
492               back.
493
494       history-search-forward (M-n, M-N)
495               Like history-search-backward, but searches forward.
496
497       i-search-back (not bound)
498               Searches  backward  like  history-search-backward,  copies  the
499               first match into the input buffer with the cursor positioned at
500               the  end of the pattern, and prompts with `bck: ' and the first
501               match.  Additional  characters  may  be  typed  to  extend  the
502               search,  i-search-back  may be typed to continue searching with
503               the same pattern, wrapping around the history  list  if  neces‐
504               sary,  (i-search-back  must  be bound to a single character for
505               this to work) or one of the following special characters may be
506               typed:
507
508                   ^W      Appends  the  rest  of the word under the cursor to
509                           the search pattern.
510                   delete (or any character bound to backward-delete-char)
511                           Undoes the effect of the last character  typed  and
512                           deletes  a  character  from  the  search pattern if
513                           appropriate.
514                   ^G      If the previous search was successful,  aborts  the
515                           entire  search.  If not, goes back to the last suc‐
516                           cessful search.
517                   escape  Ends the search, leaving the current  line  in  the
518                           input buffer.
519
520               Any other character not bound to self-insert-command terminates
521               the search, leaving the current line in the input  buffer,  and
522               is then interpreted as normal input.  In particular, a carriage
523               return causes the current line  to  be  executed.   Emacs  mode
524               only.  See also i-search-fwd and history-search-backward.
525
526       i-search-fwd (not bound)
527               Like i-search-back, but searches forward.
528
529       insert-last-word (M-_)
530               Inserts  the  last  word of the previous input line (`!$') into
531               the input buffer.  See also copy-prev-word.
532
533       list-choices (M-^D)
534               Lists completion possibilities as  described  under  Completion
535               and  listing.   See  also  delete-char-or-list-or-eof and list-
536               choices-raw.
537
538       list-choices-raw (^X-^D)
539               Like list-choices, but ignores user-defined completions.
540
541       list-glob (^X-g, ^X-G)
542               Lists (via the ls-F builtin) matches to the  glob-pattern  (see
543               Filename substitution) to the left of the cursor.
544
545       list-or-eof (not bound)
546               Does  list-choices  or  end-of-file on an empty line.  See also
547               delete-char-or-list-or-eof.
548
549       magic-space (not bound)
550               Expands history substitutions in the current line, like expand-
551               history,  and  inserts  a space.  magic-space is designed to be
552               bound to the space bar, but is not bound by default.
553
554       normalize-command (^X-?)
555               Searches for the current word in PATH  and,  if  it  is  found,
556               replaces  it  with  the  full  path to the executable.  Special
557               characters are quoted.  Aliases are  expanded  and  quoted  but
558               commands  within  aliases are not.  This command is useful with
559               commands that take commands as arguments, e.g., `dbx'  and  `sh
560               -x'.
561
562       normalize-path (^X-n, ^X-N)
563               Expands  the  current word as described under the `expand' set‐
564               ting of the symlinks shell variable.
565
566       overwrite-mode (unbound)
567               Toggles between input and overwrite modes.
568
569       run-fg-editor (M-^Z)
570               Saves the current input line and looks for a stopped job with a
571               name  equal  to the last component of the file name part of the
572               EDITOR or VISUAL environment variables, or, if neither is  set,
573               `ed'  or  `vi'.   If such a job is found, it is restarted as if
574               `fg %job' had been typed.  This is  used  to  toggle  back  and
575               forth between an editor and the shell easily.  Some people bind
576               this command to `^Z' so they can do this even more easily.
577
578       run-help (M-h, M-H)
579               Searches for documentation on the current  command,  using  the
580               same  notion  of  `current command' as the completion routines,
581               and prints it.  There is no way to use  a  pager;  run-help  is
582               designed  for  short help files.  If the special alias helpcom‐
583               mand is defined, it is run with the  command  name  as  a  sole
584               argument.   Else,  documentation should be in a file named com‐
585               mand.help, command.1, command.6, command.8  or  command,  which
586               should  be  in one of the directories listed in the HPATH envi‐
587               ronment variable.  If there is more than one help file only the
588               first is printed.
589
590       self-insert-command (text characters)
591               In  insert mode (the default), inserts the typed character into
592               the input line after the character under the cursor.  In  over‐
593               write  mode,  replaces  the character under the cursor with the
594               typed character.  The input mode is normally preserved  between
595               lines,  but the inputmode shell variable can be set to `insert'
596               or `overwrite' to put the editor in that mode at the  beginning
597               of each line.  See also overwrite-mode.
598
599       sequence-lead-in (arrow prefix, meta prefix, ^X)
600               Indicates that the following characters are part of a multi-key
601               sequence.  Binding a command to  a  multi-key  sequence  really
602               creates  two  bindings: the first character to sequence-lead-in
603               and the whole sequence to the command.  All sequences beginning
604               with  a  character  bound  to  sequence-lead-in are effectively
605               bound to undefined-key unless bound to another command.
606
607       spell-line (M-$)
608               Attempts to correct the spelling of each word in the input buf‐
609               fer,  like  spell-word, but ignores words whose first character
610               is one of `-', `!', `^' or `%', or which contain  `\',  `*'  or
611               `?',  to  avoid  problems  with switches, substitutions and the
612               like.  See Spelling correction.
613
614       spell-word (M-s, M-S)
615               Attempts to  correct  the  spelling  of  the  current  word  as
616               described  under Spelling correction.  Checks each component of
617               a word which appears to be a pathname.
618
619       toggle-literal-history (M-r, M-R)
620               Expands or `unexpands' history substitutions in the input  buf‐
621               fer.   See  also  expand-history and the autoexpand shell vari‐
622               able.
623
624       undefined-key (any unbound key)
625               Beeps.
626
627       up-history (up-arrow, ^P)
628               Copies the previous entry in the history list  into  the  input
629               buffer.  If histlit is set, uses the literal form of the entry.
630               May be repeated to step up through the history  list,  stopping
631               at the top.
632
633       vi-search-back (?)
634               Prompts  with `?' for a search string (which may be a glob-pat‐
635               tern, as with history-search-backward),  searches  for  it  and
636               copies it into the input buffer.  The bell rings if no match is
637               found.  Hitting return ends the  search  and  leaves  the  last
638               match  in the input buffer.  Hitting escape ends the search and
639               executes the match.  vi mode only.
640
641       vi-search-fwd (/)
642               Like vi-search-back, but searches forward.
643
644       which-command (M-?)
645               Does a which (see the description of the  builtin  command)  on
646               the first word of the input buffer.
647
648       yank-pop (M-y)
649               When  executed  immediately  after  a yank or another yank-pop,
650               replaces the yanked string with the next previous  string  from
651               the  killring.  This  also has the effect of rotating the kill‐
652               ring, such  that  this  string  will  be  considered  the  most
653               recently  killed  by  a  later yank command. Repeating yank-pop
654               will cycle through the killring any number of times.
655
656   Lexical structure
657       The shell splits input lines into words at blanks and tabs.   The  spe‐
658       cial  characters  `&', `|', `;', `<', `>', `(', and `)' and the doubled
659       characters `&&', `||', `<<' and `>>' are always separate words, whether
660       or not they are surrounded by whitespace.
661
662       When the shell's input is not a terminal, the character `#' is taken to
663       begin a comment.  Each `#' and the rest of the input line on  which  it
664       appears is discarded before further parsing.
665
666       A  special  character  (including a blank or tab) may be prevented from
667       having its special meaning, and possibly made part of another word,  by
668       preceding  it  with  a backslash (`\') or enclosing it in single (`''),
669       double (`"') or backward (``') quotes.  When  not  otherwise  quoted  a
670       newline  preceded  by a `\' is equivalent to a blank, but inside quotes
671       this sequence results in a newline.
672
673       Furthermore, all Substitutions (see below) except History  substitution
674       can  be  prevented  by  enclosing  the strings (or parts of strings) in
675       which they appear with single quotes or by quoting the crucial  charac‐
676       ter(s) (e.g., `$' or ``' for Variable substitution or Command substitu‐
677       tion respectively) with `\'.   (Alias  substitution  is  no  exception:
678       quoting  in any way any character of a word for which an alias has been
679       defined prevents substitution of the alias.  The usual way  of  quoting
680       an  alias  is  to precede it with a backslash.) History substitution is
681       prevented by backslashes but not by single quotes.  Strings quoted with
682       double  or  backward  quotes  undergo Variable substitution and Command
683       substitution, but other substitutions are prevented.
684
685       Text inside single or double quotes becomes a single word (or  part  of
686       one).   Metacharacters  in these strings, including blanks and tabs, do
687       not form separate words.  Only in one special case (see Command substi‐
688       tution  below)  can a double-quoted string yield parts of more than one
689       word; single-quoted strings never do.   Backward  quotes  are  special:
690       they  signal Command substitution (q.v.), which may result in more than
691       one word.
692
693       Quoting complex strings, particularly strings which themselves  contain
694       quoting characters, can be confusing.  Remember that quotes need not be
695       used as they are in human writing!  It may be easier to  quote  not  an
696       entire  string,  but only those parts of the string which need quoting,
697       using different types of quoting to do so if appropriate.
698
699       The backslash_quote shell variable (q.v.) can  be  set  to  make  back‐
700       slashes  always  quote  `\',  `'',  and `"'.  (+) This may make complex
701       quoting tasks easier, but it can cause syntax errors in csh(1) scripts.
702
703   Substitutions
704       We now describe the various transformations the shell performs  on  the
705       input  in  the  order in which they occur.  We note in passing the data
706       structures involved and the commands and variables which  affect  them.
707       Remember  that  substitutions  can be prevented by quoting as described
708       under Lexical structure.
709
710   History substitution
711       Each command, or ``event'', input from the terminal  is  saved  in  the
712       history  list.   The  previous command is always saved, and the history
713       shell variable can be set to a number to save that many commands.   The
714       histdup  shell variable can be set to not save duplicate events or con‐
715       secutive duplicate events.
716
717       Saved commands are numbered sequentially from 1 and  stamped  with  the
718       time.   It  is not usually necessary to use event numbers, but the cur‐
719       rent event number can be made part of the prompt by placing an  `!'  in
720       the prompt shell variable.
721
722       The  shell  actually saves history in expanded and literal (unexpanded)
723       forms.  If the histlit shell variable is set, commands that display and
724       store history use the literal form.
725
726       The  history  builtin  command  can print, store in a file, restore and
727       clear the history list at any time, and the savehist and histfile shell
728       variables  can be can be set to store the history list automatically on
729       logout and restore it on login.
730
731       History substitutions introduce words from the history  list  into  the
732       input  stream, making it easy to repeat commands, repeat arguments of a
733       previous command in the current command, or fix  spelling  mistakes  in
734       the  previous  command  with  little typing and a high degree of confi‐
735       dence.
736
737       History substitutions begin with the character  `!'.   They  may  begin
738       anywhere  in  the  input  stream, but they do not nest.  The `!' may be
739       preceded by a `\' to prevent its special meaning;  for  convenience,  a
740       `!'  is  passed unchanged when it is followed by a blank, tab, newline,
741       `=' or `('.  History substitutions also occur when an input line begins
742       with  `^'.   This  special  abbreviation  will be described later.  The
743       characters used to signal history substitution (`!'  and  `^')  can  be
744       changed  by setting the histchars shell variable.  Any input line which
745       contains a history substitution is printed before it is executed.
746
747       A history substitution may have an ``event specification'', which indi‐
748       cates  the  event  from  which words are to be taken, a ``word designa‐
749       tor'', which selects particular words from the chosen event,  and/or  a
750       ``modifier'', which manipulates the selected words.
751
752       An event specification can be
753
754           n       A number, referring to a particular event
755           -n      An  offset,  referring  to  the  event n before the current
756                   event
757           #       The current  event.   This  should  be  used  carefully  in
758                   csh(1), where there is no check for recursion.  tcsh allows
759                   10 levels of recursion.  (+)
760           !       The previous event (equivalent to `-1')
761           s       The most recent event whose  first  word  begins  with  the
762                   string s
763           ?s?     The  most  recent  event  which contains the string s.  The
764                   second `?' can be omitted if it is immediately followed  by
765                   a newline.
766
767       For example, consider this bit of someone's history list:
768
769            9  8:30    nroff -man wumpus.man
770           10  8:31    cp wumpus.man wumpus.man.old
771           11  8:36    vi wumpus.man
772           12  8:37    diff wumpus.man.old wumpus.man
773
774       The  commands  are shown with their event numbers and time stamps.  The
775       current event, which we haven't typed in yet, is event 13.   `!11'  and
776       `!-2'  refer to event 11.  `!!' refers to the previous event, 12.  `!!'
777       can be abbreviated `!' if it is  followed  by  `:'  (`:'  is  described
778       below).   `!n' refers to event 9, which begins with `n'.  `!?old?' also
779       refers to event 12, which contains `old'.  Without word designators  or
780       modifiers  history  references simply expand to the entire event, so we
781       might type `!cp' to redo the copy command or `!!|more'  if  the  `diff'
782       output scrolled off the top of the screen.
783
784       History  references  may  be  insulated  from the surrounding text with
785       braces if necessary.  For example, `!vdoc' would  look  for  a  command
786       beginning  with  `vdoc',  and,  in  this  example,  not  find  one, but
787       `!{v}doc' would expand unambiguously to `vi  wumpus.mandoc'.   Even  in
788       braces, history substitutions do not nest.
789
790       (+) While csh(1) expands, for example, `!3d' to event 3 with the letter
791       `d' appended to it, tcsh expands it to the last  event  beginning  with
792       `3d';  only  completely numeric arguments are treated as event numbers.
793       This makes it possible to recall events  beginning  with  numbers.   To
794       expand `!3d' as in csh(1) say `!{3}d'.
795
796       To  select words from an event we can follow the event specification by
797       a `:' and a designator for the desired words.  The words  of  an  input
798       line are numbered from 0, the first (usually command) word being 0, the
799       second word (first argument) being 1, etc.  The basic word  designators
800       are:
801
802           0       The first (command) word
803           n       The nth argument
804           ^       The first argument, equivalent to `1'
805           $       The last argument
806           %       The word matched by an ?s? search
807           x-y     A range of words
808           -y      Equivalent to `0-y'
809           *       Equivalent  to `^-$', but returns nothing if the event con‐
810                   tains only 1 word
811           x*      Equivalent to `x-$'
812           x-      Equivalent to `x*', but omitting the last word (`$')
813
814       Selected words are inserted into the command line separated  by  single
815       blanks.   For example, the `diff' command in the previous example might
816       have been typed as `diff !!:1.old !!:1' (using `:1' to select the first
817       argument  from  the previous event) or `diff !-2:2 !-2:1' to select and
818       swap the arguments from the `cp' command.  If we didn't care about  the
819       order  of  the `diff' we might have said `diff !-2:1-2' or simply `diff
820       !-2:*'.  The `cp'  command  might  have  been  written  `cp  wumpus.man
821       !#:1.old',  using `#' to refer to the current event.  `!n:- hurkle.man'
822       would reuse the first two words from the `nroff' command to say  `nroff
823       -man hurkle.man'.
824
825       The `:' separating the event specification from the word designator can
826       be omitted if the argument selector begins with a `^', `$', `*', `%' or
827       `-'.   For  example,  our  `diff' command might have been `diff !!^.old
828       !!^' or, equivalently, `diff !!$.old !!$'.  However, if `!!' is  abbre‐
829       viated `!', an argument selector beginning with `-' will be interpreted
830       as an event specification.
831
832       A history reference may have a word designator but no event  specifica‐
833       tion.   It then references the previous command.  Continuing our `diff'
834       example, we could have said simply `diff !^.old  !^'  or,  to  get  the
835       arguments in the opposite order, just `diff !*'.
836
837       The  word  or  words  in  a history reference can be edited, or ``modi‐
838       fied'', by following it with one or more modifiers, each preceded by  a
839       `:':
840
841           h       Remove a trailing pathname component, leaving the head.
842           t       Remove all leading pathname components, leaving the tail.
843           r       Remove a filename extension `.xxx', leaving the root name.
844           e       Remove all but the extension.
845           u       Uppercase the first lowercase letter.
846           l       Lowercase the first uppercase letter.
847           s/l/r/  Substitute  l  for  r.   l is simply a string like r, not a
848                   regular expression as in the eponymous ed(1) command.   Any
849                   character  may  be used as the delimiter in place of `/'; a
850                   `\' can be used to quote the delimiter expect `(', `)', `|'
851                   and  `>'  inside  l  and  r.  The character `&' in the r is
852                   replaced by l; `\' also quotes `&'.  If l is empty  (``''),
853                   the l from a previous substitution or the s from a previous
854                   search or event number in event specification is used.  The
855                   trailing delimiter may be omitted if it is immediately fol‐
856                   lowed by a newline.
857           &       Repeat the previous substitution.
858           g       Apply the following modifier once to each word.
859           a (+)   Apply the following modifier as many times as possible to a
860                   single  word.   `a' and `g' can be used together to apply a
861                   modifier globally.  With the `s' modifier,  only  the  pat‐
862                   terns  contained  in the original word are substituted, not
863                   patterns that contain any substitution result.
864           p       Print the new command line but do not execute it.
865           q       Quote the substituted words, preventing  further  substitu‐
866                   tions.
867           x       Like q, but break into words at blanks, tabs and newlines.
868
869       Modifiers  are applied to only the first modifiable word (unless `g' is
870       used).  It is an error for no word to be modifiable.
871
872       For example, the `diff' command might have been written as  `diff  wum‐
873       pus.man.old !#^:r', using `:r' to remove `.old' from the first argument
874       on the same line (`!#^').  We could say `echo hello  out  there',  then
875       `echo  !*:u' to capitalize `hello', `echo !*:au' to say it out loud, or
876       `echo !*:agu' to really shout.  We might follow `mail -s "I  forgot  my
877       password"  rot'  with  `!:s/rot/root' to correct the spelling of `root'
878       (but see Spelling correction for a different approach).
879
880       There is a special abbreviation for substitutions.  `^', when it is the
881       first  character  on  an  input line, is equivalent to `!:s^'.  Thus we
882       might have said `^rot^root' to make the spelling correction in the pre‐
883       vious  example.   This  is the only history substitution which does not
884       explicitly begin with `!'.
885
886       (+) In csh as such, only one modifier may be applied to each history or
887       variable expansion.  In tcsh, more than one may be used, for example
888
889           % mv wumpus.man /usr/man/man1/wumpus.1
890           % man !$:t:r
891           man wumpus
892
893       In csh, the result would be `wumpus.1:r'.  A substitution followed by a
894       colon may need to be insulated from it with braces:
895
896           > mv a.out /usr/games/wumpus
897           > setenv PATH !$:h:$PATH
898           Bad ! modifier: $.
899           > setenv PATH !{-2$:h}:$PATH
900           setenv PATH /usr/games:/bin:/usr/bin:.
901
902       The first attempt would succeed in csh but fails in tcsh, because  tcsh
903       expects another modifier after the second colon rather than `$'.
904
905       Finally,  history can be accessed through the editor as well as through
906       the substitutions just described.  The up- and  down-history,  history-
907       search-backward  and  -forward,  i-search-back and -fwd, vi-search-back
908       and -fwd, copy-prev-word and insert-last-word  editor  commands  search
909       for  events  in  the  history list and copy them into the input buffer.
910       The toggle-literal-history editor command switches between the expanded
911       and literal forms of history lines in the input buffer.  expand-history
912       and expand-line expand history substitutions in the current word and in
913       the entire input buffer respectively.
914
915   Alias substitution
916       The  shell  maintains  a  list  of  aliases which can be set, unset and
917       printed by the alias and unalias commands.  After  a  command  line  is
918       parsed  into simple commands (see Commands) the first word of each com‐
919       mand, left-to-right, is checked to see if it has an alias.  If so,  the
920       first  word  is replaced by the alias.  If the alias contains a history
921       reference, it undergoes History substitution (q.v.) as though the orig‐
922       inal  command were the previous input line.  If the alias does not con‐
923       tain a history reference, the argument list is left untouched.
924
925       Thus if the alias for `ls' were `ls -l' the  command  `ls  /usr'  would
926       become  `ls -l /usr', the argument list here being undisturbed.  If the
927       alias for `lookup' were `grep !^ /etc/passwd' then `lookup bill'  would
928       become  `grep  bill  /etc/passwd'.   Aliases  can  be used to introduce
929       parser metasyntax.  For example, `alias print 'pr \!* | lpr'' defines a
930       ``command'' (`print') which pr(1)s its arguments to the line printer.
931
932       Alias  substitution is repeated until the first word of the command has
933       no alias.  If an alias substitution does not change the first word  (as
934       in  the previous example) it is flagged to prevent a loop.  Other loops
935       are detected and cause an error.
936
937       Some aliases are referred to by the shell; see Special aliases.
938
939   Variable substitution
940       The shell maintains a list of variables, each of which has as  value  a
941       list  of zero or more words.  The values of shell variables can be dis‐
942       played and changed with the set and unset commands.  The  system  main‐
943       tains  its  own  list  of ``environment'' variables.  These can be dis‐
944       played and changed with printenv, setenv and unsetenv.
945
946       (+) Variables may be made read-only with  `set  -r'  (q.v.)   Read-only
947       variables  may not be modified or unset; attempting to do so will cause
948       an error.  Once made read-only, a variable cannot be made writable,  so
949       `set  -r' should be used with caution.  Environment variables cannot be
950       made read-only.
951
952       Some variables are set  by  the  shell  or  referred  to  by  it.   For
953       instance,  the  argv variable is an image of the shell's argument list,
954       and words of this variable's value are referred  to  in  special  ways.
955       Some  of  the variables referred to by the shell are toggles; the shell
956       does not care what their value is, only whether they are  set  or  not.
957       For  instance,  the  verbose  variable is a toggle which causes command
958       input to be echoed.  The -v command line  option  sets  this  variable.
959       Special  shell  variables  lists all variables which are referred to by
960       the shell.
961
962       Other operations treat variables numerically.  The `@' command  permits
963       numeric calculations to be performed and the result assigned to a vari‐
964       able.  Variable values are, however, always  represented  as  (zero  or
965       more) strings.  For the purposes of numeric operations, the null string
966       is considered to be zero, and the second and subsequent words of multi-
967       word values are ignored.
968
969       After  the input line is aliased and parsed, and before each command is
970       executed, variable substitution is performed keyed by  `$'  characters.
971       This  expansion can be prevented by preceding the `$' with a `\' except
972       within `"'s where it always occurs, and  within  `''s  where  it  never
973       occurs.   Strings quoted by ``' are interpreted later (see Command sub‐
974       stitution below) so `$' substitution does not occur there until  later,
975       if  at  all.  A `$' is passed unchanged if followed by a blank, tab, or
976       end-of-line.
977
978       Input/output redirections are recognized before variable expansion, and
979       are  variable  expanded  separately.   Otherwise,  the command name and
980       entire argument list are expanded together.  It is  thus  possible  for
981       the  first  (command)  word  (to  this point) to generate more than one
982       word, the first of which becomes the command  name,  and  the  rest  of
983       which become arguments.
984
985       Unless  enclosed in `"' or given the `:q' modifier the results of vari‐
986       able substitution may eventually be command and  filename  substituted.
987       Within  `"',  a variable whose value consists of multiple words expands
988       to a (portion of a) single word, with the words of the variable's value
989       separated  by blanks.  When the `:q' modifier is applied to a substitu‐
990       tion the variable will expand to multiple words with  each  word  sepa‐
991       rated  by  a blank and quoted to prevent later command or filename sub‐
992       stitution.
993
994       The following metasequences are provided for introducing variable  val‐
995       ues into the shell input.  Except as noted, it is an error to reference
996       a variable which is not set.
997
998       $name
999       ${name} Substitutes the words of the value of variable name, each sepa‐
1000               rated  by a blank.  Braces insulate name from following charac‐
1001               ters which would otherwise be part of it.  Shell variables have
1002               names  consisting of letters and digits starting with a letter.
1003               The underscore character is considered a letter.   If  name  is
1004               not  a shell variable, but is set in the environment, then that
1005               value is returned (but some of the other forms given below  are
1006               not available in this case).
1007       $name[selector]
1008       ${name[selector]}
1009               Substitutes  only  the  selected  words from the value of name.
1010               The selector is subjected to `$' substitution and  may  consist
1011               of  a  single  number  or  two numbers separated by a `-'.  The
1012               first word of a variable's value is numbered `1'.  If the first
1013               number  of  a range is omitted it defaults to `1'.  If the last
1014               member of a range is omitted  it  defaults  to  `$#name'.   The
1015               selector `*' selects all words.  It is not an error for a range
1016               to be empty if the second argument is omitted or in range.
1017       $0      Substitutes the name of the file from which  command  input  is
1018               being read.  An error occurs if the name is not known.
1019       $number
1020       ${number}
1021               Equivalent to `$argv[number]'.
1022       $*      Equivalent to `$argv', which is equivalent to `$argv[*]'.
1023
1024       The  `:'  modifiers  described  under  History substitution, except for
1025       `:p', can be applied to the substitutions above.  More than one may  be
1026       used.   (+)  Braces  may  be needed to insulate a variable substitution
1027       from a literal colon just as with History substitution (q.v.); any mod‐
1028       ifiers must appear within the braces.
1029
1030       The following substitutions can not be modified with `:' modifiers.
1031
1032       $?name
1033       ${?name}
1034               Substitutes the string `1' if name is set, `0' if it is not.
1035       $?0     Substitutes  `1' if the current input filename is known, `0' if
1036               it is not.  Always `0' in interactive shells.
1037       $#name
1038       ${#name}
1039               Substitutes the number of words in name.
1040       $#      Equivalent to `$#argv'.  (+)
1041       $%name
1042       ${%name}
1043               Substitutes the number of characters in name.  (+)
1044       $%number
1045       ${%number}
1046               Substitutes the number of characters in $argv[number].  (+)
1047       $?      Equivalent to `$status'.  (+)
1048       $$      Substitutes the (decimal) process number of the (parent) shell.
1049       $!      Substitutes the (decimal) process number of the last background
1050               process started by this shell.  (+)
1051       $_      Substitutes the command line of the last command executed.  (+)
1052       $<      Substitutes  a  line  from  the standard input, with no further
1053               interpretation thereafter.  It can be used  to  read  from  the
1054               keyboard in a shell script.  (+) While csh always quotes $<, as
1055               if it were equivalent to `$<:q', tcsh does  not.   Furthermore,
1056               when  tcsh  is waiting for a line to be typed the user may type
1057               an interrupt to interrupt the sequence into which the  line  is
1058               to be substituted, but csh does not allow this.
1059
1060       The  editor  command expand-variables, normally bound to `^X-$', can be
1061       used to interactively expand individual variables.
1062
1063   Command, filename and directory stack substitution
1064       The remaining substitutions are applied selectively to the arguments of
1065       builtin  commands.   This  means that portions of expressions which are
1066       not evaluated are not subjected  to  these  expansions.   For  commands
1067       which  are  not  internal to the shell, the command name is substituted
1068       separately from the argument list.  This occurs very late, after input-
1069       output redirection is performed, and in a child of the main shell.
1070
1071   Command substitution
1072       Command  substitution  is  indicated by a command enclosed in ``'.  The
1073       output from such a command is broken into  separate  words  at  blanks,
1074       tabs  and  newlines, and null words are discarded.  The output is vari‐
1075       able and command substituted and put in place of the original string.
1076
1077       Command substitutions inside double  quotes  (`"')  retain  blanks  and
1078       tabs; only newlines force new words.  The single final newline does not
1079       force a new word in any case.  It is thus possible for a  command  sub‐
1080       stitution  to  yield only part of a word, even if the command outputs a
1081       complete line.
1082
1083       By default, the shell since version 6.12 replaces all newline and  car‐
1084       riage  return characters in the command by spaces.  If this is switched
1085       off by unsetting csubstnonl, newlines separate commands as usual.
1086
1087   Filename substitution
1088       If a word contains any of the characters `*', `?', `[' or `{' or begins
1089       with  the  character  `~'  it is a candidate for filename substitution,
1090       also known as ``globbing''.  This word is then regarded  as  a  pattern
1091       (``glob-pattern''),  and replaced with an alphabetically sorted list of
1092       file names which match the pattern.
1093
1094       In matching filenames, the character `.' at the beginning of a filename
1095       or  immediately  following  a `/', as well as the character `/' must be
1096       matched explicitly.  The character `*' matches any  string  of  charac‐
1097       ters,  including the null string.  The character `?' matches any single
1098       character.  The sequence `[...]' matches  any  one  of  the  characters
1099       enclosed.   Within  `[...]',  a  pair  of  characters  separated by `-'
1100       matches any character lexically between the two.
1101
1102       (+) Some glob-patterns can be negated: The  sequence  `[^...]'  matches
1103       any  single  character not specified by the characters and/or ranges of
1104       characters in the braces.
1105
1106       An entire glob-pattern can also be negated with `^':
1107
1108           > echo *
1109           bang crash crunch ouch
1110           > echo ^cr*
1111           bang ouch
1112
1113       Glob-patterns which do not use `?', `*', or `[]' or which use  `{}'  or
1114       `~' (below) are not negated correctly.
1115
1116       The  metanotation  `a{b,c,d}e' is a shorthand for `abe ace ade'.  Left-
1117       to-right order is preserved: `/usr/source/s1/{oldls,ls}.c'  expands  to
1118       `/usr/source/s1/oldls.c  /usr/source/s1/ls.c'.   The results of matches
1119       are  sorted  separately  at  a  low  level  to  preserve  this   order:
1120       `../{memo,*box}'  might expand to `../memo ../box ../mbox'.  (Note that
1121       `memo' was not sorted with the results of matching `*box'.)  It is  not
1122       an  error  when this construct expands to files which do not exist, but
1123       it is possible to get an error from a command  to  which  the  expanded
1124       list  is  passed.  This construct may be nested.  As a special case the
1125       words `{', `}' and `{}' are passed undisturbed.
1126
1127       The character `~' at the beginning of a filename refers to home  direc‐
1128       tories.   Standing  alone,  i.e., `~', it expands to the invoker's home
1129       directory as reflected in the value of the home shell  variable.   When
1130       followed by a name consisting of letters, digits and `-' characters the
1131       shell searches for a user with that name  and  substitutes  their  home
1132       directory;  thus `~ken' might expand to `/usr/ken' and `~ken/chmach' to
1133       `/usr/ken/chmach'.  If the character `~' is  followed  by  a  character
1134       other  than  a letter or `/' or appears elsewhere than at the beginning
1135       of a word, it is left undisturbed.   A  command  like  `setenv  MANPATH
1136       /usr/man:/usr/local/man:~/lib/man'  does not, therefore, do home direc‐
1137       tory substitution as one might hope.
1138
1139       It is an error for a glob-pattern containing `*', `?', `[' or `~', with
1140       or without `^', not to match any files.  However, only one pattern in a
1141       list of glob-patterns must match a file (so that,  e.g.,  `rm  *.a  *.c
1142       *.o'  would  fail  only if there were no files in the current directory
1143       ending in `.a', `.c', or `.o'), and if the nonomatch shell variable  is
1144       set  a  pattern  (or  list  of  patterns) which matches nothing is left
1145       unchanged rather than causing an error.
1146
1147       The noglob shell variable can be set to prevent filename  substitution,
1148       and  the  expand-glob  editor command, normally bound to `^X-*', can be
1149       used to interactively expand individual filename substitutions.
1150
1151   Directory stack substitution (+)
1152       The directory stack is a list of directories, numbered from zero,  used
1153       by  the  pushd, popd and dirs builtin commands (q.v.).  dirs can print,
1154       store in a file, restore and clear the directory stack at any time, and
1155       the  savedirs  and  dirsfile  shell  variables  can be set to store the
1156       directory stack automatically on logout and restore it on  login.   The
1157       dirstack  shell variable can be examined to see the directory stack and
1158       set to put arbitrary directories into the directory stack.
1159
1160       The character `=' followed by one or more digits expands to an entry in
1161       the  directory stack.  The special case `=-' expands to the last direc‐
1162       tory in the stack.  For example,
1163
1164           > dirs -v
1165           0       /usr/bin
1166           1       /usr/spool/uucp
1167           2       /usr/accts/sys
1168           > echo =1
1169           /usr/spool/uucp
1170           > echo =0/calendar
1171           /usr/bin/calendar
1172           > echo =-
1173           /usr/accts/sys
1174
1175       The noglob and nonomatch shell variables  and  the  expand-glob  editor
1176       command apply to directory stack as well as filename substitutions.
1177
1178   Other substitutions (+)
1179       There   are  several  more  transformations  involving  filenames,  not
1180       strictly related to the above but mentioned here for completeness.  Any
1181       filename  may  be  expanded  to  a full path when the symlinks variable
1182       (q.v.) is set to `expand'.  Quoting prevents this  expansion,  and  the
1183       normalize-path editor command does it on demand.  The normalize-command
1184       editor command expands commands in PATH  into  full  paths  on  demand.
1185       Finally,  cd  and  pushd  interpret  `-'  as  the old working directory
1186       (equivalent to the shell variable owd).  This is not a substitution  at
1187       all,  but  an abbreviation recognized by only those commands.  Nonethe‐
1188       less, it too can be prevented by quoting.
1189
1190   Commands
1191       The next three sections describe how the shell  executes  commands  and
1192       deals with their input and output.
1193
1194   Simple commands, pipelines and sequences
1195       A  simple  command is a sequence of words, the first of which specifies
1196       the command to be executed.  A series of simple commands joined by  `|'
1197       characters  forms a pipeline.  The output of each command in a pipeline
1198       is connected to the input of the next.
1199
1200       Simple commands and pipelines may be joined into  sequences  with  `;',
1201       and  will be executed sequentially.  Commands and pipelines can also be
1202       joined into sequences with `||' or `&&', indicating, as in the  C  lan‐
1203       guage,  that  the  second  is to be executed only if the first fails or
1204       succeeds respectively.
1205
1206       A simple command, pipeline or sequence may be  placed  in  parentheses,
1207       `()',  to  form a simple command, which may in turn be a component of a
1208       pipeline or sequence.  A command, pipeline or sequence can be  executed
1209       without waiting for it to terminate by following it with an `&'.
1210
1211   Builtin and non-builtin command execution
1212       Builtin  commands are executed within the shell.  If any component of a
1213       pipeline except the last is a builtin command, the pipeline is executed
1214       in a subshell.
1215
1216       Parenthesized commands are always executed in a subshell.
1217
1218           (cd; pwd); pwd
1219
1220       thus  prints  the  home directory, leaving you where you were (printing
1221       this after the home directory), while
1222
1223           cd; pwd
1224
1225       leaves you in the home  directory.   Parenthesized  commands  are  most
1226       often used to prevent cd from affecting the current shell.
1227
1228       When  a command to be executed is found not to be a builtin command the
1229       shell attempts to execute the command via execve(2).  Each word in  the
1230       variable  path  names  a directory in which the shell will look for the
1231       command.  If the shell is not given a -f option, the shell  hashes  the
1232       names  in  these directories into an internal table so that it will try
1233       an execve(2) in only a directory where there is a possibility that  the
1234       command  resides  there.   This  greatly speeds command location when a
1235       large number of directories are present in the search path. This  hash‐
1236       ing mechanism is not used:
1237
1238       1.  If hashing is turned explicitly off via unhash.
1239
1240       2.  If the shell was given a -f argument.
1241
1242       3.  For  each  directory  component of path which does not begin with a
1243           `/'.
1244
1245       4.  If the command contains a `/'.
1246
1247       In the above four cases the shell concatenates each  component  of  the
1248       path  vector  with the given command name to form a path name of a file
1249       which it then attempts to execute it. If execution is  successful,  the
1250       search stops.
1251
1252       If  the  file  has  execute permissions but is not an executable to the
1253       system (i.e., it is neither an executable  binary  nor  a  script  that
1254       specifies  its interpreter), then it is assumed to be a file containing
1255       shell commands and a new shell is spawned to read it.  The  shell  spe‐
1256       cial  alias  may  be set to specify an interpreter other than the shell
1257       itself.
1258
1259       On systems which do not understand the `#!' script interpreter  conven‐
1260       tion  the  shell  may  be compiled to emulate it; see the version shell
1261       variable.  If so, the shell checks the first line of the file to see if
1262       it  is of the form `#!interpreter arg ...'.  If it is, the shell starts
1263       interpreter with the given args and feeds the file to  it  on  standard
1264       input.
1265
1266   Input/output
1267       The  standard  input and standard output of a command may be redirected
1268       with the following syntax:
1269
1270       < name  Open file name (which is first variable, command  and  filename
1271               expanded) as the standard input.
1272       << word Read  the  shell input up to a line which is identical to word.
1273               word is not subjected to variable, filename or command  substi‐
1274               tution, and each input line is compared to word before any sub‐
1275               stitutions are done on this input line.  Unless a quoting  `\',
1276               `"',  `'  or ``' appears in word variable and command substitu‐
1277               tion is performed on the intervening  lines,  allowing  `\'  to
1278               quote  `$',  `\'  and ``'.  Commands which are substituted have
1279               all blanks, tabs, and newlines preserved, except for the  final
1280               newline  which  is dropped.  The resultant text is placed in an
1281               anonymous temporary file which is given to the command as stan‐
1282               dard input.
1283       > name
1284       >! name
1285       >& name
1286       >&! name
1287               The file name is used as standard output.  If the file does not
1288               exist then it is created; if the file exists, it is  truncated,
1289               its previous contents being lost.
1290
1291               If  the shell variable noclobber is set, then the file must not
1292               exist or be a character  special  file  (e.g.,  a  terminal  or
1293               `/dev/null')  or an error results.  This helps prevent acciden‐
1294               tal destruction of files.  In this case the `!'  forms  can  be
1295               used to suppress this check.
1296
1297               The  forms  involving  `&' route the diagnostic output into the
1298               specified file  as  well  as  the  standard  output.   name  is
1299               expanded in the same way as `<' input filenames are.
1300       >> name
1301       >>& name
1302       >>! name
1303       >>&! name
1304               Like  `>', but appends output to the end of name.  If the shell
1305               variable noclobber is set, then it is an error for the file not
1306               to exist, unless one of the `!' forms is given.
1307
1308       A  command  receives  the environment in which the shell was invoked as
1309       modified by the input-output parameters and the presence of the command
1310       in  a pipeline.  Thus, unlike some previous shells, commands run from a
1311       file of shell commands have no access to the text of  the  commands  by
1312       default;  rather they receive the original standard input of the shell.
1313       The `<<' mechanism should be used to present inline data.  This permits
1314       shell command scripts to function as components of pipelines and allows
1315       the shell to block read its input.   Note  that  the  default  standard
1316       input  for  a command run detached is not the empty file /dev/null, but
1317       the original standard input of the shell.  If this is a terminal and if
1318       the  process  attempts to read from the terminal, then the process will
1319       block and the user will be notified (see Jobs).
1320
1321       Diagnostic output may be directed through a pipe with the standard out‐
1322       put.  Simply use the form `|&' rather than just `|'.
1323
1324       The  shell  cannot  presently  redirect  diagnostic output without also
1325       redirecting standard output, but `(command  >  output-file)  >&  error-
1326       file'  is often an acceptable workaround.  Either output-file or error-
1327       file may be `/dev/tty' to send output to the terminal.
1328
1329   Features
1330       Having described how the shell accepts,  parses  and  executes  command
1331       lines, we now turn to a variety of its useful features.
1332
1333   Control flow
1334       The  shell  contains a number of commands which can be used to regulate
1335       the flow of control in command files (shell scripts)  and  (in  limited
1336       but  useful  ways)  from terminal input.  These commands all operate by
1337       forcing the shell to reread or skip in its input and, due to the imple‐
1338       mentation, restrict the placement of some of the commands.
1339
1340       The  foreach, switch, and while statements, as well as the if-then-else
1341       form of the if statement, require that the major keywords appear  in  a
1342       single simple command on an input line as shown below.
1343
1344       If  the shell's input is not seekable, the shell buffers up input when‐
1345       ever a loop is being read and performs seeks in this internal buffer to
1346       accomplish the rereading implied by the loop.  (To the extent that this
1347       allows, backward gotos will succeed on non-seekable inputs.)
1348
1349   Expressions
1350       The if, while and exit builtin commands use expressions with  a  common
1351       syntax.   The expressions can include any of the operators described in
1352       the next three sections.  Note that the @ builtin  command  (q.v.)  has
1353       its own separate syntax.
1354
1355   Logical, arithmetical and comparison operators
1356       These operators are similar to those of C and have the same precedence.
1357       They include
1358
1359           ||  &&  |  ^  &  ==  !=  =~  !~  <=  >=
1360           <  > <<  >>  +  -  *  /  %  !  ~  (  )
1361
1362       Here the precedence increases to the right, `==' `!='  `=~'  and  `!~',
1363       `<='  `>='  `<'  and  `>',  `<<' and `>>', `+' and `-', `*' `/' and `%'
1364       being, in groups, at the same level.   When  multiple  operators  which
1365       have  same  precedence  are used in one expression, calculation must be
1366       done from operator of right side.  The `==' `!=' `=~' and  `!~'  opera‐
1367       tors compare their arguments as strings; all others operate on numbers.
1368       The operators `=~' and `!~' are like `!='  and  `=='  except  that  the
1369       right  hand  side is a glob-pattern (see Filename substitution) against
1370       which the left hand operand is matched.  This reduces the need for  use
1371       of  the switch builtin command in shell scripts when all that is really
1372       needed is pattern matching.
1373
1374       Null or missing arguments are  considered  `0'.   The  results  of  all
1375       expressions are strings, which represent decimal numbers.  It is impor‐
1376       tant to note that no two components of an expression can appear in  the
1377       same  word; except when adjacent to components of expressions which are
1378       syntactically significant to the parser (`&' `|' `<' `>' `(' `)')  they
1379       should be surrounded by spaces.
1380
1381   Command exit status
1382       Commands  can be executed in expressions and their exit status returned
1383       by enclosing them in braces (`{}').  Remember that the braces should be
1384       separated  from the words of the command by spaces.  Command executions
1385       succeed, returning true, i.e., `1', if the command exits with status 0,
1386       otherwise they fail, returning false, i.e., `0'.  If more detailed sta‐
1387       tus information is required then the command should be executed outside
1388       of an expression and the status shell variable examined.
1389
1390   File inquiry operators
1391       Some  of  these operators perform true/false tests on files and related
1392       objects.  They are of the form -op file, where op is one of
1393
1394           r   Read access
1395           w   Write access
1396           x   Execute access
1397           X   Executable in the path or shell builtin, e.g., `-X ls' and  `-X
1398               ls-F' are generally true, but `-X /bin/ls' is not (+)
1399           e   Existence
1400           o   Ownership
1401           z   Zero size
1402           s   Non-zero size (+)
1403           f   Plain file
1404           d   Directory
1405           l   Symbolic link (+) *
1406           b   Block special file (+)
1407           c   Character special file (+)
1408           p   Named pipe (fifo) (+) *
1409           S   Socket special file (+) *
1410           u   Set-user-ID bit is set (+)
1411           g   Set-group-ID bit is set (+)
1412           k   Sticky bit is set (+)
1413           t   file  (which  must be a digit) is an open file descriptor for a
1414               terminal device (+)
1415           R   Has been migrated (convex only) (+)
1416           L   Applies subsequent operators in a multiple-operator test  to  a
1417               symbolic  link rather than to the file to which the link points
1418               (+) *
1419
1420       file is command and filename expanded and then tested to see if it  has
1421       the specified relationship to the real user.  If file does not exist or
1422       is inaccessible or, for the operators indicated by `*', if  the  speci‐
1423       fied file type does not exist on the current system, then all enquiries
1424       return false, i.e., `0'.
1425
1426       These operators may be combined for conciseness: `-xy file' is  equiva‐
1427       lent  to `-x file && -y file'.  (+) For example, `-fx' is true (returns
1428       `1') for plain executable files, but not for directories.
1429
1430       L may be used in a multiple-operator test to apply subsequent operators
1431       to  a  symbolic  link rather than to the file to which the link points.
1432       For example, `-lLo' is true for links owned by the invoking user.   Lr,
1433       Lw  and  Lx are always true for links and false for non-links.  L has a
1434       different meaning when it is the last operator in  a  multiple-operator
1435       test; see below.
1436
1437       It  is  possible  but  not useful, and sometimes misleading, to combine
1438       operators which expect file to be a file with operators which  do  not,
1439       (e.g., X and t).  Following L with a non-file operator can lead to par‐
1440       ticularly strange results.
1441
1442       Other operators return other information, i.e., not just  `0'  or  `1'.
1443       (+) They have the same format as before; op may be one of
1444
1445           A       Last  file  access time, as the number of seconds since the
1446                   epoch
1447           A:      Like A, but in timestamp format, e.g., `Fri May 14 16:36:10
1448                   1993'
1449           M       Last file modification time
1450           M:      Like M, but in timestamp format
1451           C       Last inode modification time
1452           C:      Like C, but in timestamp format
1453           D       Device number
1454           I       Inode number
1455           F       Composite file identifier, in the form device:inode
1456           L       The name of the file pointed to by a symbolic link
1457           N       Number of (hard) links
1458           P       Permissions, in octal, without leading zero
1459           P:      Like P, with leading zero
1460           Pmode   Equivalent  to  `-P file & mode', e.g., `-P22 file' returns
1461                   `22' if file is writable by group and  other,  `20'  if  by
1462                   group only, and `0' if by neither
1463           Pmode:  Like Pmode, with leading zero
1464           U       Numeric userid
1465           U:      Username, or the numeric userid if the username is unknown
1466           G       Numeric groupid
1467           G:      Groupname,  or  the  numeric  groupid  if  the groupname is
1468                   unknown
1469           Z       Size, in bytes
1470
1471       Only one of these operators may appear in a multiple-operator test, and
1472       it must be the last.  Note that L has a different meaning at the end of
1473       and elsewhere in a multiple-operator test.   Because  `0'  is  a  valid
1474       return  value  for many of these operators, they do not return `0' when
1475       they fail: most return `-1', and F returns `:'.
1476
1477       If the shell is compiled with POSIX  defined  (see  the  version  shell
1478       variable), the result of a file inquiry is based on the permission bits
1479       of the file and not on the result of the access(2)  system  call.   For
1480       example, if one tests a file with -w whose permissions would ordinarily
1481       allow writing but which is on a file system mounted read-only, the test
1482       will succeed in a POSIX shell but fail in a non-POSIX shell.
1483
1484       File  inquiry operators can also be evaluated with the filetest builtin
1485       command (q.v.) (+).
1486
1487   Jobs
1488       The shell associates a job with each pipeline.  It  keeps  a  table  of
1489       current jobs, printed by the jobs command, and assigns them small inte‐
1490       ger numbers.  When a job is started asynchronously with `&', the  shell
1491       prints a line which looks like
1492
1493           [1] 1234
1494
1495       indicating that the job which was started asynchronously was job number
1496       1 and had one (top-level) process, whose process id was 1234.
1497
1498       If you are running a job and wish to do something else you may hit  the
1499       suspend  key  (usually  `^Z'), which sends a STOP signal to the current
1500       job.  The shell will then normally indicate that the job has been `Sus‐
1501       pended'  and  print  another prompt.  If the listjobs shell variable is
1502       set, all jobs will be listed like the jobs builtin command;  if  it  is
1503       set  to `long' the listing will be in long format, like `jobs -l'.  You
1504       can then manipulate the state of the suspended job.  You can put it  in
1505       the  ``background''  with the bg command or run some other commands and
1506       eventually bring the job back into the ``foreground''  with  fg.   (See
1507       also  the  run-fg-editor  editor command.)  A `^Z' takes effect immedi‐
1508       ately and is like an interrupt in that pending output and unread  input
1509       are  discarded  when  it is typed.  The wait builtin command causes the
1510       shell to wait for all background jobs to complete.
1511
1512       The `^]' key sends a delayed suspend signal, which does not generate  a
1513       STOP signal until a program attempts to read(2) it, to the current job.
1514       This can usefully be typed ahead when you have prepared  some  commands
1515       for  a job which you wish to stop after it has read them.  The `^Y' key
1516       performs this function in csh(1); in tcsh, `^Y' is an editing  command.
1517       (+)
1518
1519       A  job  being  run in the background stops if it tries to read from the
1520       terminal.  Background jobs are normally allowed to produce output,  but
1521       this  can  be disabled by giving the command `stty tostop'.  If you set
1522       this tty option, then background jobs will stop when they try  to  pro‐
1523       duce output like they do when they try to read input.
1524
1525       There  are  several  ways to refer to jobs in the shell.  The character
1526       `%' introduces a job name.  If you wish to refer to job number  1,  you
1527       can  name  it  as `%1'.  Just naming a job brings it to the foreground;
1528       thus `%1' is a synonym for `fg %1', bringing job 1 back into the  fore‐
1529       ground.  Similarly, saying `%1 &' resumes job 1 in the background, just
1530       like `bg %1'.  A job can also be named by an unambiguous prefix of  the
1531       string  typed  in to start it: `%ex' would normally restart a suspended
1532       ex(1) job, if there were only one suspended job whose name  began  with
1533       the  string  `ex'.   It is also possible to say `%?string' to specify a
1534       job whose text contains string, if there is only one such job.
1535
1536       The shell maintains a notion of the current and previous jobs.  In out‐
1537       put  pertaining  to  jobs, the current job is marked with a `+' and the
1538       previous job with a `-'.  The abbreviations `%+', `%', and (by  analogy
1539       with the syntax of the history mechanism) `%%' all refer to the current
1540       job, and `%-' refers to the previous job.
1541
1542       The job control mechanism requires that the stty(1) option `new' be set
1543       on  some systems.  It is an artifact from a `new' implementation of the
1544       tty driver which allows generation of  interrupt  characters  from  the
1545       keyboard  to tell jobs to stop.  See stty(1) and the setty builtin com‐
1546       mand for details on setting options in the new tty driver.
1547
1548   Status reporting
1549       The shell learns immediately whenever a process changes state.  It nor‐
1550       mally  informs  you  whenever  a job becomes blocked so that no further
1551       progress is possible, but only right before it prints a  prompt.   This
1552       is  done so that it does not otherwise disturb your work.  If, however,
1553       you set the shell variable notify, the shell will  notify  you  immedi‐
1554       ately  of  changes of status in background jobs.  There is also a shell
1555       command notify which marks a single process so that its status  changes
1556       will  be  immediately  reported.   By  default notify marks the current
1557       process; simply say `notify' after starting a background  job  to  mark
1558       it.
1559
1560       When  you  try  to  leave the shell while jobs are stopped, you will be
1561       warned that `There are suspended jobs.' You may use the jobs command to
1562       see  what  they  are.  If you do this or immediately try to exit again,
1563       the shell will not warn you a second time, and the suspended jobs  will
1564       be terminated.
1565
1566   Automatic, periodic and timed events (+)
1567       There are various ways to run commands and take other actions automati‐
1568       cally at various times in the ``life cycle'' of the  shell.   They  are
1569       summarized  here, and described in detail under the appropriate Builtin
1570       commands, Special shell variables and Special aliases.
1571
1572       The sched builtin command puts commands in a scheduled-event  list,  to
1573       be executed by the shell at a given time.
1574
1575       The  beepcmd,  cwdcmd,  periodic,  precmd,  postcmd, and jobcmd Special
1576       aliases can be set, respectively, to execute commands  when  the  shell
1577       wants  to ring the bell, when the working directory changes, every tpe‐
1578       riod minutes, before each prompt, before each  command  gets  executed,
1579       after  each  command  gets  executed,  and  when a job is started or is
1580       brought into the foreground.
1581
1582       The autologout shell variable can be set to log out or lock  the  shell
1583       after a given number of minutes of inactivity.
1584
1585       The mail shell variable can be set to check for new mail periodically.
1586
1587       The  printexitvalue  shell variable can be set to print the exit status
1588       of commands which exit with a status other than zero.
1589
1590       The rmstar shell variable can be set to ask the user, when  `rm  *'  is
1591       typed, if that is really what was meant.
1592
1593       The  time shell variable can be set to execute the time builtin command
1594       after the completion of any process that takes more than a given number
1595       of CPU seconds.
1596
1597       The  watch  and  who shell variables can be set to report when selected
1598       users log in or out, and the log builtin command reports on those users
1599       at any time.
1600
1601   Native Language System support (+)
1602       The  shell  is  eight  bit clean (if so compiled; see the version shell
1603       variable) and thus supports character  sets  needing  this  capability.
1604       NLS  support differs depending on whether or not the shell was compiled
1605       to use the system's NLS (again, see version).  In  either  case,  7-bit
1606       ASCII  is the default character code (e.g., the classification of which
1607       characters are  printable)  and  sorting,  and  changing  the  LANG  or
1608       LC_CTYPE  environment  variables causes a check for possible changes in
1609       these respects.
1610
1611       When using the system's NLS, the setlocale(3)  function  is  called  to
1612       determine  appropriate character code/classification and sorting (e.g.,
1613       a 'en_CA.UTF-8' would yield "UTF-8" as a character code).   This  func‐
1614       tion  typically  examines  the LANG and LC_CTYPE environment variables;
1615       refer to the system documentation for further details.  When not  using
1616       the  system's  NLS,  the  shell  simulates  it by assuming that the ISO
1617       8859-1 character set is used whenever either of the LANG  and  LC_CTYPE
1618       variables are set, regardless of their values.  Sorting is not affected
1619       for the simulated NLS.
1620
1621       In addition, with both real and simulated NLS, all printable characters
1622       in  the  range  \200-\377,  i.e.,  those that have M-char bindings, are
1623       automatically rebound to self-insert-command.  The corresponding  bind‐
1624       ing for the escape-char sequence, if any, is left alone.  These charac‐
1625       ters are not rebound if the NOREBIND environment variable is set.  This
1626       may  be  useful  for  the  simulated  NLS or a primitive real NLS which
1627       assumes full ISO 8859-1.  Otherwise, all M-char bindings in  the  range
1628       \240-\377  are  effectively  undone.  Explicitly rebinding the relevant
1629       keys with bindkey is of course still possible.
1630
1631       Unknown characters (i.e., those that are neither printable nor  control
1632       characters) are printed in the format \nnn.  If the tty is not in 8 bit
1633       mode, other 8 bit characters are printed by converting  them  to  ASCII
1634       and  using  standout mode.  The shell never changes the 7/8 bit mode of
1635       the tty and tracks user-initiated changes of 7/8 bit mode.   NLS  users
1636       (or,  for  that  matter,  those who want to use a meta key) may need to
1637       explicitly set the tty in 8 bit mode through  the  appropriate  stty(1)
1638       command in, e.g., the ~/.login file.
1639
1640   OS variant support (+)
1641       A  number  of  new builtin commands are provided to support features in
1642       particular operating systems.  All  are  described  in  detail  in  the
1643       Builtin commands section.
1644
1645       On  systems  that  support  TCF  (aix-ibm370,  aix-ps2),  getspath  and
1646       setspath get and set the system execution path, getxvers  and  setxvers
1647       get  and  set the experimental version prefix and migrate migrates pro‐
1648       cesses between sites.  The jobs builtin prints the site on  which  each
1649       job is executing.
1650
1651       Under  BS2000,  bs2cmd  executes  commands of the underlying BS2000/OSD
1652       operating system.
1653
1654       Under Domain/OS, inlib adds shared libraries to  the  current  environ‐
1655       ment, rootnode changes the rootnode and ver changes the systype.
1656
1657       Under Mach, setpath is equivalent to Mach's setpath(1).
1658
1659       Under Masscomp/RTU and Harris CX/UX, universe sets the universe.
1660
1661       Under  Harris CX/UX, ucb or att runs a command under the specified uni‐
1662       verse.
1663
1664       Under Convex/OS, warp prints or sets the universe.
1665
1666       The VENDOR, OSTYPE and MACHTYPE environment variables indicate  respec‐
1667       tively  the  vendor,  operating system and machine type (microprocessor
1668       class or machine model) of the system on which the shell thinks  it  is
1669       running.   These are particularly useful when sharing one's home direc‐
1670       tory between several types of machines; one can, for example,
1671
1672           set path = (~/bin.$MACHTYPE /usr/ucb /bin /usr/bin .)
1673
1674       in one's ~/.login and put executables compiled for each machine in  the
1675       appropriate directory.
1676
1677       The  version shell variable indicates what options were chosen when the
1678       shell was compiled.
1679
1680       Note also the newgrp builtin, the afsuser and  echo_style  shell  vari‐
1681       ables  and  the  system-dependent  locations of the shell's input files
1682       (see FILES).
1683
1684   Signal handling
1685       Login shells ignore interrupts when reading the  file  ~/.logout.   The
1686       shell  ignores quit signals unless started with -q.  Login shells catch
1687       the terminate signal, but non-login shells inherit the terminate behav‐
1688       ior  from their parents.  Other signals have the values which the shell
1689       inherited from its parent.
1690
1691       In shell scripts, the shell's handling of interrupt and terminate  sig‐
1692       nals  can be controlled with onintr, and its handling of hangups can be
1693       controlled with hup and nohup.
1694
1695       The shell exits on a hangup (see also the logout shell  variable).   By
1696       default,  the shell's children do too, but the shell does not send them
1697       a hangup when it exits.  hup arranges for the shell to send a hangup to
1698       a child when it exits, and nohup sets a child to ignore hangups.
1699
1700   Terminal management (+)
1701       The  shell  uses  three  different  sets  of  terminal (``tty'') modes:
1702       `edit', used when editing, `quote', used when quoting  literal  charac‐
1703       ters,  and  `execute',  used  when executing commands.  The shell holds
1704       some settings in each mode constant, so commands which leave the tty in
1705       a  confused  state  do  not  interfere  with the shell.  The shell also
1706       matches changes in the speed and padding of the tty.  The list  of  tty
1707       modes  that  are  kept  constant  can be examined and modified with the
1708       setty builtin.  Note that although the editor uses CBREAK mode (or  its
1709       equivalent), it takes typed-ahead characters anyway.
1710
1711       The  echotc,  settc  and  telltc commands can be used to manipulate and
1712       debug terminal capabilities from the command line.
1713
1714       On systems that support SIGWINCH or SIGWINDOW, the shell adapts to win‐
1715       dow  resizing automatically and adjusts the environment variables LINES
1716       and COLUMNS if set.  If the environment variable TERMCAP  contains  li#
1717       and co# fields, the shell adjusts them to reflect the new window size.
1718

REFERENCE

1720       The  next sections of this manual describe all of the available Builtin
1721       commands, Special aliases and Special shell variables.
1722
1723   Builtin commands
1724       %job    A synonym for the fg builtin command.
1725
1726       %job &  A synonym for the bg builtin command.
1727
1728       :       Does nothing, successfully.
1729
1730       @
1731       @ name = expr
1732       @ name[index] = expr
1733       @ name++|--
1734       @ name[index]++|--
1735               The first form prints the values of all shell variables.
1736
1737               The second form assigns the value of expr to name.   The  third
1738               form  assigns  the  value  of expr to the index'th component of
1739               name; both name and its index'th component must already exist.
1740
1741               expr may contain the operators `*', `+', etc.,  as  in  C.   If
1742               expr  contains  `<',  `>', `&' or `' then at least that part of
1743               expr must be placed within `()'.  Note that the syntax of  expr
1744               has nothing to do with that described under Expressions.
1745
1746               The fourth and fifth forms increment (`++') or decrement (`--')
1747               name or its index'th component.
1748
1749               The space between `@' and name is required.  The spaces between
1750               name and `=' and between `=' and expr are optional.  Components
1751               of expr must be separated by spaces.
1752
1753       alias [name [wordlist]]
1754               Without arguments, prints all aliases.  With name,  prints  the
1755               alias  for  name.   With name and wordlist, assigns wordlist as
1756               the alias of name.  wordlist is command  and  filename  substi‐
1757               tuted.   name  may  not  be `alias' or `unalias'.  See also the
1758               unalias builtin command.
1759
1760       alloc   Shows the amount of dynamic memory acquired, broken  down  into
1761               used  and  free  memory.   With an argument shows the number of
1762               free and used blocks in each  size  category.   The  categories
1763               start at size 8 and double at each step.  This command's output
1764               may vary across system types, because systems  other  than  the
1765               VAX may use a different memory allocator.
1766
1767       bg [%job ...]
1768               Puts  the  specified  jobs  (or, without arguments, the current
1769               job) into the background, continuing each  if  it  is  stopped.
1770               job may be a number, a string, `', `%', `+' or `-' as described
1771               under Jobs.
1772
1773       bindkey [-l|-d|-e|-v|-u] (+)
1774       bindkey [-a] [-b] [-k] [-r] [--] key (+)
1775       bindkey [-a] [-b] [-k] [-c|-s] [--] key command (+)
1776               Without options, the first form lists all bound  keys  and  the
1777               editor  command  to  which each is bound, the second form lists
1778               the editor command to which key is bound  and  the  third  form
1779               binds the editor command command to key.  Options include:
1780
1781               -l  Lists all editor commands and a short description of each.
1782               -d  Binds  all  keys  to  the standard bindings for the default
1783                   editor.
1784               -e  Binds all keys to the standard GNU Emacs-like bindings.
1785               -v  Binds all keys to the standard vi(1)-like bindings.
1786               -a  Lists or changes key-bindings in the alternative  key  map.
1787                   This is the key map used in vi command mode.
1788               -b  key  is interpreted as a control character written ^charac‐
1789                   ter (e.g., `^A') or C-character (e.g., `C-A'), a meta char‐
1790                   acter  written  M-character  (e.g.,  `M-A'), a function key
1791                   written F-string (e.g., `F-string'), or an extended  prefix
1792                   key written X-character (e.g., `X-A').
1793               -k  key  is interpreted as a symbolic arrow key name, which may
1794                   be one of `down', `up', `left' or `right'.
1795               -r  Removes key's binding.  Be careful: `bindkey -r'  does  not
1796                   bind key to self-insert-command (q.v.), it unbinds key com‐
1797                   pletely.
1798               -c  command is interpreted as a  builtin  or  external  command
1799                   instead of an editor command.
1800               -s  command  is taken as a literal string and treated as termi‐
1801                   nal input when key is typed.  Bound  keys  in  command  are
1802                   themselves reinterpreted, and this continues for ten levels
1803                   of interpretation.
1804               --  Forces a break from option processing, so the next word  is
1805                   taken as key even if it begins with '-'.
1806               -u (or any invalid option)
1807                   Prints a usage message.
1808
1809               key  may  be  a  single character or a string.  If a command is
1810               bound to a string, the first character of the string  is  bound
1811               to  sequence-lead-in and the entire string is bound to the com‐
1812               mand.
1813
1814               Control characters in key can be literal (they can be typed  by
1815               preceding  them with the editor command quoted-insert, normally
1816               bound to `^V') or written caret-character  style,  e.g.,  `^A'.
1817               Delete is written `^?'  (caret-question mark).  key and command
1818               can contain backslashed escape sequences (in the style of  Sys‐
1819               tem V echo(1)) as follows:
1820
1821                   \a      Bell
1822                   \b      Backspace
1823                   \e      Escape
1824                   \f      Form feed
1825                   \n      Newline
1826                   \r      Carriage return
1827                   \t      Horizontal tab
1828                   \v      Vertical tab
1829                   \nnn    The ASCII character corresponding to the octal num‐
1830                           ber nnn
1831
1832               `\' nullifies the special meaning of the  following  character,
1833               if it has any, notably `\' and `^'.
1834
1835       bs2cmd bs2000-command (+)
1836               Passes  bs2000-command  to  the  BS2000 command interpreter for
1837               execution. Only non-interactive commands can be  executed,  and
1838               it  is  not  possible to execute any command that would overlay
1839               the image of the current process, like /EXECUTE or /CALL-PROCE‐
1840               DURE. (BS2000 only)
1841
1842       break   Causes execution to resume after the end of the nearest enclos‐
1843               ing foreach or while.  The remaining commands  on  the  current
1844               line  are  executed.   Multi-level  breaks are thus possible by
1845               writing them all on one line.
1846
1847       breaksw Causes a break from a switch, resuming after the endsw.
1848
1849       builtins (+)
1850               Prints the names of all builtin commands.
1851
1852       bye (+) A synonym for the logout builtin command.   Available  only  if
1853               the shell was so compiled; see the version shell variable.
1854
1855       case label:
1856               A label in a switch statement as discussed below.
1857
1858       cd [-p] [-l] [-n|-v] [name]
1859               If  a  directory  name  is  given,  changes the shell's working
1860               directory to name.  If not, changes to home.  If name is `-' it
1861               is  interpreted  as  the  previous working directory (see Other
1862               substitutions).  (+) If name is not a subdirectory of the  cur‐
1863               rent  directory  (and  does not begin with `/', `./' or `../'),
1864               each component of the variable cdpath is checked to see  if  it
1865               has  a  subdirectory name.  Finally, if all else fails but name
1866               is a shell variable whose value begins with `/', then  this  is
1867               tried to see if it is a directory.
1868
1869               With -p, prints the final directory stack, just like dirs.  The
1870               -l, -n and -v flags have the same effect on cd as on dirs,  and
1871               they imply -p.  (+)
1872
1873               See also the implicitcd shell variable.
1874
1875       chdir   A synonym for the cd builtin command.
1876
1877       complete [command [word/pattern/list[:select]/[[suffix]/] ...]] (+)
1878               Without  arguments, lists all completions.  With command, lists
1879               completions for command.  With command and word  etc.,  defines
1880               completions.
1881
1882               command may be a full command name or a glob-pattern (see File‐
1883               name substitution).  It can begin with  `-'  to  indicate  that
1884               completion should be used only when command is ambiguous.
1885
1886               word specifies which word relative to the current word is to be
1887               completed, and may be one of the following:
1888
1889                   c   Current-word completion.   pattern  is  a  glob-pattern
1890                       which  must  match the beginning of the current word on
1891                       the command line.  pattern is ignored  when  completing
1892                       the current word.
1893                   C   Like  c,  but includes pattern when completing the cur‐
1894                       rent word.
1895                   n   Next-word completion.  pattern is a glob-pattern  which
1896                       must  match  the  beginning of the previous word on the
1897                       command line.
1898                   N   Like n, but must match the beginning of  the  word  two
1899                       before the current word.
1900                   p   Position-dependent  completion.   pattern  is a numeric
1901                       range, with the same syntax used to index  shell  vari‐
1902                       ables, which must include the current word.
1903
1904               list,  the list of possible completions, may be one of the fol‐
1905               lowing:
1906
1907                   a       Aliases
1908                   b       Bindings (editor commands)
1909                   c       Commands (builtin or external commands)
1910                   C       External commands which  begin  with  the  supplied
1911                           path prefix
1912                   d       Directories
1913                   D       Directories which begin with the supplied path pre‐
1914                           fix
1915                   e       Environment variables
1916                   f       Filenames
1917                   F       Filenames which begin with the supplied path prefix
1918                   g       Groupnames
1919                   j       Jobs
1920                   l       Limits
1921                   n       Nothing
1922                   s       Shell variables
1923                   S       Signals
1924                   t       Plain (``text'') files
1925                   T       Plain (``text'') files which begin  with  the  sup‐
1926                           plied path prefix
1927                   v       Any variables
1928                   u       Usernames
1929                   x       Like  n,  but  prints  select  when list-choices is
1930                           used.
1931                   X       Completions
1932                   $var    Words from the variable var
1933                   (...)   Words from the given list
1934                   `...`   Words from the output of command
1935
1936               select is an optional glob-pattern.  If given, words from  only
1937               list  that  match  select  are considered and the fignore shell
1938               variable is ignored.  The last three types  of  completion  may
1939               not  have a select pattern, and x uses select as an explanatory
1940               message when the list-choices editor command is used.
1941
1942               suffix is a single character to be  appended  to  a  successful
1943               completion.  If null, no character is appended.  If omitted (in
1944               which case the fourth delimiter can also be omitted),  a  slash
1945               is appended to directories and a space to other words.
1946
1947               command  invoked  from `...` version has additional environment
1948               variable set, the variable name is  COMMAND_LINE  and  contains
1949               (as  its name indicates) contents of the current (already typed
1950               in) command line. One can  examine  and  use  contents  of  the
1951               COMMAND_LINE  variable  in  her  custom  script  to  build more
1952               sophisticated completions (see completion for  svn(1)  included
1953               in this package).
1954
1955               Now  for some examples.  Some commands take only directories as
1956               arguments, so there's no point completing plain files.
1957
1958                   > complete cd 'p/1/d/'
1959
1960               completes only the first word following  `cd'  (`p/1')  with  a
1961               directory.   p-type  completion can also be used to narrow down
1962               command completion:
1963
1964                   > co[^D]
1965                   complete compress
1966                   > complete -co* 'p/0/(compress)/'
1967                   > co[^D]
1968                   > compress
1969
1970               This completion completes commands (words in position 0, `p/0')
1971               which  begin with `co' (thus matching `co*') to `compress' (the
1972               only word in the list).  The leading `-'  indicates  that  this
1973               completion is to be used with only ambiguous commands.
1974
1975                   > complete find 'n/-user/u/'
1976
1977               is  an example of n-type completion.  Any word following `find'
1978               and immediately following `-user' is completed from the list of
1979               users.
1980
1981                   > complete cc 'c/-I/d/'
1982
1983               demonstrates  c-type  completion.   Any word following `cc' and
1984               beginning with `-I' is completed as a directory.  `-I'  is  not
1985               taken as part of the directory because we used lowercase c.
1986
1987               Different lists are useful with different commands.
1988
1989                   > complete alias 'p/1/a/'
1990                   > complete man 'p/*/c/'
1991                   > complete set 'p/1/s/'
1992                   > complete true 'p/1/x:Truth has no options./'
1993
1994               These complete words following `alias' with aliases, `man' with
1995               commands, and `set' with shell variables.  `true' doesn't  have
1996               any options, so x does nothing when completion is attempted and
1997               prints `Truth has no  options.'  when  completion  choices  are
1998               listed.
1999
2000               Note  that  the  man example, and several other examples below,
2001               could just as well have used 'c/*' or 'n/*' as 'p/*'.
2002
2003               Words can be completed from a variable evaluated at  completion
2004               time,
2005
2006                   > complete ftp 'p/1/$hostnames/'
2007                   > set hostnames = (rtfm.mit.edu tesla.ee.cornell.edu)
2008                   > ftp [^D]
2009                   rtfm.mit.edu tesla.ee.cornell.edu
2010                   > ftp [^C]
2011                   >   set   hostnames  =  (rtfm.mit.edu  tesla.ee.cornell.edu
2012                   uunet.uu.net)
2013                   > ftp [^D]
2014                   rtfm.mit.edu tesla.ee.cornell.edu uunet.uu.net
2015
2016               or from a command run at completion time:
2017
2018                   > complete kill 'p/*/`ps | awk \{print\ \$1\}`/'
2019                   > kill -9 [^D]
2020                   23113 23377 23380 23406 23429 23529 23530 PID
2021
2022               Note that the complete command does not itself quote its  argu‐
2023               ments,  so  the  braces,  space and `$' in `{print $1}' must be
2024               quoted explicitly.
2025
2026               One command can have multiple completions:
2027
2028                   > complete dbx 'p/2/(core)/' 'p/*/c/'
2029
2030               completes the second argument to `dbx' with the word `core' and
2031               all  other  arguments  with commands.  Note that the positional
2032               completion  is  specified  before  the  next-word   completion.
2033               Because  completions  are  evaluated from left to right, if the
2034               next-word completion were specified first it would always match
2035               and the positional completion would never be executed.  This is
2036               a common mistake when defining a completion.
2037
2038               The select pattern is useful when a command  takes  files  with
2039               only particular forms as arguments.  For example,
2040
2041                   > complete cc 'p/*/f:*.[cao]/'
2042
2043               completes `cc' arguments to files ending in only `.c', `.a', or
2044               `.o'.  select can also exclude files, using negation of a glob-
2045               pattern  as  described  under Filename substitution.  One might
2046               use
2047
2048                   > complete rm 'p/*/f:^*.{c,h,cc,C,tex,1,man,l,y}/'
2049
2050               to exclude precious  source  code  from  `rm'  completion.   Of
2051               course,  one  could still type excluded names manually or over‐
2052               ride the completion mechanism using  the  complete-word-raw  or
2053               list-choices-raw editor commands (q.v.).
2054
2055               The  `C', `D', `F' and `T' lists are like `c', `d', `f' and `t'
2056               respectively, but they use the select argument in  a  different
2057               way:  to restrict completion to files beginning with a particu‐
2058               lar path prefix.  For example, the Elm mail program uses `=' as
2059               an abbreviation for one's mail directory.  One might use
2060
2061                   > complete elm c@=@F:$HOME/Mail/@
2062
2063               to  complete  `elm  -f =' as if it were `elm -f ~/Mail/'.  Note
2064               that we used `@' instead of `/' to  avoid  confusion  with  the
2065               select  argument,  and  we  used `$HOME' instead of `~' because
2066               home directory substitution works at only the  beginning  of  a
2067               word.
2068
2069               suffix  is  used  to add a nonstandard suffix (not space or `/'
2070               for directories) to completed words.
2071
2072                   > complete finger 'c/*@/$hostnames/' 'p/1/u/@'
2073
2074               completes arguments to `finger' from the list of users, appends
2075               an  `@',  and then completes after the `@' from the `hostnames'
2076               variable.  Note again the order in which  the  completions  are
2077               specified.
2078
2079               Finally, here's a complex example for inspiration:
2080
2081                   > complete find \
2082                   'n/-name/f/' 'n/-newer/f/' 'n/-{,n}cpio/f/' \
2083                   ´n/-exec/c/' 'n/-ok/c/' 'n/-user/u/' \
2084                   'n/-group/g/' 'n/-fstype/(nfs 4.2)/' \
2085                   'n/-type/(b c d f l p s)/' \
2086                   ´c/-/(name newer cpio ncpio exec ok user \
2087                   group fstype type atime ctime depth inum \
2088                   ls mtime nogroup nouser perm print prune \
2089                   size xdev)/' \
2090                   'p/*/d/'
2091
2092               This  completes  words  following `-name', `-newer', `-cpio' or
2093               `ncpio' (note the pattern which matches both) to  files,  words
2094               following  `-exec' or `-ok' to commands, words following `user'
2095               and `group' to users and groups respectively and words  follow‐
2096               ing  `-fstype'  or  `-type'  to members of the given lists.  It
2097               also completes the switches  themselves  from  the  given  list
2098               (note  the use of c-type completion) and completes anything not
2099               otherwise completed to a directory.  Whew.
2100
2101               Remember that programmed completions are ignored  if  the  word
2102               being completed is a tilde substitution (beginning with `~') or
2103               a variable (beginning with `$').  complete is  an  experimental
2104               feature,  and  the  syntax may change in future versions of the
2105               shell.  See also the uncomplete builtin command.
2106
2107       continue
2108               Continues execution of the nearest enclosing while or  foreach.
2109               The rest of the commands on the current line are executed.
2110
2111       default:
2112               Labels  the default case in a switch statement.  It should come
2113               after all case labels.
2114
2115       dirs [-l] [-n|-v]
2116       dirs -S|-L [filename] (+)
2117       dirs -c (+)
2118               The first form prints the directory  stack.   The  top  of  the
2119               stack  is  at  the left and the first directory in the stack is
2120               the current directory.  With -l, `~' or `~name' in  the  output
2121               is  expanded  explicitly  to  home  or the pathname of the home
2122               directory for user name.  (+)  With  -n,  entries  are  wrapped
2123               before they reach the edge of the screen.  (+) With -v, entries
2124               are printed one per line, preceded by  their  stack  positions.
2125               (+) If more than one of -n or -v is given, -v takes precedence.
2126               -p is accepted but does nothing.
2127
2128               With -S, the second form saves the directory stack to  filename
2129               as  a  series  of  cd  and  pushd commands.  With -L, the shell
2130               sources filename, which is presumably a  directory  stack  file
2131               saved  by  the  -S option or the savedirs mechanism.  In either
2132               case, dirsfile is used if filename is not given and  ~/.cshdirs
2133               is used if dirsfile is unset.
2134
2135               Note  that  login  shells  do  the  equivalent  of `dirs -L' on
2136               startup and, if savedirs is  set,  `dirs  -S'  before  exiting.
2137               Because  only  ~/.tcshrc is normally sourced before ~/.cshdirs,
2138               dirsfile should be set in ~/.tcshrc rather than ~/.login.
2139
2140               The last form clears the directory stack.
2141
2142       echo [-n] word ...
2143               Writes each word to the shell's standard output,  separated  by
2144               spaces  and  terminated  with  a newline.  The echo_style shell
2145               variable may be set to emulate (or not) the  flags  and  escape
2146               sequences  of  the  BSD  and/or  System V versions of echo; see
2147               echo(1).
2148
2149       echotc [-sv] arg ... (+)
2150               Exercises the terminal capabilities (see termcap(5))  in  args.
2151               For  example,  'echotc home' sends the cursor to the home posi‐
2152               tion, 'echotc cm 3 10' sends it to column 3  and  row  10,  and
2153               'echotc  ts  0; echo "This is a test."; echotc fs' prints "This
2154               is a test."  in the status line.
2155
2156               If arg is 'baud', 'cols', 'lines', 'meta' or 'tabs', prints the
2157               value  of  that  capability  ("yes" or "no" indicating that the
2158               terminal does or does not have that capability).  One might use
2159               this  to  make  the  output from a shell script less verbose on
2160               slow terminals, or limit command output to the number of  lines
2161               on the screen:
2162
2163                   > set history=`echotc lines`
2164                   > @ history--
2165
2166               Termcap  strings may contain wildcards which will not echo cor‐
2167               rectly.  One should use double  quotes  when  setting  a  shell
2168               variable  to  a terminal capability string, as in the following
2169               example that places the date in the status line:
2170
2171                   > set tosl="`echotc ts 0`"
2172                   > set frsl="`echotc fs`"
2173                   > echo -n "$tosl";date; echo -n "$frsl"
2174
2175               With -s,  nonexistent  capabilities  return  the  empty  string
2176               rather than causing an error.  With -v, messages are verbose.
2177
2178       else
2179       end
2180       endif
2181       endsw   See  the  description  of  the  foreach,  if, switch, and while
2182               statements below.
2183
2184       eval arg ...
2185               Treats the arguments as input to the  shell  and  executes  the
2186               resulting command(s) in the context of the current shell.  This
2187               is usually used to execute commands generated as the result  of
2188               command or variable substitution, because parsing occurs before
2189               these substitutions.  See tset(1) for a sample use of eval.
2190
2191       exec command
2192               Executes the specified command in place of the current shell.
2193
2194       exit [expr]
2195               The shell exits either with the value of the specified expr (an
2196               expression,  as  described under Expressions) or, without expr,
2197               with the value 0.
2198
2199       fg [%job ...]
2200               Brings the specified jobs (or, without arguments,  the  current
2201               job)  into  the  foreground,  continuing each if it is stopped.
2202               job may be a number, a string, `', `%', `+' or `-' as described
2203               under Jobs.  See also the run-fg-editor editor command.
2204
2205       filetest -op file ... (+)
2206               Applies op (which is a file inquiry operator as described under
2207               File inquiry operators) to each file and returns the results as
2208               a space-separated list.
2209
2210       foreach name (wordlist)
2211       ...
2212       end     Successively  sets the variable name to each member of wordlist
2213               and executes the sequence of commands between this command  and
2214               the  matching  end.  (Both foreach and end must appear alone on
2215               separate lines.)  The builtin command continue may be  used  to
2216               continue  the loop prematurely and the builtin command break to
2217               terminate it prematurely.  When this command is read  from  the
2218               terminal,  the loop is read once prompting with `foreach? ' (or
2219               prompt2) before any statements in the loop  are  executed.   If
2220               you make a mistake typing in a loop at the terminal you can rub
2221               it out.
2222
2223       getspath (+)
2224               Prints the system execution path.  (TCF only)
2225
2226       getxvers (+)
2227               Prints the experimental version prefix.  (TCF only)
2228
2229       glob wordlist
2230               Like echo, but the `-n' parameter is not recognized  and  words
2231               are  delimited  by  null  characters in the output.  Useful for
2232               programs which wish to use the shell to filename expand a  list
2233               of words.
2234
2235       goto word
2236               word  is  filename and command-substituted to yield a string of
2237               the form `label'.  The shell rewinds its input as much as  pos‐
2238               sible,  searches for a line of the form `label:', possibly pre‐
2239               ceded by blanks or tabs, and  continues  execution  after  that
2240               line.
2241
2242       hashstat
2243               Prints  a statistics line indicating how effective the internal
2244               hash table has been at locating commands (and avoiding exec's).
2245               An  exec  is attempted for each component of the path where the
2246               hash function indicates a possible hit, and in  each  component
2247               which does not begin with a `/'.
2248
2249               On  machines  without vfork(2), prints only the number and size
2250               of hash buckets.
2251
2252       history [-hTr] [n]
2253       history -S|-L|-M [filename] (+)
2254       history -c (+)
2255               The first form prints the history event list.  If  n  is  given
2256               only  the  n most recent events are printed or saved.  With -h,
2257               the history list is printed without leading numbers.  If -T  is
2258               specified,  timestamps are printed also in comment form.  (This
2259               can be used to produce files suitable for loading with 'history
2260               -L'  or  'source  -h'.)  With -r, the order of printing is most
2261               recent first rather than oldest first.
2262
2263               With -S, the second form saves the history  list  to  filename.
2264               If  the  first  word of the savehist shell variable is set to a
2265               number, at most that many lines are saved.  If the second  word
2266               of  savehist is set to `merge', the history list is merged with
2267               the existing history file instead of replacing it (if there  is
2268               one)  and sorted by time stamp.  (+) Merging is intended for an
2269               environment like the X Window System  with  several  shells  in
2270               simultaneous  use.   Currently it succeeds only when the shells
2271               quit nicely one after another.
2272
2273               With -L, the shell appends filename, which is presumably a his‐
2274               tory  list saved by the -S option or the savehist mechanism, to
2275               the history list.  -M is like -L, but the contents of  filename
2276               are  merged  into the history list and sorted by timestamp.  In
2277               either case, histfile is used if  filename  is  not  given  and
2278               ~/.history  is  used  if  histfile  is  unset.  `history -L' is
2279               exactly like 'source -h' except that  it  does  not  require  a
2280               filename.
2281
2282               Note  that  login  shells  do the equivalent of `history -L' on
2283               startup and, if savehist is set, `history -S'  before  exiting.
2284               Because  only  ~/.tcshrc is normally sourced before ~/.history,
2285               histfile should be set in ~/.tcshrc rather than ~/.login.
2286
2287               If histlit is set, the first and second forms  print  and  save
2288               the literal (unexpanded) form of the history list.
2289
2290               The last form clears the history list.
2291
2292       hup [command] (+)
2293               With  command,  runs command such that it will exit on a hangup
2294               signal and arranges for the shell to send it  a  hangup  signal
2295               when  the  shell  exits.   Note that commands may set their own
2296               response to  hangups,  overriding  hup.   Without  an  argument
2297               (allowed in only a shell script), causes the shell to exit on a
2298               hangup for the remainder of the script.  See also  Signal  han‐
2299               dling and the nohup builtin command.
2300
2301       if (expr) command
2302               If  expr (an expression, as described under Expressions) evalu‐
2303               ates true, then command is executed.  Variable substitution  on
2304               command happens early, at the same time it does for the rest of
2305               the if command.  command must  be  a  simple  command,  not  an
2306               alias,  a  pipeline,  a command list or a parenthesized command
2307               list, but it  may  have  arguments.   Input/output  redirection
2308               occurs  even if expr is false and command is thus not executed;
2309               this is a bug.
2310
2311       if (expr) then
2312       ...
2313       else if (expr2) then
2314       ...
2315       else
2316       ...
2317       endif   If the specified expr is true then the commands  to  the  first
2318               else are executed; otherwise if expr2 is true then the commands
2319               to the second else are executed, etc.  Any  number  of  else-if
2320               pairs are possible; only one endif is needed.  The else part is
2321               likewise optional.  (The words else and endif  must  appear  at
2322               the  beginning  of input lines; the if must appear alone on its
2323               input line or after an else.)
2324
2325       inlib shared-library ... (+)
2326               Adds each shared-library to the current environment.  There  is
2327               no way to remove a shared library.  (Domain/OS only)
2328
2329       jobs [-l]
2330               Lists  the active jobs.  With -l, lists process IDs in addition
2331               to the normal information.  On TCF systems, prints the site  on
2332               which each job is executing.
2333
2334       kill [-s signal] %job|pid ...
2335       kill -l The  first  and second forms sends the specified signal (or, if
2336               none is given, the TERM (terminate) signal)  to  the  specified
2337               jobs or processes.  job may be a number, a string, `', `%', `+'
2338               or `-' as described under Jobs.  Signals are  either  given  by
2339               number  or by name (as given in /usr/include/signal.h, stripped
2340               of the prefix `SIG').  There is no  default  job;  saying  just
2341               `kill'  does not send a signal to the current job.  If the sig‐
2342               nal being sent is TERM (terminate) or HUP  (hangup),  then  the
2343               job  or  process is sent a CONT (continue) signal as well.  The
2344               third form lists the signal names.
2345
2346       limit [-h] [resource [maximum-use]]
2347               Limits the consumption by the current process and each  process
2348               it creates to not individually exceed maximum-use on the speci‐
2349               fied resource.  If no maximum-use is given,  then  the  current
2350               limit is printed; if no resource is given, then all limitations
2351               are given.  If the -h flag is given, the hard limits  are  used
2352               instead  of the current limits.  The hard limits impose a ceil‐
2353               ing on the values of the current limits.  Only  the  super-user
2354               may  raise  the  hard limits, but a user may lower or raise the
2355               current limits within the legal range.
2356
2357               Controllable resources currently include (if supported  by  the
2358               OS):
2359
2360               cputime
2361                      the  maximum  number  of  cpu-seconds to be used by each
2362                      process
2363
2364               filesize
2365                      the largest single file which can be created
2366
2367               datasize
2368                      the maximum growth of the data+stack region via  sbrk(2)
2369                      beyond the end of the program text
2370
2371               stacksize
2372                      the  maximum  size  of  the automatically-extended stack
2373                      region
2374
2375               coredumpsize
2376                      the size of the largest core dump that will be created
2377
2378               memoryuse
2379                      the maximum amount of physical memory a process may have
2380                      allocated to it at a given time (this is not implemented
2381                      in the 2.6 kernel. The value is meaningless and changing
2382                      this value will have no effect)
2383
2384               heapsize
2385                      the  maximum amount of memory a process may allocate per
2386                      brk() system call
2387
2388               descriptors or openfiles
2389                      the maximum number of open files for this process
2390
2391               concurrency
2392                      the maximum number of threads for this process
2393
2394               memorylocked
2395                      the maximum size which a process may  lock  into  memory
2396                      using mlock(2)
2397
2398               maxproc
2399                      the  maximum  number  of simultaneous processes for this
2400                      user id
2401
2402               sbsize the maximum size of socket buffer usage for this user
2403
2404               swapsize
2405                      the maximum amount of swap space reserved  or  used  for
2406                      this user
2407
2408               maximum-use  may be given as a (floating point or integer) num‐
2409               ber followed by a scale factor.   For  all  limits  other  than
2410               cputime the default scale is `k' or `kilobytes' (1024 bytes); a
2411               scale factor of `m' or  `megabytes'  may  also  be  used.   For
2412               cputime the default scaling is `seconds', while `m' for minutes
2413               or `h' for hours, or a time of the form `mm:ss' giving  minutes
2414               and seconds may be used.
2415
2416               For both resource names and scale factors, unambiguous prefixes
2417               of the names suffice.
2418
2419       log (+) Prints the watch shell variable and reports on each user  indi‐
2420               cated  in  watch who is logged in, regardless of when they last
2421               logged in.  See also watchlog.
2422
2423       login   Terminates a login shell, replacing  it  with  an  instance  of
2424               /bin/login.  This  is one way to log off, included for compati‐
2425               bility with sh(1).
2426
2427       logout  Terminates a login shell.  Especially useful  if  ignoreeof  is
2428               set.
2429
2430       ls-F [-switch ...] [file ...] (+)
2431               Lists  files like `ls -F', but much faster.  It identifies each
2432               type of special file in the listing with a special character:
2433
2434               /   Directory
2435               *   Executable
2436               #   Block device
2437               %   Character device
2438               |   Named pipe (systems with named pipes only)
2439               =   Socket (systems with sockets only)
2440               @   Symbolic link (systems with symbolic links only)
2441               +   Hidden directory (AIX only)  or  context  dependent  (HP/UX
2442                   only)
2443               :   Network special (HP/UX only)
2444
2445               If  the  listlinks  shell  variable  is set, symbolic links are
2446               identified in more detail (on only systems that have  them,  of
2447               course):
2448
2449               @   Symbolic link to a non-directory
2450               >   Symbolic link to a directory
2451               &   Symbolic link to nowhere
2452
2453               listlinks  also  slows  down ls-F and causes partitions holding
2454               files pointed to by symbolic links to be mounted.
2455
2456               If the listflags shell variable is set to `x', `a' or  `A',  or
2457               any combination thereof (e.g., `xA'), they are used as flags to
2458               ls-F, making it act like `ls -xF', `ls -Fa', `ls -FA' or a com‐
2459               bination  (e.g.,  `ls -FxA').  On machines where `ls -C' is not
2460               the default, ls-F acts like `ls -CF', unless listflags contains
2461               an  `x',  in which case it acts like `ls -xF'.  ls-F passes its
2462               arguments to ls(1) if it is given any switches,  so  `alias  ls
2463               ls-F' generally does the right thing.
2464
2465               The  ls-F builtin can list files using different colors depend‐
2466               ing on the filetype or extension.  See the color tcsh  variable
2467               and the LS_COLORS environment variable.
2468
2469       migrate [-site] pid|%jobid ... (+)
2470       migrate -site (+)
2471               The  first  form migrates the process or job to the site speci‐
2472               fied or the default site determined by the  system  path.   The
2473               second  form  is  equivalent to `migrate -site $$': it migrates
2474               the current process to the specified site.  Migrating the shell
2475               itself  can  cause  unexpected behavior, because the shell does
2476               not like to lose its tty.  (TCF only)
2477
2478       newgrp [-] group (+)
2479               Equivalent to `exec newgrp'; see newgrp(1).  Available only  if
2480               the shell was so compiled; see the version shell variable.
2481
2482       nice [+number] [command]
2483               Sets the scheduling priority for the shell to number, or, with‐
2484               out number, to 4.  With command, runs command at the  appropri‐
2485               ate priority.  The greater the number, the less cpu the process
2486               gets.  The super-user may specify negative  priority  by  using
2487               `nice -number ...'.  Command is always executed in a sub-shell,
2488               and the restrictions placed on commands in simple if statements
2489               apply.
2490
2491       nohup [command]
2492               With command, runs command such that it will ignore hangup sig‐
2493               nals.  Note  that  commands  may  set  their  own  response  to
2494               hangups,  overriding  nohup.   Without  an argument (allowed in
2495               only a shell script), causes the shell to  ignore  hangups  for
2496               the  remainder of the script.  See also Signal handling and the
2497               hup builtin command.
2498
2499       notify [%job ...]
2500               Causes the shell to notify the  user  asynchronously  when  the
2501               status of any of the specified jobs (or, without %job, the cur‐
2502               rent job) changes, instead of waiting until the next prompt  as
2503               is  usual.   job may be a number, a string, `', `%', `+' or `-'
2504               as described under Jobs.  See also the notify shell variable.
2505
2506       onintr [-|label]
2507               Controls the action of the shell on interrupts.  Without  argu‐
2508               ments,  restores the default action of the shell on interrupts,
2509               which is to terminate shell scripts or to return to the  termi‐
2510               nal command input level.  With `-', causes all interrupts to be
2511               ignored.  With label, causes  the  shell  to  execute  a  `goto
2512               label'  when an interrupt is received or a child process termi‐
2513               nates because it was interrupted.
2514
2515               onintr is ignored if the shell is running detached and in  sys‐
2516               tem  startup  files  (see FILES), where interrupts are disabled
2517               anyway.
2518
2519       popd [-p] [-l] [-n|-v] [+n]
2520               Without arguments, pops the directory stack and returns to  the
2521               new top directory.  With a number `+n', discards the n'th entry
2522               in the stack.
2523
2524               Finally, all forms of popd print  the  final  directory  stack,
2525               just  like  dirs.  The pushdsilent shell variable can be set to
2526               prevent this and the -p flag can be given to override  pushdsi‐
2527               lent.   The -l, -n and -v flags have the same effect on popd as
2528               on dirs.  (+)
2529
2530       printenv [name] (+)
2531               Prints the names and values of all  environment  variables  or,
2532               with name, the value of the environment variable name.
2533
2534       pushd [-p] [-l] [-n|-v] [name|+n]
2535               Without arguments, exchanges the top two elements of the direc‐
2536               tory stack.  If pushdtohome is  set,  pushd  without  arguments
2537               does  `pushd  ~',  like  cd.  (+) With name, pushes the current
2538               working directory onto the directory stack and changes to name.
2539               If name is `-' it is interpreted as the previous working direc‐
2540               tory (see Filename substitution).  (+) If dunique is set, pushd
2541               removes  any instances of name from the stack before pushing it
2542               onto the stack.  (+) With a number `+n', rotates the  nth  ele‐
2543               ment  of  the  directory stack around to be the top element and
2544               changes to  it.   If  dextract  is  set,  however,  `pushd  +n'
2545               extracts the nth directory, pushes it onto the top of the stack
2546               and changes to it.  (+)
2547
2548               Finally, all forms of pushd print the  final  directory  stack,
2549               just  like  dirs.  The pushdsilent shell variable can be set to
2550               prevent this and the -p flag can be given to override  pushdsi‐
2551               lent.  The -l, -n and -v flags have the same effect on pushd as
2552               on dirs.  (+)
2553
2554       rehash  Causes the internal hash table of the contents of the  directo‐
2555               ries  in the path variable to be recomputed.  This is needed if
2556               new commands are added to directories in  path  while  you  are
2557               logged  in.   This should be necessary only if you add commands
2558               to one of your own directories,  or  if  a  systems  programmer
2559               changes  the  contents  of one of the system directories.  Also
2560               flushes the cache of home directories built by tilde expansion.
2561
2562       repeat count command
2563               The specified command, which is subject to  the  same  restric‐
2564               tions  as  the  command  in the one line if statement above, is
2565               executed count times.  I/O  redirections  occur  exactly  once,
2566               even if count is 0.
2567
2568       rootnode //nodename (+)
2569               Changes  the rootnode to //nodename, so that `/' will be inter‐
2570               preted as `//nodename'.  (Domain/OS only)
2571
2572       sched (+)
2573       sched [+]hh:mm command (+)
2574       sched -n (+)
2575               The first form prints  the  scheduled-event  list.   The  sched
2576               shell  variable  may  be  set to define the format in which the
2577               scheduled-event list is printed.  The second form adds  command
2578               to the scheduled-event list.  For example,
2579
2580                   > sched 11:00 echo It\'s eleven o\'clock.
2581
2582               causes  the shell to echo `It's eleven o'clock.' at 11 AM.  The
2583               time may be in 12-hour AM/PM format
2584
2585                   > sched 5pm set prompt='[%h] It\'s after 5; go home: >'
2586
2587               or may be relative to the current time:
2588
2589                   > sched +2:15 /usr/lib/uucp/uucico -r1 -sother
2590
2591               A relative time specification may not use  AM/PM  format.   The
2592               third form removes item n from the event list:
2593
2594                   > sched
2595                        1  Wed Apr  4 15:42  /usr/lib/uucp/uucico -r1 -sother
2596                        2   Wed Apr  4 17:00  set prompt=[%h] It's after 5; go
2597                   home: >
2598                   > sched -2
2599                   > sched
2600                        1  Wed Apr  4 15:42  /usr/lib/uucp/uucico -r1 -sother
2601
2602               A command in the scheduled-event list is executed  just  before
2603               the  first prompt is printed after the time when the command is
2604               scheduled.  It is possible to miss the exact time when the com‐
2605               mand  is  to be run, but an overdue command will execute at the
2606               next prompt.  A command which comes  due  while  the  shell  is
2607               waiting  for user input is executed immediately.  However, nor‐
2608               mal operation of an already-running command will not be  inter‐
2609               rupted so that a scheduled-event list element may be run.
2610
2611               This  mechanism  is  similar to, but not the same as, the at(1)
2612               command on some Unix systems.  Its major disadvantage  is  that
2613               it  may  not  run a command at exactly the specified time.  Its
2614               major advantage is that because sched runs  directly  from  the
2615               shell,  it  has access to shell variables and other structures.
2616               This provides a mechanism for changing one's  working  environ‐
2617               ment based on the time of day.
2618
2619       set
2620       set name ...
2621       set name=word ...
2622       set [-r] [-f|-l] name=(wordlist) ... (+)
2623       set name[index]=word ...
2624       set -r (+)
2625       set -r name ... (+)
2626       set -r name=word ... (+)
2627               The  first  form  of  the command prints the value of all shell
2628               variables.  Variables which contain more  than  a  single  word
2629               print  as a parenthesized word list.  The second form sets name
2630               to the null string.  The third form sets  name  to  the  single
2631               word.   The  fourth  form  sets  name  to  the list of words in
2632               wordlist.  In all cases  the  value  is  command  and  filename
2633               expanded.   If -r is specified, the value is set read-only.  If
2634               -f or -l are specified, set only  unique  words  keeping  their
2635               order.   -f  prefers the first occurrence of a word, and -l the
2636               last.  The fifth form sets the index'th component  of  name  to
2637               word;  this component must already exist.  The sixth form lists
2638               only the names of all shell variables that are read-only.   The
2639               seventh  form  makes  name  read-only,  whether or not it has a
2640               value.  The eighth form is the same as the third form, but make
2641               name read-only at the same time.
2642
2643               These  arguments  can  be repeated to set and/or make read-only
2644               multiple variables in a single  set  command.   Note,  however,
2645               that  variable  expansion  happens for all arguments before any
2646               setting occurs.  Note also that `=' can  be  adjacent  to  both
2647               name  and word or separated from both by whitespace, but cannot
2648               be adjacent to only one or  the  other.   See  also  the  unset
2649               builtin command.
2650
2651       setenv [name [value]]
2652               Without  arguments, prints the names and values of all environ‐
2653               ment variables.  Given name, sets the environment variable name
2654               to value or, without value, to the null string.
2655
2656       setpath path (+)
2657               Equivalent to setpath(1).  (Mach only)
2658
2659       setspath LOCAL|site|cpu ... (+)
2660               Sets the system execution path.  (TCF only)
2661
2662       settc cap value (+)
2663               Tells the shell to believe that the terminal capability cap (as
2664               defined in termcap(5)) has the value value.  No sanity checking
2665               is  done.   Concept terminal users may have to `settc xn no' to
2666               get proper wrapping at the rightmost column.
2667
2668       setty [-d|-q|-x] [-a] [[+|-]mode] (+)
2669               Controls which tty modes (see Terminal  management)  the  shell
2670               does  not  allow to change.  -d, -q or -x tells setty to act on
2671               the `edit', `quote' or `execute' set of tty modes respectively;
2672               without -d, -q or -x, `execute' is used.
2673
2674               Without  other  arguments,  setty lists the modes in the chosen
2675               set which are fixed on (`+mode') or off (`-mode').  The  avail‐
2676               able  modes,  and thus the display, vary from system to system.
2677               With -a, lists all tty modes in the chosen set whether  or  not
2678               they  are  fixed.   With +mode, -mode or mode, fixes mode on or
2679               off or removes control from mode in the chosen set.  For  exam‐
2680               ple, `setty +echok echoe' fixes `echok' mode on and allows com‐
2681               mands to turn `echoe' mode on or off, both when  the  shell  is
2682               executing commands.
2683
2684       setxvers [string] (+)
2685               Set the experimental version prefix to string, or removes it if
2686               string is omitted.  (TCF only)
2687
2688       shift [variable]
2689               Without arguments, discards argv[1] and shifts the  members  of
2690               argv  to the left.  It is an error for argv not to be set or to
2691               have less than one word as value.  With variable, performs  the
2692               same function on variable.
2693
2694       source [-h] name [args ...]
2695               The  shell reads and executes commands from name.  The commands
2696               are not placed on the history list.  If  any  args  are  given,
2697               they are placed in argv.  (+) source commands may be nested; if
2698               they are nested too deeply  the  shell  may  run  out  of  file
2699               descriptors.   An error in a source at any level terminates all
2700               nested source commands.  With -h, commands are  placed  on  the
2701               history list instead of being executed, much like `history -L'.
2702
2703       stop %job|pid ...
2704               Stops  the  specified  jobs or processes which are executing in
2705               the background.  job may be a number, a string, `', `%', `+' or
2706               `-'  as  described under Jobs.  There is no default job; saying
2707               just `stop' does not stop the current job.
2708
2709       suspend Causes the shell to stop in its tracks, much as if it had  been
2710               sent  a  stop  signal with ^Z.  This is most often used to stop
2711               shells started by su(1).
2712
2713       switch (string)
2714       case str1:
2715           ...
2716           breaksw
2717       ...
2718       default:
2719           ...
2720           breaksw
2721       endsw   Each case label is successively matched, against the  specified
2722               string  which is first command and filename expanded.  The file
2723               metacharacters `*', `?' and `[...]'  may be used  in  the  case
2724               labels,  which  are  variable  expanded.  If none of the labels
2725               match before a `default' label is  found,  then  the  execution
2726               begins  after  the  default  label.   Each  case  label and the
2727               default label must appear at the beginning of a line.  The com‐
2728               mand  breaksw  causes  execution  to  continue after the endsw.
2729               Otherwise control may fall  through  case  labels  and  default
2730               labels  as  in C.  If no label matches and there is no default,
2731               execution continues after the endsw.
2732
2733       telltc (+)
2734               Lists the values of all terminal capabilities (see termcap(5)).
2735
2736       termname [terminal type] (+)
2737               Tests if terminal type (or the current value of TERM if no ter‐
2738               minal  type  is  given) has an entry in the hosts termcap(5) or
2739               terminfo(5) database. Prints the terminal type  to  stdout  and
2740               returns 0 if an entry is present otherwise returns 1.
2741
2742       time [command]
2743               Executes command (which must be a simple command, not an alias,
2744               a pipeline, a command list or a parenthesized command list) and
2745               prints a time summary as described under the time variable.  If
2746               necessary, an extra shell is created to print the time  statis‐
2747               tic when the command completes.  Without command, prints a time
2748               summary for the current shell and its children.
2749
2750       umask [value]
2751               Sets the file creation mask to value, which is given in  octal.
2752               Common  values  for  the mask are 002, giving all access to the
2753               group and read and execute access to others,  and  022,  giving
2754               read  and  execute  access  to  the  group and others.  Without
2755               value, prints the current file creation mask.
2756
2757       unalias pattern
2758               Removes all aliases whose names  match  pattern.   `unalias  *'
2759               thus removes all aliases.  It is not an error for nothing to be
2760               unaliased.
2761
2762       uncomplete pattern (+)
2763               Removes all completions whose names match pattern.  `uncomplete
2764               *'  thus removes all completions.  It is not an error for noth‐
2765               ing to be uncompleted.
2766
2767       unhash  Disables use of the internal hash table to  speed  location  of
2768               executed programs.
2769
2770       universe universe (+)
2771               Sets the universe to universe.  (Masscomp/RTU only)
2772
2773       unlimit [-hf] [resource]
2774               Removes the limitation on resource or, if no resource is speci‐
2775               fied, all resource limitations.   With  -h,  the  corresponding
2776               hard  limits  are  removed.   Only  the super-user may do this.
2777               Note that unlimit may not exit successful, since  most  systems
2778               do  not  allow descriptors to be unlimited.  With -f errors are
2779               ignored.
2780
2781       unset pattern
2782               Removes all variables whose names match  pattern,  unless  they
2783               are  read-only.   `unset  *'  thus removes all variables unless
2784               they are read-only; this is a bad idea.  It is not an error for
2785               nothing to be unset.
2786
2787       unsetenv pattern
2788               Removes  all  environment  variables whose names match pattern.
2789               `unsetenv *' thus removes all environment variables; this is  a
2790               bad idea.  It is not an error for nothing to be unsetenved.
2791
2792       ver [systype [command]] (+)
2793               Without  arguments, prints SYSTYPE.  With systype, sets SYSTYPE
2794               to systype.  With systype and command, executes  command  under
2795               systype.   systype  may  be  `bsd4.3'  or `sys5.3'.  (Domain/OS
2796               only)
2797
2798       wait    The shell waits for all  background  jobs.   If  the  shell  is
2799               interactive,  an  interrupt will disrupt the wait and cause the
2800               shell to print the names and job  numbers  of  all  outstanding
2801               jobs.
2802
2803       warp universe (+)
2804               Sets the universe to universe.  (Convex/OS only)
2805
2806       watchlog (+)
2807               An  alternate  name for the log builtin command (q.v.).  Avail‐
2808               able only if the shell was so compiled; see the  version  shell
2809               variable.
2810
2811       where command (+)
2812               Reports  all  known  instances  of  command, including aliases,
2813               builtins and executables in path.
2814
2815       which command (+)
2816               Displays the command that will be executed by the  shell  after
2817               substitutions,  path  searching,  etc.   The builtin command is
2818               just like which(1), but it correctly reports tcsh  aliases  and
2819               builtins  and  is  10 to 100 times faster.  See also the which-
2820               command editor command.
2821
2822       while (expr)
2823       ...
2824       end     Executes the commands between the while and  the  matching  end
2825               while  expr  (an  expression,  as  described under Expressions)
2826               evaluates non-zero.  while and end must appear alone  on  their
2827               input  lines.   break  and continue may be used to terminate or
2828               continue the loop prematurely.  If the input is a terminal, the
2829               user  is prompted the first time through the loop as with fore‐
2830               ach.
2831
2832   Special aliases (+)
2833       If set, each of these aliases executes automatically at  the  indicated
2834       time.  They are all initially undefined.
2835
2836       beepcmd Runs when the shell wants to ring the terminal bell.
2837
2838       cwdcmd  Runs  after every change of working directory.  For example, if
2839               the user is working on an X window system using xterm(1) and  a
2840               re-parenting  window  manager  that supports title bars such as
2841               twm(1) and does
2842
2843                   > alias cwdcmd  'echo -n "^[]2;${HOST}:$cwd ^G"'
2844
2845               then the shell will change the title of the running xterm(1) to
2846               be  the name of the host, a colon, and the full current working
2847               directory.  A fancier way to do that is
2848
2849                   >          alias          cwdcmd          'echo          -n
2850                   "^[]2;${HOST}:$cwd^G^[]1;${HOST}^G"'
2851
2852               This  will  put the hostname and working directory on the title
2853               bar but only the hostname in the icon manager menu.
2854
2855               Note that putting a cd, pushd or popd in cwdcmd  may  cause  an
2856               infinite loop.  It is the author's opinion that anyone doing so
2857               will get what they deserve.
2858
2859       jobcmd  Runs before each command gets executed,  or  when  the  command
2860               changes  state.   This  is  similar to postcmd, but it does not
2861               print builtins.
2862
2863                   > alias jobcmd  'echo -n "^[]2\;\!#:q^G"'
2864
2865               then executing vi foo.c will put  the  command  string  in  the
2866               xterm title bar.
2867
2868       helpcommand
2869               Invoked  by  the run-help editor command.  The command name for
2870               which help is sought is passed as sole argument.  For  example,
2871               if one does
2872
2873                   > alias helpcommand '\!:1 --help'
2874
2875               then  the  help  display of the command itself will be invoked,
2876               using the GNU help calling convention.  Currently there  is  no
2877               easy  way to account for various calling conventions (e.g., the
2878               customary Unix `-h'), except by using a table of many commands.
2879
2880       periodic
2881               Runs every tperiod minutes.  This provides a  convenient  means
2882               for checking on common but infrequent changes such as new mail.
2883               For example, if one does
2884
2885                   > set tperiod = 30
2886                   > alias periodic checknews
2887
2888               then the checknews(1) program runs every 30 minutes.  If  peri‐
2889               odic  is set but tperiod is unset or set to 0, periodic behaves
2890               like precmd.
2891
2892       precmd  Runs just before each prompt is printed.  For example,  if  one
2893               does
2894
2895                   > alias precmd date
2896
2897               then  date(1)  runs just before the shell prompts for each com‐
2898               mand.  There are no limits on what precmd can be set to do, but
2899               discretion should be used.
2900
2901       postcmd Runs before each command gets executed.
2902
2903                   > alias postcmd  'echo -n "^[]2\;\!#:q^G"'
2904
2905               then  executing  vi  foo.c  will  put the command string in the
2906               xterm title bar.
2907
2908       shell   Specifies the interpreter for executable scripts which  do  not
2909               themselves  specify an interpreter.  The first word should be a
2910               full path name to the desired interpreter (e.g., `/bin/csh'  or
2911               `/usr/local/bin/tcsh').
2912
2913   Special shell variables
2914       The  variables  described  in  this section have special meaning to the
2915       shell.
2916
2917       The  shell  sets  addsuffix,  argv,  autologout,  csubstnonl,  command,
2918       echo_style,  edit,  gid,  group,  home,  loginsh,  oid,  path,  prompt,
2919       prompt2, prompt3, shell, shlvl, tcsh, term, tty, uid, user and  version
2920       at  startup;  they do not change thereafter unless changed by the user.
2921       The shell updates cwd, dirstack, owd and  status  when  necessary,  and
2922       sets logout on logout.
2923
2924       The shell synchronizes group, home, path, shlvl, term and user with the
2925       environment variables of the same names: whenever the environment vari‐
2926       able  changes  the  shell  changes  the corresponding shell variable to
2927       match (unless the shell variable is read-only) and  vice  versa.   Note
2928       that  although  cwd  and PWD have identical meanings, they are not syn‐
2929       chronized in this manner, and that the  shell  automatically  intercon‐
2930       verts the different formats of path and PATH.
2931
2932       addsuffix (+)
2933               If  set, filename completion adds `/' to the end of directories
2934               and a space to the end of normal files when  they  are  matched
2935               exactly.  Set by default.
2936
2937       afsuser (+)
2938               If set, autologout's autolock feature uses its value instead of
2939               the local username for kerberos authentication.
2940
2941       ampm (+)
2942               If set, all times are shown in 12-hour AM/PM format.
2943
2944       argv    The arguments to the shell.  Positional  parameters  are  taken
2945               from  argv,  i.e., `$1' is replaced by `$argv[1]', etc.  Set by
2946               default, but usually empty in interactive shells.
2947
2948       autocorrect (+)
2949               If set, the spell-word editor command is invoked  automatically
2950               before each completion attempt.
2951
2952       autoexpand (+)
2953               If  set, the expand-history editor command is invoked automati‐
2954               cally before each completion attempt. If this is set  to  only‐
2955               history,  then  only history will be expanded and a second com‐
2956               pletion will expand filenames.
2957
2958       autolist (+)
2959               If set, possibilities are listed after an ambiguous completion.
2960               If  set  to  `ambiguous', possibilities are listed only when no
2961               new characters are added by completion.
2962
2963       autologout (+)
2964               The first word is the number of minutes  of  inactivity  before
2965               automatic  logout.   The  optional second word is the number of
2966               minutes of inactivity before automatic locking.  When the shell
2967               automatically logs out, it prints `auto-logout', sets the vari‐
2968               able logout to `automatic' and exits.  When the shell automati‐
2969               cally locks, the user is required to enter his password to con‐
2970               tinue working.  Five incorrect  attempts  result  in  automatic
2971               logout.  Set to `60' (automatic logout after 60 minutes, and no
2972               locking) by default in login and superuser shells, but  not  if
2973               the shell thinks it is running under a window system (i.e., the
2974               DISPLAY environment variable is set), the tty is  a  pseudo-tty
2975               (pty)  or  the shell was not so compiled (see the version shell
2976               variable).  See also the afsuser and logout shell variables.
2977
2978       backslash_quote (+)
2979               If set, backslashes (`\') always quote `\', `'', and `"'.  This
2980               may  make complex quoting tasks easier, but it can cause syntax
2981               errors in csh(1) scripts.
2982
2983       catalog The file name  of  the  message  catalog.   If  set,  tcsh  use
2984               `tcsh.${catalog}'  as  a  message  catalog  instead  of default
2985               `tcsh'.
2986
2987       cdpath  A list of directories in which cd should search for subdirecto‐
2988               ries if they aren't found in the current directory.
2989
2990       color   If  set,  it  enables color display for the builtin ls-F and it
2991               passes --color=auto to ls.  Alternatively, it  can  be  set  to
2992               only ls-F or only ls to enable color to only one command.  Set‐
2993               ting it to nothing is equivalent to setting it to (ls-F ls).
2994
2995       colorcat
2996               If set, it enables color escape sequence for NLS message files.
2997               And display colorful NLS messages.
2998
2999       command (+)
3000               If  set,  the command which was passed to the shell with the -c
3001               flag (q.v.).
3002
3003       compat_expr (+)
3004               If set, the shell will evaluate expressions right to left, like
3005               the original csh.
3006
3007       complete (+)
3008               If  set to `enhance', completion 1) ignores case and 2) consid‐
3009               ers periods, hyphens and underscores (`.', `-' and `_')  to  be
3010               word  separators  and hyphens and underscores to be equivalent.
3011               If set to `igncase', the completion becomes case insensitive.
3012
3013       continue (+)
3014               If set to a list of  commands,  the  shell  will  continue  the
3015               listed commands, instead of starting a new one.
3016
3017       continue_args (+)
3018               Same as continue, but the shell will execute:
3019
3020                   echo `pwd` $argv > ~/.<cmd>_pause; %<cmd>
3021
3022       correct (+)
3023               If set to `cmd', commands are automatically spelling-corrected.
3024               If set to `complete', commands are automatically completed.  If
3025               set to `all', the entire command line is corrected.
3026
3027       csubstnonl (+)
3028               If  set,  newlines and carriage returns in command substitution
3029               are replaced by spaces.  Set by default.
3030
3031       cwd     The full pathname of  the  current  directory.   See  also  the
3032               dirstack and owd shell variables.
3033
3034       dextract (+)
3035               If  set,  `pushd +n' extracts the nth directory from the direc‐
3036               tory stack rather than rotating it to the top.
3037
3038       dirsfile (+)
3039               The default location in which `dirs -S' and `dirs -L' look  for
3040               a  history  file.   If unset, ~/.cshdirs is used.  Because only
3041               ~/.tcshrc  is  normally  sourced  before  ~/.cshdirs,  dirsfile
3042               should be set in ~/.tcshrc rather than ~/.login.
3043
3044       dirstack (+)
3045               An  array  of  all  the  directories  on  the  directory stack.
3046               `$dirstack[1]' is the current working directory, `$dirstack[2]'
3047               the  first  directory on the stack, etc.  Note that the current
3048               working directory is `$dirstack[1]' but `=0' in directory stack
3049               substitutions,  etc.   One  can change the stack arbitrarily by
3050               setting dirstack, but the first element  (the  current  working
3051               directory)  is  always correct.  See also the cwd and owd shell
3052               variables.
3053
3054       dspmbyte (+)
3055               Has an affect iff 'dspm' is listed as part of the version shell
3056               variable.  If set to `euc', it enables display and editing EUC-
3057               kanji(Japanese) code.  If set to `sjis', it enables display and
3058               editing Shift-JIS(Japanese) code.  If set to `big5', it enables
3059               display and editing Big5(Chinese) code.  If set to  `utf8',  it
3060               enables  display and editing Utf8(Unicode) code.  If set to the
3061               following format, it enables display and  editing  of  original
3062               multi-byte code format:
3063
3064                   > set dspmbyte = 0000....(256 bytes)....0000
3065
3066               The table requires just 256 bytes.  Each character of 256 char‐
3067               acters corresponds (from left to  right)  to  the  ASCII  codes
3068               0x00,  0x01,  ...  0xff.  Each character is set to number 0,1,2
3069               and 3.  Each number has the following meaning:
3070                 0 ... not used for multi-byte characters.
3071                 1 ... used for the first byte of a multi-byte character.
3072                 2 ... used for the second byte of a multi-byte character.
3073                 3 ... used for both the first  byte  and  second  byte  of  a
3074               multi-byte character.
3075
3076
3077
3078
3079
3080
3081
3082                 Example:
3083               If  set  to  `001322',  the  first character (means 0x00 of the
3084               ASCII code) and second character (means 0x01 of ASCII code) are
3085               set  to  `0'.   Then, it is not used for multi-byte characters.
3086               The 3rd character (0x02) is set to '1', indicating that  it  is
3087               used  for  the  first  byte of a multi-byte character.  The 4th
3088               character(0x03) is set '3'.  It is used for both the first byte
3089               and the second byte of a multi-byte character.  The 5th and 6th
3090               characters (0x04,0x05) are set to '2', indicating that they are
3091               used for the second byte of a multi-byte character.
3092
3093               The GNU fileutils version of ls cannot display multi-byte file‐
3094               names without the -N ( --literal ) option.   If you  are  using
3095               this version, set the second word of dspmbyte to "ls".  If not,
3096               for example, "ls-F -l" cannot display multi-byte filenames.
3097
3098                 Note:
3099               This variable can only be used if KANJI and DSPMBYTE  has  been
3100               defined at compile time.
3101
3102       dunique (+)
3103               If  set,  pushd  removes  any  instances of name from the stack
3104               before pushing it onto the stack.
3105
3106       echo    If set, each command with its arguments is echoed  just  before
3107               it  is executed.  For non-builtin commands all expansions occur
3108               before echoing.  Builtin commands are echoed before command and
3109               filename  substitution,  because  these  substitutions are then
3110               done selectively.  Set by the -x command line option.
3111
3112       echo_style (+)
3113               The style of the echo builtin.  May be set to
3114
3115               bsd     Don't echo a newline if the first argument is `-n'.
3116               sysv    Recognize backslashed escape sequences in echo strings.
3117               both    Recognize both the `-n'  flag  and  backslashed  escape
3118                       sequences; the default.
3119               none    Recognize neither.
3120
3121               Set by default to the local system default.  The BSD and System
3122               V options are described in the echo(1) man pages on the  appro‐
3123               priate systems.
3124
3125       edit (+)
3126               If  set,  the  command-line  editor is used.  Set by default in
3127               interactive shells.
3128
3129       ellipsis (+)
3130               If set, the `%c'/`%.' and `%C' prompt sequences (see the prompt
3131               shell  variable)  indicate skipped directories with an ellipsis
3132               (`...')  instead of `/<skipped>'.
3133
3134       fignore (+)
3135               Lists file name suffixes to be ignored by completion.
3136
3137       filec   In tcsh, completion is always used and this variable is ignored
3138               by  default. If edit is unset, then the traditional csh comple‐
3139               tion is used.  If set in csh, filename completion is used.
3140
3141       gid (+) The user's real group ID.
3142
3143       group (+)
3144               The user's group name.
3145
3146       highlight
3147               If set, the incremental search match (in i-search-back  and  i-
3148               search-fwd)  and the region between the mark and the cursor are
3149               highlighted in reverse video.
3150
3151               Highlighting requires  more  frequent  terminal  writes,  which
3152               introduces  extra  overhead. If you care about terminal perfor‐
3153               mance, you may want to leave this unset.
3154
3155       histchars
3156               A string value determining the characters used in History  sub‐
3157               stitution  (q.v.).  The first character of its value is used as
3158               the history substitution character, replacing the default char‐
3159               acter  `!'.   The  second  character  of its value replaces the
3160               character `^' in quick substitutions.
3161
3162       histdup (+)
3163               Controls handling of duplicate entries in the history list.  If
3164               set to `all' only unique history events are entered in the his‐
3165               tory list.  If set to `prev' and the last history event is  the
3166               same  as  the  current command, then the current command is not
3167               entered in the history.  If set to `erase' and the  same  event
3168               is  found  in  the history list, that old event gets erased and
3169               the current one gets inserted.  Note that the `prev' and  `all'
3170               options renumber history events so there are no gaps.
3171
3172       histfile (+)
3173               The  default  location  in  which `history -S' and `history -L'
3174               look for a history file.  If unset, ~/.history is used.   hist‐
3175               file  is  useful  when  sharing the same home directory between
3176               different machines, or when saving separate histories  on  dif‐
3177               ferent  terminals.   Because only ~/.tcshrc is normally sourced
3178               before ~/.history, histfile should be set in  ~/.tcshrc  rather
3179               than ~/.login.
3180
3181       histlit (+)
3182               If  set, builtin and editor commands and the savehist mechanism
3183               use the literal (unexpanded) form of lines in the history list.
3184               See also the toggle-literal-history editor command.
3185
3186       history The  first word indicates the number of history events to save.
3187               The optional second word (+) indicates the format in which his‐
3188               tory  is  printed;  if  not given, `%h\t%T\t%R\n' is used.  The
3189               format sequences are described below  under  prompt;  note  the
3190               variable meaning of `%R'.  Set to `100' by default.
3191
3192       home    Initialized to the home directory of the invoker.  The filename
3193               expansion of `~' refers to this variable.
3194
3195       ignoreeof
3196               If set to the empty string or `0' and the  input  device  is  a
3197               terminal,  the  end-of-file  command  (usually generated by the
3198               user by typing `^D' on an empty line) causes the shell to print
3199               `Use  "exit" to leave tcsh.' instead of exiting.  This prevents
3200               the shell from accidentally being  killed.   Historically  this
3201               setting  exited  after  26  successive  EOF's to avoid infinite
3202               loops.  If set to a number n, the shell ignores n - 1  consecu‐
3203               tive  end-of-files  and exits on the nth.  (+) If unset, `1' is
3204               used, i.e., the shell exits on a single `^D'.
3205
3206       implicitcd (+)
3207               If set, the shell treats a directory name typed as a command as
3208               though  it  were a request to change to that directory.  If set
3209               to verbose, the change of directory is echoed to  the  standard
3210               output.   This  behavior  is inhibited in non-interactive shell
3211               scripts, or for  command  strings  with  more  than  one  word.
3212               Changing directory takes precedence over executing a like-named
3213               command, but it is done after alias substitutions.   Tilde  and
3214               variable expansions work as expected.
3215
3216       inputmode (+)
3217               If  set  to  `insert' or `overwrite', puts the editor into that
3218               input mode at the beginning of each line.
3219
3220       killdup (+)
3221               Controls handling of duplicate entries in the  kill  ring.   If
3222               set  to `all' only unique strings are entered in the kill ring.
3223               If set to `prev' and the last killed string is the same as  the
3224               current  killed  string, then the current string is not entered
3225               in the ring.  If set to `erase' and the same string is found in
3226               the  kill ring, the old string is erased and the current one is
3227               inserted.
3228
3229       killring (+)
3230               Indicates the number of killed strings to keep in memory.   Set
3231               to  `30'  by  default.   If  unset or set to less than `2', the
3232               shell will only keep the most recently killed string.   Strings
3233               are  put  in  the  killring  by the editor commands that delete
3234               (kill) strings of text, e.g.  backward-delete-word,  kill-line,
3235               etc, as well as the copy-region-as-kill command.  The yank edi‐
3236               tor command will yank the most recently killed string into  the
3237               command-line,  while yank-pop (see Editor commands) can be used
3238               to yank earlier killed strings.
3239
3240       listflags (+)
3241               If set to `x', `a' or `A', or any  combination  thereof  (e.g.,
3242               `xA'),  they  are used as flags to ls-F, making it act like `ls
3243               -xF', `ls -Fa', `ls -FA' or a combination  (e.g.,  `ls  -FxA'):
3244               `a'  shows all files (even if they start with a `.'), `A' shows
3245               all files but `.' and `..', and `x'  sorts  across  instead  of
3246               down.   If  the  second word of listflags is set, it is used as
3247               the path to `ls(1)'.
3248
3249       listjobs (+)
3250               If set, all jobs are listed when a job is suspended.  If set to
3251               `long', the listing is in long format.
3252
3253       listlinks (+)
3254               If  set,  the  ls-F  builtin  command shows the type of file to
3255               which each symbolic link points.
3256
3257       listmax (+)
3258               The maximum number of items which the list-choices editor  com‐
3259               mand will list without asking first.
3260
3261       listmaxrows (+)
3262               The maximum number of rows of items which the list-choices edi‐
3263               tor command will list without asking first.
3264
3265       loginsh (+)
3266               Set by the shell if it is a login shell.  Setting or  unsetting
3267               it within a shell has no effect.  See also shlvl.
3268
3269       logout (+)
3270               Set  by  the  shell  to `normal' before a normal logout, `auto‐
3271               matic' before an automatic logout, and `hangup'  if  the  shell
3272               was  killed by a hangup signal (see Signal handling).  See also
3273               the autologout shell variable.
3274
3275       mail    The names of the files or directories  to  check  for  incoming
3276               mail,  separated  by  whitespace,  and optionally preceded by a
3277               numeric word.  Before each prompt, if 10  minutes  have  passed
3278               since  the last check, the shell checks each file and says `You
3279               have new mail.' (or, if mail contains multiple files, `You have
3280               new  mail  in  name.')  if the filesize is greater than zero in
3281               size and has a modification time greater than its access time.
3282
3283               If you are in a login shell, then  no  mail  file  is  reported
3284               unless  it  has  been  modified  after  the  time the shell has
3285               started up, to prevent  redundant  notifications.   Most  login
3286               programs  will  tell  you whether or not you have mail when you
3287               log in.
3288
3289               If a file specified in mail is  a  directory,  the  shell  will
3290               count  each  file  within that directory as a separate message,
3291               and will report `You have n mails.' or `You  have  n  mails  in
3292               name.'  as appropriate.  This functionality is provided primar‐
3293               ily for those systems which store mail in this manner, such  as
3294               the Andrew Mail System.
3295
3296               If the first word of mail is numeric it is taken as a different
3297               mail checking interval, in seconds.
3298
3299               Under very rare circumstances, the shell may report  `You  have
3300               mail.' instead of `You have new mail.'
3301
3302       matchbeep (+)
3303               If   set  to  `never',  completion  never  beeps.   If  set  to
3304               `nomatch', it beeps only when there is no  match.   If  set  to
3305               `ambiguous',  it beeps when there are multiple matches.  If set
3306               to `notunique', it beeps when there  is  one  exact  and  other
3307               longer matches.  If unset, `ambiguous' is used.
3308
3309       nobeep (+)
3310               If set, beeping is completely disabled.  See also visiblebell.
3311
3312       noclobber
3313               If set, restrictions are placed on output redirection to insure
3314               that files are not accidentally destroyed and that  `>>'  redi‐
3315               rections   refer   to  existing  files,  as  described  in  the
3316               Input/output section.
3317
3318       noding  If set, disable the printing of  `DING!'  in  the  prompt  time
3319               specifiers at the change of hour.
3320
3321       noglob  If  set, Filename substitution and Directory stack substitution
3322               (q.v.) are inhibited.  This is most  useful  in  shell  scripts
3323               which  do not deal with filenames, or after a list of filenames
3324               has been obtained and further expansions are not desirable.
3325
3326       nokanji (+)
3327               If set and the shell supports  Kanji  (see  the  version  shell
3328               variable), it is disabled so that the meta key can be used.
3329
3330       nonomatch
3331               If set, a Filename substitution or Directory stack substitution
3332               (q.v.)  which  does  not  match  any  existing  files  is  left
3333               untouched  rather  than causing an error.  It is still an error
3334               for the substitution to be  malformed,  e.g.,  `echo  ['  still
3335               gives an error.
3336
3337       nostat (+)
3338               A  list  of  directories (or glob-patterns which match directo‐
3339               ries; see Filename substitution) that should not  be  stat(2)ed
3340               during a completion operation.  This is usually used to exclude
3341               directories which take too much time to  stat(2),  for  example
3342               /afs.
3343
3344       notify  If  set,  the  shell  announces job completions asynchronously.
3345               The default is to present job completions just before  printing
3346               a prompt.
3347
3348       oid (+) The user's real organization ID.  (Domain/OS only)
3349
3350       owd (+) The old working directory, equivalent to the `-' used by cd and
3351               pushd.  See also the cwd and dirstack shell variables.
3352
3353       padhour If set, enable the printing of padding '0' for hours, in 24 and
3354               12 hour formats.  E.G.: 07:45:42 vs. 7:45:42
3355
3356       path    A list of directories in which to look for executable commands.
3357               A null word specifies the current directory.  If  there  is  no
3358               path  variable then only full path names will execute.  path is
3359               set by the shell at startup from the PATH environment  variable
3360               or, if PATH does not exist, to a system-dependent default some‐
3361               thing like `(/usr/local/bin /usr/bsd /bin  /usr/bin  .)'.   The
3362               shell  may  put  `.'  first or last in path or omit it entirely
3363               depending on how it was compiled; see the version  shell  vari‐
3364               able.   A shell which is given neither the -c nor the -t option
3365               hashes the contents of the directories in  path  after  reading
3366               ~/.tcshrc  and each time path is reset.  If one adds a new com‐
3367               mand to a directory in path while the shell is active, one  may
3368               need to do a rehash for the shell to find it.
3369
3370       printexitvalue (+)
3371               If set and an interactive program exits with a non-zero status,
3372               the shell prints `Exit status'.
3373
3374       prompt  The string which is printed before reading  each  command  from
3375               the  terminal.  prompt may include any of the following format‐
3376               ting sequences (+), which are replaced by  the  given  informa‐
3377               tion:
3378
3379               %/  The current working directory.
3380               %~  The  current  working directory, but with one's home direc‐
3381                   tory represented by `~' and other users'  home  directories
3382                   represented   by  `~user'  as  per  Filename  substitution.
3383                   `~user' substitution happens only if the shell has  already
3384                   used `~user' in a pathname in the current session.
3385               %c[[0]n], %.[[0]n]
3386                   The trailing component of the current working directory, or
3387                   n trailing components if a digit n is given.  If  n  begins
3388                   with  `0',  the  number  of  skipped components precede the
3389                   trailing component(s) in the  format  `/<skipped>trailing'.
3390                   If  the  ellipsis shell variable is set, skipped components
3391                   are  represented  by  an  ellipsis  so  the  whole  becomes
3392                   `...trailing'.   `~' substitution is done as in `%~' above,
3393                   but the `~' component is  ignored  when  counting  trailing
3394                   components.
3395               %C  Like %c, but without `~' substitution.
3396               %h, %!, !
3397                   The current history event number.
3398               %M  The full hostname.
3399               %m  The hostname up to the first `.'.
3400               %S (%s)
3401                   Start (stop) standout mode.
3402               %B (%b)
3403                   Start (stop) boldfacing mode.
3404               %U (%u)
3405                   Start (stop) underline mode.
3406               %t, %@
3407                   The time of day in 12-hour AM/PM format.
3408               %T  Like  `%t',  but  in 24-hour format (but see the ampm shell
3409                   variable).
3410               %p  The `precise' time of day in  12-hour  AM/PM  format,  with
3411                   seconds.
3412               %P  Like  `%p',  but  in 24-hour format (but see the ampm shell
3413                   variable).
3414               \c  c is parsed as in bindkey.
3415               ^c  c is parsed as in bindkey.
3416               %%  A single `%'.
3417               %n  The user name.
3418               %j  The number of jobs.
3419               %d  The weekday in `Day' format.
3420               %D  The day in `dd' format.
3421               %w  The month in `Mon' format.
3422               %W  The month in `mm' format.
3423               %y  The year in `yy' format.
3424               %Y  The year in `yyyy' format.
3425               %l  The shell's tty.
3426               %L  Clears from the end of the prompt to end of the display  or
3427                   the end of the line.
3428               %$  Expands  the shell or environment variable name immediately
3429                   after the `$'.
3430               %#  `>' (or the first character of the promptchars shell  vari‐
3431                   able)  for  normal  users,  `#' (or the second character of
3432                   promptchars) for the superuser.
3433               %{string%}
3434                   Includes string as a literal escape sequence.  It should be
3435                   used only to change terminal attributes and should not move
3436                   the cursor location.  This cannot be the last  sequence  in
3437                   prompt.
3438               %?  The  return  code  of  the command executed just before the
3439                   prompt.
3440               %R  In prompt2, the status of the parser.  In prompt3, the cor‐
3441                   rected string.  In history, the history string.
3442
3443               `%B',  `%S', `%U' and `%{string%}' are available in only eight-
3444               bit-clean shells; see the version shell variable.
3445
3446               The bold, standout and underline sequences are  often  used  to
3447               distinguish a superuser shell.  For example,
3448
3449                   > set prompt = "%m [%h] %B[%@]%b [%/] you rang? "
3450                   tut [37] [2:54pm] [/usr/accts/sys] you rang? _
3451
3452               If  `%t',  `%@', `%T', `%p', or `%P' is used, and noding is not
3453               set, then print `DING!' on the change of hour (i.e, `:00'  min‐
3454               utes) instead of the actual time.
3455
3456               Set by default to `%# ' in interactive shells.
3457
3458       prompt2 (+)
3459               The  string with which to prompt in while and foreach loops and
3460               after lines ending in `\'.  The same format  sequences  may  be
3461               used  as  in  prompt (q.v.); note the variable meaning of `%R'.
3462               Set by default to `%R? ' in interactive shells.
3463
3464       prompt3 (+)
3465               The string with  which  to  prompt  when  confirming  automatic
3466               spelling  correction.  The same format sequences may be used as
3467               in prompt (q.v.); note the variable meaning of  `%R'.   Set  by
3468               default to `CORRECT>%R (y|n|e|a)? ' in interactive shells.
3469
3470       promptchars (+)
3471               If  set  (to  a  two-character  string),  the  `%#'  formatting
3472               sequence in the prompt shell  variable  is  replaced  with  the
3473               first  character  for normal users and the second character for
3474               the superuser.
3475
3476       pushdtohome (+)
3477               If set, pushd without arguments does `pushd ~', like cd.
3478
3479       pushdsilent (+)
3480               If set, pushd and popd do not print the directory stack.
3481
3482       recexact (+)
3483               If set, completion completes on an exact match even if a longer
3484               match is possible.
3485
3486       recognize_only_executables (+)
3487               If  set,  command  listing displays only files in the path that
3488               are executable.  Slow.
3489
3490       rmstar (+)
3491               If set, the user is prompted before `rm *' is executed.
3492
3493       rprompt (+)
3494               The string to print on the right-hand side of the screen (after
3495               the  command  input)  when the prompt is being displayed on the
3496               left.  It recognizes the same formatting characters as  prompt.
3497               It  will  automatically disappear and reappear as necessary, to
3498               ensure that command input isn't obscured, and will appear  only
3499               if  the  prompt, command input, and itself will fit together on
3500               the first line.  If  edit  isn't  set,  then  rprompt  will  be
3501               printed after the prompt and before the command input.
3502
3503       savedirs (+)
3504               If  set, the shell does `dirs -S' before exiting.  If the first
3505               word is set to a number, at  most  that  many  directory  stack
3506               entries are saved.
3507
3508       savehist
3509               If  set,  the  shell  does `history -S' before exiting.  If the
3510               first word is set to a number, at  most  that  many  lines  are
3511               saved.  (The number must be less than or equal to history.)  If
3512               the second word is set to `merge', the history list  is  merged
3513               with  the  existing  history  file  instead of replacing it (if
3514               there is one) and sorted by time  stamp  and  the  most  recent
3515               events are retained.  (+)
3516
3517       sched (+)
3518               The  format in which the sched builtin command prints scheduled
3519               events; if not  given,  `%h\t%T\t%R\n'  is  used.   The  format
3520               sequences  are  described above under prompt; note the variable
3521               meaning of `%R'.
3522
3523       shell   The file in which the shell resides.  This is used  in  forking
3524               shells  to  interpret  files  which  have execute bits set, but
3525               which are not executable by the system.  (See  the  description
3526               of  Builtin and non-builtin command execution.)  Initialized to
3527               the (system-dependent) home of the shell.
3528
3529       shlvl (+)
3530               The number of nested shells.  Reset to 1 in login shells.   See
3531               also loginsh.
3532
3533       status  The  status  returned  by  the  last command.  If it terminated
3534               abnormally, then 0200 is added to the status.  Builtin commands
3535               which  fail  return exit status `1', all other builtin commands
3536               return status `0'.
3537
3538       symlinks (+)
3539               Can be set to several different values to control symbolic link
3540               (`symlink') resolution:
3541
3542               If  set to `chase', whenever the current directory changes to a
3543               directory containing a symbolic link, it  is  expanded  to  the
3544               real name of the directory to which the link points.  This does
3545               not work for the user's home directory; this is a bug.
3546
3547               If set to `ignore', the shell  tries  to  construct  a  current
3548               directory relative to the current directory before the link was
3549               crossed.  This means that cding through  a  symbolic  link  and
3550               then  `cd  ..'ing  returns one to the original directory.  This
3551               affects only builtin commands and filename completion.
3552
3553               If set to `expand', the shell tries to fix  symbolic  links  by
3554               actually  expanding arguments which look like path names.  This
3555               affects any command, not just  builtins.   Unfortunately,  this
3556               does  not  work  for hard-to-recognize filenames, such as those
3557               embedded in command options.  Expansion  may  be  prevented  by
3558               quoting.  While this setting is usually the most convenient, it
3559               is sometimes misleading and sometimes confusing when  it  fails
3560               to  recognize  an argument which should be expanded.  A compro‐
3561               mise is to use `ignore' and use the editor  command  normalize-
3562               path (bound by default to ^X-n) when necessary.
3563
3564               Some  examples  are  in  order.   First, let's set up some play
3565               directories:
3566
3567                   > cd /tmp
3568                   > mkdir from from/src to
3569                   > ln -s from/src to/dst
3570
3571               Here's the behavior with symlinks unset,
3572
3573                   > cd /tmp/to/dst; echo $cwd
3574                   /tmp/to/dst
3575                   > cd ..; echo $cwd
3576                   /tmp/from
3577
3578               here's the behavior with symlinks set to `chase',
3579
3580                   > cd /tmp/to/dst; echo $cwd
3581                   /tmp/from/src
3582                   > cd ..; echo $cwd
3583                   /tmp/from
3584
3585               here's the behavior with symlinks set to `ignore',
3586
3587                   > cd /tmp/to/dst; echo $cwd
3588                   /tmp/to/dst
3589                   > cd ..; echo $cwd
3590                   /tmp/to
3591
3592               and here's the behavior with symlinks set to `expand'.
3593
3594                   > cd /tmp/to/dst; echo $cwd
3595                   /tmp/to/dst
3596                   > cd ..; echo $cwd
3597                   /tmp/to
3598                   > cd /tmp/to/dst; echo $cwd
3599                   /tmp/to/dst
3600                   > cd ".."; echo $cwd
3601                   /tmp/from
3602                   > /bin/echo ..
3603                   /tmp/to
3604                   > /bin/echo ".."
3605                   ..
3606
3607               Note that `expand' expansion 1) works just  like  `ignore'  for
3608               builtins  like  cd,  2) is prevented by quoting, and 3) happens
3609               before filenames are passed to non-builtin commands.
3610
3611       tcsh (+)
3612               The version number of the shell in the format `R.VV.PP',  where
3613               `R'  is  the major release number, `VV' the current version and
3614               `PP' the patchlevel.
3615
3616       term    The terminal type.  Usually set in ~/.login as described  under
3617               Startup and shutdown.
3618
3619       time    If set to a number, then the time builtin (q.v.) executes auto‐
3620               matically after each command which takes more  than  that  many
3621               CPU seconds.  If there is a second word, it is used as a format
3622               string for the output of the time builtin.  (u)  The  following
3623               sequences may be used in the format string:
3624
3625               %U  The time the process spent in user mode in cpu seconds.
3626               %S  The time the process spent in kernel mode in cpu seconds.
3627               %E  The elapsed (wall clock) time in seconds.
3628               %P  The CPU percentage computed as (%U + %S) / %E.
3629               %W  Number of times the process was swapped.
3630               %X  The average amount in (shared) text space used in Kbytes.
3631               %D  The  average  amount in (unshared) data/stack space used in
3632                   Kbytes.
3633               %K  The total space used (%X + %D) in Kbytes.
3634               %M  The maximum memory the process had in use at  any  time  in
3635                   Kbytes.
3636               %F  The  number of major page faults (page needed to be brought
3637                   from disk).
3638               %R  The number of minor page faults.
3639               %I  The number of input operations.
3640               %O  The number of output operations.
3641               %r  The number of socket messages received.
3642               %s  The number of socket messages sent.
3643               %k  The number of signals received.
3644               %w  The number of voluntary context switches (waits).
3645               %c  The number of involuntary context switches.
3646
3647               Only the first four sequences are supported on systems  without
3648               BSD  resource limit functions.  The default time format is `%Uu
3649               %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww'  for  systems  that  support
3650               resource  usage  reporting and `%Uu %Ss %E %P' for systems that
3651               do not.
3652
3653               Under Sequent's DYNIX/ptx, %X, %D, %K, %r and %s are not avail‐
3654               able, but the following additional sequences are:
3655
3656               %Y  The number of system calls performed.
3657               %Z  The number of pages which are zero-filled on demand.
3658               %i  The  number  of  times  a  process's  resident set size was
3659                   increased by the kernel.
3660               %d  The number of times  a  process's  resident  set  size  was
3661                   decreased by the kernel.
3662               %l  The number of read system calls performed.
3663               %m  The number of write system calls performed.
3664               %p  The number of reads from raw disk devices.
3665               %q  The number of writes to raw disk devices.
3666
3667               and  the  default  time  format  is  `%Uu  %Ss  %E  %P  %I+%Oio
3668               %Fpf+%Ww'.  Note that the CPU percentage  can  be  higher  than
3669               100% on multi-processors.
3670
3671       tperiod (+)
3672               The period, in minutes, between executions of the periodic spe‐
3673               cial alias.
3674
3675       tty (+) The name of the tty, or empty if not attached to one.
3676
3677       uid (+) The user's real user ID.
3678
3679       user    The user's login name.
3680
3681       verbose If set, causes the words of each command to be  printed,  after
3682               history  substitution  (if  any).   Set  by the -v command line
3683               option.
3684
3685       version (+)
3686               The version ID stamp.  It contains the shell's  version  number
3687               (see  tcsh), origin, release date, vendor, operating system and
3688               machine (see VENDOR, OSTYPE and MACHTYPE) and a comma-separated
3689               list  of options which were set at compile time.  Options which
3690               are set by default in the distribution are noted.
3691
3692               8b    The shell is eight bit clean; default
3693               7b    The shell is not eight bit clean
3694               wide  The shell is multibyte encoding clean (like UTF-8)
3695               nls   The system's NLS is used; default for systems with NLS
3696               lf    Login shells execute  /etc/csh.login  before  instead  of
3697                     after /etc/csh.cshrc and ~/.login before instead of after
3698                     ~/.tcshrc and ~/.history.
3699               dl    `.' is put last in path for security; default
3700               nd    `.' is omitted from path for security
3701               vi    vi-style editing is the default rather than emacs
3702               dtr   Login shells drop DTR when exiting
3703               bye   bye is a synonym for logout and log is an alternate  name
3704                     for watchlog
3705               al    autologout is enabled; default
3706               kan   Kanji  is  used  if  appropriate according to locale set‐
3707                     tings, unless the nokanji shell variable is set
3708               sm    The system's malloc(3) is used
3709               hb    The `#!<program> <args>' convention is emulated when exe‐
3710                     cuting shell scripts
3711               ng    The newgrp builtin is available
3712               rh    The  shell  attempts  to  set  the REMOTEHOST environment
3713                     variable
3714               afs   The shell verifies your password with the kerberos server
3715                     if  local  authentication fails.  The afsuser shell vari‐
3716                     able or the AFSUSER environment  variable  override  your
3717                     local username if set.
3718
3719               An  administrator may enter additional strings to indicate dif‐
3720               ferences in the local version.
3721
3722       visiblebell (+)
3723               If set, a screen flash is used rather than  the  audible  bell.
3724               See also nobeep.
3725
3726       watch (+)
3727               A  list of user/terminal pairs to watch for logins and logouts.
3728               If either the user is `any' all terminals are watched  for  the
3729               given  user  and  vice  versa.   Setting  watch  to `(any any)'
3730               watches all users and terminals.  For example,
3731
3732                   set watch = (george ttyd1 any console $user any)
3733
3734               reports activity of the user `george' on ttyd1, any user on the
3735               console, and oneself (or a trespasser) on any terminal.
3736
3737               Logins and logouts are checked every 10 minutes by default, but
3738               the first word of watch can be set to a number to  check  every
3739               so many minutes.  For example,
3740
3741                   set watch = (1 any any)
3742
3743               reports any login/logout once every minute.  For the impatient,
3744               the log builtin command triggers a watch report  at  any  time.
3745               All  current logins are reported (as with the log builtin) when
3746               watch is first set.
3747
3748               The who shell variable controls the format of watch reports.
3749
3750       who (+) The format string for watch messages.  The following  sequences
3751               are replaced by the given information:
3752
3753               %n  The name of the user who logged in/out.
3754               %a  The  observed  action,  i.e.,  `logged on', `logged off' or
3755                   `replaced olduser on'.
3756               %l  The terminal (tty) on which the user logged in/out.
3757               %M  The full hostname of the remote host,  or  `local'  if  the
3758                   login/logout was from the local host.
3759               %m  The  hostname  of the remote host up to the first `.'.  The
3760                   full name is printed if it is an IP address or an X  Window
3761                   System display.
3762
3763               %M  and  %m are available on only systems that store the remote
3764               hostname in /etc/utmp.  If unset, `%n has %a %l  from  %m.'  is
3765               used,  or  `%n  has  %a  %l.'  on systems which don't store the
3766               remote hostname.
3767
3768       wordchars (+)
3769               A list of non-alphanumeric characters to be considered part  of
3770               a  word  by  the  forward-word, backward-word etc., editor com‐
3771               mands.  If unset, `*?_-.[]~=' is used.
3772

ENVIRONMENT

3774       AFSUSER (+)
3775               Equivalent to the afsuser shell variable.
3776
3777       COLUMNS The number of columns in the terminal.   See  Terminal  manage‐
3778               ment.
3779
3780       DISPLAY Used by X Window System (see X(1)).  If set, the shell does not
3781               set autologout (q.v.).
3782
3783       EDITOR  The pathname to a default editor.  See also the VISUAL environ‐
3784               ment variable and the run-fg-editor editor command.
3785
3786       GROUP (+)
3787               Equivalent to the group shell variable.
3788
3789       HOME    Equivalent to the home shell variable.
3790
3791       HOST (+)
3792               Initialized  to  the  name of the machine on which the shell is
3793               running, as determined by the gethostname(2) system call.
3794
3795       HOSTTYPE (+)
3796               Initialized to the type of machine on which the shell  is  run‐
3797               ning, as determined at compile time.  This variable is obsolete
3798               and will be removed in a future version.
3799
3800       HPATH (+)
3801               A colon-separated list of directories  in  which  the  run-help
3802               editor command looks for command documentation.
3803
3804       LANG    Gives the preferred character environment.  See Native Language
3805               System support.
3806
3807       LC_CTYPE
3808               If set, only ctype character handling is changed.   See  Native
3809               Language System support.
3810
3811       LINES   The number of lines in the terminal.  See Terminal management.
3812
3813       LS_COLORS
3814               The  format  of  this variable is reminiscent of the termcap(5)
3815               file format; a colon-separated list of expressions of the  form
3816               "xx=string",  where "xx" is a two-character variable name.  The
3817               variables with their associated defaults are:
3818
3819                   no   0      Normal (non-filename) text
3820                   fi   0      Regular file
3821                   di   01;34  Directory
3822                   ln   01;36  Symbolic link
3823                   pi   33     Named pipe (FIFO)
3824                   so   01;35  Socket
3825                   do   01;35  Door
3826                   bd   01;33  Block device
3827                   cd   01;32  Character device
3828                   ex   01;32  Executable file
3829                   mi   (none) Missing file (defaults to fi)
3830                   or   (none) Orphaned symbolic link (defaults to ln)
3831                   lc   ^[[    Left code
3832                   rc   m      Right code
3833                   ec   (none) End code (replaces lc+no+rc)
3834
3835               You need to include only the variables you want to change  from
3836               the default.
3837
3838               File  names  can also be colorized based on filename extension.
3839               This is specified in the LS_COLORS variable  using  the  syntax
3840               "*ext=string".  For example, using ISO 6429 codes, to color all
3841               C-language source files blue you would specify "*.c=34".   This
3842               would color all files ending in .c in blue (34) color.
3843
3844               Control  characters  can  be  written either in C-style-escaped
3845               notation, or in stty-like  ^-notation.   The  C-style  notation
3846               adds  ^[  for Escape, _ for a normal space character, and ? for
3847               Delete.  In addition, the ^[ escape character can  be  used  to
3848               override the default interpretation of ^[, ^, : and =.
3849
3850               Each  file will be written as <lc> <color-code> <rc> <filename>
3851               <ec>.  If the <ec> code is undefined, the  sequence  <lc>  <no>
3852               <rc>  will  be used instead.  This is generally more convenient
3853               to use, but less general.  The left, right and  end  codes  are
3854               provided  so  you don't have to type common parts over and over
3855               again and to support weird terminals; you  will  generally  not
3856               need  to  change  them at all unless your terminal does not use
3857               ISO 6429 color sequences but a different system.
3858
3859               If your terminal does use ISO 6429 color codes, you can compose
3860               the type codes (i.e., all except the lc, rc, and ec codes) from
3861               numerical commands separated by semicolons.   The  most  common
3862               commands are:
3863
3864                       0   to restore default color
3865                       1   for brighter colors
3866                       4   for underlined text
3867                       5   for flashing text
3868                       30  for black foreground
3869                       31  for red foreground
3870                       32  for green foreground
3871                       33  for yellow (or brown) foreground
3872                       34  for blue foreground
3873                       35  for purple foreground
3874                       36  for cyan foreground
3875                       37  for white (or gray) foreground
3876                       40  for black background
3877                       41  for red background
3878                       42  for green background
3879                       43  for yellow (or brown) background
3880                       44  for blue background
3881                       45  for purple background
3882                       46  for cyan background
3883                       47  for white (or gray) background
3884
3885               Not all commands will work on all systems or display devices.
3886
3887               A  few  terminal programs do not recognize the default end code
3888               properly.  If all text gets colorized after you do a  directory
3889               listing, try changing the no and fi codes from 0 to the numeri‐
3890               cal codes for your standard fore- and background colors.
3891
3892       MACHTYPE (+)
3893               The machine type (microprocessor class or  machine  model),  as
3894               determined at compile time.
3895
3896       NOREBIND (+)
3897               If  set,  printable  characters are not rebound to self-insert-
3898               command.  See Native Language System support.
3899
3900       OSTYPE (+)
3901               The operating system, as determined at compile time.
3902
3903       PATH    A colon-separated list of directories in which to look for exe‐
3904               cutables.  Equivalent to the path shell variable, but in a dif‐
3905               ferent format.
3906
3907       PWD (+) Equivalent to the cwd shell variable, but not  synchronized  to
3908               it; updated only after an actual directory change.
3909
3910       REMOTEHOST (+)
3911               The host from which the user has logged in remotely, if this is
3912               the case and the shell is able to determine it.   Set  only  if
3913               the shell was so compiled; see the version shell variable.
3914
3915       SHLVL (+)
3916               Equivalent to the shlvl shell variable.
3917
3918       SYSTYPE (+)
3919               The current system type.  (Domain/OS only)
3920
3921       TERM    Equivalent to the term shell variable.
3922
3923       TERMCAP The terminal capability string.  See Terminal management.
3924
3925       USER    Equivalent to the user shell variable.
3926
3927       VENDOR (+)
3928               The vendor, as determined at compile time.
3929
3930       VISUAL  The  pathname  to  a  default full-screen editor.  See also the
3931               EDITOR environment variable and the run-fg-editor  editor  com‐
3932               mand.
3933

FILES

3935       /etc/csh.cshrc  Read first by every shell.  ConvexOS, Stellix and Intel
3936                       use /etc/cshrc and  NeXTs  use  /etc/cshrc.std.   A/UX,
3937                       AMIX,  Cray  and IRIX have no equivalent in csh(1), but
3938                       read this file in tcsh anyway.  Solaris  2.x  does  not
3939                       have it either, but tcsh reads /etc/.cshrc.  (+)
3940       /etc/csh.login  Read  by  login shells after /etc/csh.cshrc.  ConvexOS,
3941                       Stellix   and   Intel   use   /etc/login,   NeXTs   use
3942                       /etc/login.std,  Solaris 2.x uses /etc/.login and A/UX,
3943                       AMIX, Cray and IRIX use /etc/cshrc.
3944       ~/.tcshrc (+)   Read by every shell after /etc/csh.cshrc or its equiva‐
3945                       lent.
3946       ~/.cshrc        Read  by every shell, if ~/.tcshrc doesn't exist, after
3947                       /etc/csh.cshrc or its  equivalent.   This  manual  uses
3948                       `~/.tcshrc'  to mean `~/.tcshrc or, if ~/.tcshrc is not
3949                       found, ~/.cshrc'.
3950       ~/.history      Read by login shells after  ~/.tcshrc  if  savehist  is
3951                       set, but see also histfile.
3952       ~/.login        Read  by  login  shells  after ~/.tcshrc or ~/.history.
3953                       The shell may  be  compiled  to  read  ~/.login  before
3954                       instead of after ~/.tcshrc and ~/.history; see the ver‐
3955                       sion shell variable.
3956       ~/.cshdirs (+)  Read by login shells after ~/.login if savedirs is set,
3957                       but see also dirsfile.
3958       /etc/csh.logout Read  by login shells at logout.  ConvexOS, Stellix and
3959                       Intel use /etc/logout and  NeXTs  use  /etc/logout.std.
3960                       A/UX, AMIX, Cray and IRIX have no equivalent in csh(1),
3961                       but read this file in tcsh anyway.   Solaris  2.x  does
3962                       not have it either, but tcsh reads /etc/.logout.  (+)
3963       ~/.logout       Read by login shells at logout after /etc/csh.logout or
3964                       its equivalent.
3965       /bin/sh         Used to interpret shell scripts  not  starting  with  a
3966                       `#'.
3967       /tmp/sh*        Temporary file for `<<'.
3968       /etc/passwd     Source of home directories for `~name' substitutions.
3969
3970       The  order  in which startup files are read may differ if the shell was
3971       so compiled; see Startup and shutdown and the version shell variable.
3972

NEW FEATURES (+)

3974       This manual describes tcsh as a single entity, but  experienced  csh(1)
3975       users will want to pay special attention to tcsh's new features.
3976
3977       A  command-line  editor,  which  supports  GNU Emacs or vi(1)-style key
3978       bindings.  See The command-line editor and Editor commands.
3979
3980       Programmable, interactive word completion and listing.  See  Completion
3981       and listing and the complete and uncomplete builtin commands.
3982
3983       Spelling correction (q.v.) of filenames, commands and variables.
3984
3985       Editor commands (q.v.) which perform other useful functions in the mid‐
3986       dle of typed commands, including documentation lookup (run-help), quick
3987       editor  restarting  (run-fg-editor)  and command resolution (which-com‐
3988       mand).
3989
3990       An enhanced history mechanism.  Events in the history  list  are  time-
3991       stamped.   See  also the history command and its associated shell vari‐
3992       ables, the previously undocumented `#' event specifier  and  new  modi‐
3993       fiers  under  History substitution, the *-history, history-search-*, i-
3994       search-*, vi-search-* and toggle-literal-history  editor  commands  and
3995       the histlit shell variable.
3996
3997       Enhanced  directory  parsing and directory stack handling.  See the cd,
3998       pushd, popd and dirs commands and their associated shell variables, the
3999       description of Directory stack substitution, the dirstack, owd and sym‐
4000       links shell variables and the normalize-command and normalize-path edi‐
4001       tor commands.
4002
4003       Negation in glob-patterns.  See Filename substitution.
4004
4005       New  File  inquiry  operators  (q.v.) and a filetest builtin which uses
4006       them.
4007
4008       A variety of Automatic, periodic  and  timed  events  (q.v.)  including
4009       scheduled  events, special aliases, automatic logout and terminal lock‐
4010       ing, command timing and watching for logins and logouts.
4011
4012       Support for the Native Language System (see Native Language System sup‐
4013       port),  OS  variant features (see OS variant support and the echo_style
4014       shell variable) and system-dependent file locations (see FILES).
4015
4016       Extensive terminal-management capabilities.  See Terminal management.
4017
4018       New builtin commands including builtins, hup, ls-F,  newgrp,  printenv,
4019       which and where (q.v.).
4020
4021       New  variables  that  make  useful  information easily available to the
4022       shell.  See the gid, loginsh, oid, shlvl, tcsh, tty,  uid  and  version
4023       shell  variables  and the HOST, REMOTEHOST, VENDOR, OSTYPE and MACHTYPE
4024       environment variables.
4025
4026       A new syntax for including useful information in the prompt string (see
4027       prompt).   and  special  prompts for loops and spelling correction (see
4028       prompt2 and prompt3).
4029
4030       Read-only variables.  See Variable substitution.
4031

BUGS

4033       When a suspended command is restarted, the shell prints  the  directory
4034       it  started  in  if this is different from the current directory.  This
4035       can be misleading (i.e., wrong) as the job may have changed directories
4036       internally.
4037
4038       Shell   builtin   functions  are  not  stoppable/restartable.   Command
4039       sequences of the form `a ; b ; c' are also not handled gracefully  when
4040       stopping is attempted.  If you suspend `b', the shell will then immedi‐
4041       ately execute `c'.  This is especially  noticeable  if  this  expansion
4042       results  from  an alias.  It suffices to place the sequence of commands
4043       in ()'s to force it to a subshell, i.e., `( a ; b ; c )'.
4044
4045       Control over tty output after processes are started is primitive;  per‐
4046       haps  this  will  inspire  someone  to  work on a good virtual terminal
4047       interface.  In a  virtual  terminal  interface  much  more  interesting
4048       things could be done with output control.
4049
4050       Alias substitution is most often used to clumsily simulate shell proce‐
4051       dures; shell procedures should be provided rather than aliases.
4052
4053       Commands within loops are not placed  in  the  history  list.   Control
4054       structures  should  be  parsed rather than being recognized as built-in
4055       commands.  This would allow control commands to be placed anywhere,  to
4056       be combined with `|', and to be used with `&' and `;' metasyntax.
4057
4058       foreach doesn't ignore here documents when looking for its end.
4059
4060       It should be possible to use the `:' modifiers on the output of command
4061       substitutions.
4062
4063       The screen update for lines longer than the screen width is  very  poor
4064       if the terminal cannot move the cursor up (i.e., terminal type `dumb').
4065
4066       HPATH and NOREBIND don't need to be environment variables.
4067
4068       Glob-patterns  which  do  not use `?', `*' or `[]' or which use `{}' or
4069       `~' are not negated correctly.
4070
4071       The single-command form of if  does  output  redirection  even  if  the
4072       expression is false and the command is not executed.
4073
4074       ls-F includes file identification characters when sorting filenames and
4075       does not handle control characters in filenames  well.   It  cannot  be
4076       interrupted.
4077
4078       Command substitution supports multiple commands and conditions, but not
4079       cycles or backward gotos.
4080
4081       Report bugs at http://bugs.gw.com/, preferably with fixes.  If you want
4082       to  help  maintain  and  test tcsh, send mail to tcsh-request@mx.gw.com
4083       with the text `subscribe tcsh' on a line by itself in the body.
4084

THE T IN TCSH

4086       In 1964, DEC produced the PDP-6.  The PDP-10 was a later re-implementa‐
4087       tion.   It  was  re-christened  the DECsystem-10 in 1970 or so when DEC
4088       brought out the second model, the KI10.
4089
4090       TENEX was created at Bolt, Beranek & Newman (a Cambridge, Massachusetts
4091       think  tank)  in  1972  as an experiment in demand-paged virtual memory
4092       operating systems.  They built a new pager for the DEC PDP-10 and  cre‐
4093       ated the OS to go with it.  It was extremely successful in academia.
4094
4095       In  1975,  DEC  brought  out  a new model of the PDP-10, the KL10; they
4096       intended to have only a version of TENEX, which they had licensed  from
4097       BBN,  for  the new box.  They called their version TOPS-20 (their capi‐
4098       talization is trademarked).  A lot of  TOPS-10  users  (`The  OPerating
4099       System  for PDP-10') objected; thus DEC found themselves supporting two
4100       incompatible systems on the same hardware--but then there were 6 on the
4101       PDP-11!
4102
4103       TENEX,  and  TOPS-20  to  version 3, had command completion via a user-
4104       code-level subroutine library called ULTCMD.  With version 3, DEC moved
4105       all  that  capability  and more into the monitor (`kernel' for you Unix
4106       types), accessed by the COMND% JSYS (`Jump to SYStem' instruction,  the
4107       supervisor call mechanism [are my IBM roots also showing?]).
4108
4109       The creator of tcsh was impressed by this feature and several others of
4110       TENEX and TOPS-20, and created a version of csh which mimicked them.
4111

LIMITATIONS

4113       The system limits argument lists to ARG_MAX characters.
4114
4115       The number of arguments to a command which involves filename  expansion
4116       is  limited  to  1/6th  the number of characters allowed in an argument
4117       list.
4118
4119       Command substitutions  may  substitute  no  more  characters  than  are
4120       allowed in an argument list.
4121
4122       To  detect  looping,  the shell restricts the number of alias substitu‐
4123       tions on a single line to 20.
4124

SEE ALSO

4126       csh(1), emacs(1), ls(1), newgrp(1), sh(1), setpath(1), stty(1),  su(1),
4127       tset(1),   vi(1),   x(1),  access(2),  execve(2),  fork(2),  killpg(2),
4128       pipe(2), setrlimit(2), sigvec(2), stat(2), umask(2), vfork(2), wait(2),
4129       malloc(3),  setlocale(3),  tty(4),  a.out(5),  termcap(5),  environ(7),
4130       termio(7), Introduction to the C Shell
4131

VERSION

4133       This manual documents tcsh 6.17.00 (Astron) 2009-07-10.
4134

AUTHORS

4136       William Joy
4137         Original author of csh(1)
4138       J.E. Kulp, IIASA, Laxenburg, Austria
4139         Job control and directory stack features
4140       Ken Greer, HP Labs, 1981
4141         File name completion
4142       Mike Ellis, Fairchild, 1983
4143         Command name recognition/completion
4144       Paul Placeway, Ohio State CIS Dept., 1983-1993
4145         Command line editor, prompt routines, new glob  syntax  and  numerous
4146         fixes and speedups
4147       Karl Kleinpaste, CCI 1983-4
4148         Special  aliases,  directory  stack  extraction  stuff,  login/logout
4149         watch, scheduled events, and the idea of the new prompt format
4150       Rayan Zachariassen, University of Toronto, 1984
4151         ls-F and which builtins and numerous  bug  fixes,  modifications  and
4152         speedups
4153       Chris Kingsley, Caltech
4154         Fast storage allocator routines
4155       Chris Grevstad, TRW, 1987
4156         Incorporated 4.3BSD csh into tcsh
4157       Christos S. Zoulas, Cornell U. EE Dept., 1987-94
4158         Ports   to   HPUX,   SVR2  and  SVR3,  a  SysV  version  of  getwd.c,
4159         SHORT_STRINGS support and a new version of sh.glob.c
4160       James J Dempsey, BBN, and Paul Placeway, OSU, 1988
4161         A/UX port
4162       Daniel Long, NNSC, 1988
4163         wordchars
4164       Patrick Wolfe, Kuck and Associates, Inc., 1988
4165         vi mode cleanup
4166       David C Lawrence, Rensselaer Polytechnic Institute, 1989
4167         autolist and ambiguous completion listing
4168       Alec Wolman, DEC, 1989
4169         Newlines in the prompt
4170       Matt Landau, BBN, 1989
4171         ~/.tcshrc
4172       Ray Moody, Purdue Physics, 1989
4173         Magic space bar history expansion
4174       Mordechai ????, Intel, 1989
4175         printprompt() fixes and additions
4176       Kazuhiro Honda, Dept. of Computer Science, Keio University, 1989
4177         Automatic spelling correction and prompt3
4178       Per Hedeland, Ellemtel, Sweden, 1990-
4179         Various bugfixes, improvements and manual updates
4180       Hans J. Albertsson (Sun Sweden)
4181         ampm, settc and telltc
4182       Michael Bloom
4183         Interrupt handling fixes
4184       Michael Fine, Digital Equipment Corp
4185         Extended key support
4186       Eric Schnoebelen, Convex, 1990
4187         Convex support, lots of csh bug fixes, save and restore of  directory
4188         stack
4189       Ron Flax, Apple, 1990
4190         A/UX 2.0 (re)port
4191       Dan Oscarsson, LTH Sweden, 1990
4192         NLS support and simulated NLS support for non NLS sites, fixes
4193       Johan Widen, SICS Sweden, 1990
4194         shlvl, Mach support, correct-line, 8-bit printing
4195       Matt Day, Sanyo Icon, 1990
4196         POSIX termio support, SysV limit fixes
4197       Jaap Vermeulen, Sequent, 1990-91
4198         Vi mode fixes, expand-line, window change fixes, Symmetry port
4199       Martin Boyer, Institut de recherche d'Hydro-Quebec, 1991
4200         autolist  beeping  options, modified the history search to search for
4201         the whole string from the beginning of the line to the cursor.
4202       Scott Krotz, Motorola, 1991
4203         Minix port
4204       David Dawes, Sydney U. Australia, Physics Dept., 1991
4205         SVR4 job control fixes
4206       Jose Sousa, Interactive Systems Corp., 1991
4207         Extended vi fixes and vi delete command
4208       Marc Horowitz, MIT, 1991
4209         ANSIfication fixes, new exec hashing code, imake fixes, where
4210       Bruce Sterling Woodcock, sterling@netcom.com, 1991-1995
4211         ETA and Pyramid port, Makefile and lint fixes, ignoreeof=n  addition,
4212         and various other portability changes and bug fixes
4213       Jeff Fink, 1992
4214         complete-word-fwd and complete-word-back
4215       Harry C. Pulley, 1992
4216         Coherent port
4217       Andy Phillips, Mullard Space Science Lab U.K., 1992
4218         VMS-POSIX port
4219       Beto Appleton, IBM Corp., 1992
4220         Walking  process  group fixes, csh bug fixes, POSIX file tests, POSIX
4221         SIGHUP
4222       Scott Bolte, Cray Computer Corp., 1992
4223         CSOS port
4224       Kaveh R. Ghazi, Rutgers University, 1992
4225         Tek, m88k, Titan and Masscomp ports and fixes.  Added  autoconf  sup‐
4226         port.
4227       Mark Linderman, Cornell University, 1992
4228         OS/2 port
4229       Mika Liljeberg, liljeber@kruuna.Helsinki.FI, 1992
4230         Linux port
4231       Tim P. Starrin, NASA Langley Research Center Operations, 1993
4232         Read-only variables
4233       Dave Schweisguth, Yale University, 1993-4
4234         New man page and tcsh.man2html
4235       Larry Schwimmer, Stanford University, 1993
4236         AFS and HESIOD patches
4237       Luke Mewburn, RMIT University, 1994-6
4238         Enhanced directory printing in prompt, added ellipsis and rprompt.
4239       Edward Hutchins, Silicon Graphics Inc., 1996
4240         Added implicit cd.
4241       Martin Kraemer, 1997
4242         Ported to Siemens Nixdorf EBCDIC machine
4243       Amol Deshpande, Microsoft, 1997
4244         Ported  to  WIN32  (Windows/95 and Windows/NT); wrote all the missing
4245         library and message catalog code to interface to Windows.
4246       Taga Nayuta, 1998
4247         Color ls additions.
4248

THANKS TO

4250       Bryan Dunlap, Clayton Elwell, Karl Kleinpaste, Bob Manson, Steve Romig,
4251       Diana  Smetters, Bob Sutterfield, Mark Verber, Elizabeth Zwicky and all
4252       the other people at Ohio State for suggestions and encouragement
4253
4254       All the people on the net, for putting up with, reporting bugs in,  and
4255       suggesting new additions to each and every version
4256
4257       Richard M. Alderson III, for writing the `T in tcsh' section
4258
4259
4260
4261Astron 6.17.00                   10 July 2009                          TCSH(1)
Impressum