


TCSH(1)                                                   TCSH(1)


NNAAMMEE
       tcsh  - C shell with file name completion and command line
       editing

SSYYNNOOPPSSIISS
       ttccsshh [--bbccddeeffFFiimmnnqqssttvvVVxxXX] [--DDnnaammee[==vvaalluuee]] [arg ...]
       ttccsshh --ll

DDEESSCCRRIIPPTTIIOONN
       _t_c_s_h is an enhanced but completely compatible  version  of
       the  Berkeley  UNIX C shell, _c_s_h(1).  It is a command lan-
       guage interpreter usable  both  as  an  interactive  login
       shell and a shell script command processor.  It includes a
       command-line editor (see TThhee  ccoommmmaanndd--lliinnee  eeddiittoorr),  pro-
       grammable  word  completion  (see CCoommpplleettiioonn aanndd lliissttiinngg),
       spelling correction (see SSppeelllliinngg ccoorrrreeccttiioonn),  a  history
       mechanism  (see  HHiissttoorryy  ssuubbssttiittuuttiioonn),  job control (see
       JJoobbss) and a  C-like  syntax.   The  NNEEWW  FFEEAATTUURREESS  section
       describes   major   enhancements   of  _t_c_s_h  over  _c_s_h(1).
       Throughout this manual, features of _t_c_s_h not found in most
       _c_s_h(1)  implementations (specifically, the 4.4BSD _c_s_h) are
       labeled with `(+)', and  features  which  are  present  in
       _c_s_h(1)  but not usually documented are labeled with `(u)'.

   AArrgguummeenntt lliisstt pprroocceessssiinngg
       If the first argument (argument 0) to  the  shell  is  `-'
       then it is a login shell.  A login shell can be also spec-
       ified by invoking the shell with the --ll flag as  the  only
       argument.

       The rest of the flag arguments are interpreted as follows:

       --bb  Forces a ``break'' from option processing, causing any
           further  shell  arguments  to be treated as non-option
           arguments.  The remaining arguments will not be inter-
           preted  as  shell  options.   This may be used to pass
           options to a shell script without confusion or  possi-
           ble  subterfuge.  The shell will not run a set-user ID
           script without this option.

       --cc  Commands are read from the following  argument  (which
           must  be  present,  and  must  be  a single argument),
           stored in the ccoommmmaanndd shell  variable  for  reference,
           and  executed.   Any remaining arguments are placed in
           the aarrggvv shell variable.

       --dd  The shell loads the directory stack from _~_/_._c_s_h_d_i_r_s as
           described  under  SSttaarrttuupp aanndd sshhuuttddoowwnn, whether or not
           it is a login shell. (+)

       --DD_n_a_m_e[=_v_a_l_u_e]
           Sets  the  environment   variable   _n_a_m_e   to   _v_a_l_u_e.
           (Domain/OS only) (+)




Cornell 6.06.00           29 April 1995                         1





TCSH(1)                                                   TCSH(1)


       --ee  The  shell  exits  if  any  invoked command terminates
           abnormally or yields a non-zero exit status.

       --ff  The shell ignores _~_/_._t_c_s_h_r_c, and thus starts faster.

       --FF  The shell uses _f_o_r_k(2) instead of  _v_f_o_r_k(2)  to  spawn
           processes. (Convex/OS only) (+)

       --ii  The shell is interactive and prompts for its top-level
           input, even if  it  appears  to  not  be  a  terminal.
           Shells  are  interactive  without this option if their
           inputs and outputs are terminals.

       --ll  The shell is a login shell. Only applicable if  --ll  is
           the only flag specified.

       --mm  The  shell  loads _~_/_._t_c_s_h_r_c even if it does not belong
           to the effective user. Newer  versions  of  _s_u(1)  can
           pass --mm to the shell. (+)

       --nn  The  shell  parses commands but does not execute them.
           This aids in debugging shell scripts.

       --qq  The shell accepts SIGQUIT (see  SSiiggnnaall  hhaannddlliinngg)  and
           behaves  when it is used under a debugger. Job control
           is disabled. (u)

       --ss  Command input is taken from the standard input.

       --tt  The shell reads and executes a single line  of  input.
           A  `\' may be used to escape the newline at the end of
           this line and continue onto another line.

       --vv  Sets the vveerrbboossee shell variable, so that command input
           is echoed after history substitution.

       --xx  Sets  the  eecchhoo  shell  variable, so that commands are
           echoed immediately before execution.

       --VV  Sets the vveerrbboossee shell variable even before  executing
           _~_/_._t_c_s_h_r_c.

       --XX  Is to --xx as --VV is to --vv.

       After  processing  of  flag arguments, if arguments remain
       but none of the --cc, --ii, --ss, or --tt options were given,  the
       first argument is taken as the name of a file of commands,
       or ``script'', to be executed.  The shell opens this  file
       and  saves  its  name for possible resubstitution by `$0'.
       Since many systems use either the standard  version  6  or
       version  7  shells  whose shell scripts are not compatible
       with this shell, the shell uses such a `standard' shell to
       execute  a script whose first character is not a `#', i.e.
       which does not start with a comment.



Cornell 6.06.00           29 April 1995                         2





TCSH(1)                                                   TCSH(1)


       Remaining arguments are placed in the aarrggvv shell variable.

   SSttaarrttuupp aanndd sshhuuttddoowwnn
       A login shell begins by executing commands from the system
       files _/_e_t_c_/_c_s_h_._c_s_h_r_c and _/_e_t_c_/_c_s_h_._l_o_g_i_n.  It then executes
       commands  from  files  in the user's hhoommee directory: first
       _~_/_._t_c_s_h_r_c (+) or, if _~_/_._t_c_s_h_r_c  is  not  found,  _~_/_._c_s_h_r_c,
       then  _~_/_._h_i_s_t_o_r_y (or the value of the hhiissttffiillee shell vari-
       able), then _~_/_._l_o_g_i_n, and finally _~_/_._c_s_h_d_i_r_s (or the value
       of  the  ddiirrssffiillee shell variable) (+).  The shell may read
       _/_e_t_c_/_c_s_h_._l_o_g_i_n before instead of after _/_e_t_c_/_c_s_h_._c_s_h_r_c, and
       _~_/_._l_o_g_i_n before instead of after _~_/_._t_c_s_h_r_c or _~_/_._c_s_h_r_c and
       _~_/_._h_i_s_t_o_r_y, if so compiled; see the  vveerrssiioonn  shell  vari-
       able. (+)

       Non-login shells read only _/_e_t_c_/_c_s_h_._c_s_h_r_c and _~_/_._t_c_s_h_r_c or
       _~_/_._c_s_h_r_c on startup.

       Commands like _s_t_t_y(1) and _t_s_e_t(1), which need be run  only
       once  per login, usually go in one's _~_/_._l_o_g_i_n file.  Users
       who need to use the same set of files with both _c_s_h(1) and
       _t_c_s_h  can  have only a _~_/_._c_s_h_r_c which checks for the exis-
       tence of the ttccsshh shell variable (q.v.) before using _t_c_s_h-
       specific  commands,  or  can  have  both  a _~_/_._c_s_h_r_c and a
       _~_/_._t_c_s_h_r_c  which  _s_o_u_r_c_es  (see   the   builtin   command)
       _~_/_._c_s_h_r_c.   The  rest  of  this manual uses `_~_/_._t_c_s_h_r_c' to
       mean `_~_/_._t_c_s_h_r_c or, if _~_/_._t_c_s_h_r_c is not found,  _~_/_._c_s_h_r_c'.

       In the normal case, the shell begins reading commands from
       the terminal, prompting with `> '.  (Processing  of  argu-
       ments and the use of the shell to process files containing
       command scripts are described later.)  The  shell  repeat-
       edly  reads a line of command input, breaks it into words,
       places it on the command history list, parses it and  exe-
       cutes each command in the line.

       One  can log out by typing `^D' on an empty line, `logout'
       or `login' or via the shell's  autologout  mechanism  (see
       the aauuttoollooggoouutt shell variable).  When a login shell termi-
       nates it sets the llooggoouutt shell  variable  to  `normal'  or
       `automatic'  as  appropriate,  then executes commands from
       the files _/_e_t_c_/_c_s_h_._l_o_g_o_u_t and  _~_/_._l_o_g_o_u_t.  The  shell  may
       drop  DTR  on logout if so compiled; see the vveerrssiioonn shell
       variable.

       The names of the system login and logout files  vary  from
       system  to  system for compatibility with different _c_s_h(1)
       variants; see FFIILLEESS.

   EEddiittiinngg
       We first describe TThhee ccoommmmaanndd--lliinnee eeddiittoorr.  The CCoommpplleettiioonn
       aanndd  lliissttiinngg and SSppeelllliinngg ccoorrrreeccttiioonn sections describe two
       sets of functionality which are implemented as editor com-
       mands  but  which  deserve  their own treatment.  Finally,



Cornell 6.06.00           29 April 1995                         3





TCSH(1)                                                   TCSH(1)


       EEddiittoorr ccoommmmaannddss lists and describes  the  editor  commands
       specific to the shell and their default bindings.

   TThhee ccoommmmaanndd--lliinnee eeddiittoorr ((++))
       Command-line  input can be edited using key sequences much
       like those used in GNU Emacs  or  _v_i(1).   The  editor  is
       active  only when the eeddiitt shell variable is set, which it
       is by default in interactive shells.  The _b_i_n_d_k_e_y  builtin
       can  display  and  change  key  bindings.  Emacs-style key
       bindings are used by default (unless the  shell  was  com-
       piled  otherwise;  see  the  vveerrssiioonn  shell variable), but
       _b_i_n_d_k_e_y can change the key bindings to  _v_i-style  bindings
       en masse.

       The  shell  always binds the arrow keys (as defined in the
       TTEERRMMCCAAPP environment variable) to

           down    _d_o_w_n_-_h_i_s_t_o_r_y
           up      _u_p_-_h_i_s_t_o_r_y
           left    _b_a_c_k_w_a_r_d_-_c_h_a_r
           right   _f_o_r_w_a_r_d_-_c_h_a_r

       unless doing so would alter another single-character bind-
       ing.   One  can  set the arrow key escape sequences to the
       empty string with _s_e_t_t_c to prevent  these  bindings.   The
       ANSI/VT100 sequences for arrow keys are always bound.

       Other  key bindings are, for the most part, what Emacs and
       _v_i(1) users would expect and can easily  be  displayed  by
       _b_i_n_d_k_e_y,  so there is no need to list them here. Likewise,
       _b_i_n_d_k_e_y can list the editor commands with a short descrip-
       tion of each.

       Note that editor commands do not have the same notion of a
       ``word'' as does the shell. The editor delimits words with
       any  non-alphanumeric characters not in the shell variable
       wwoorrddcchhaarrss, while the shell recognizes only whitespace  and
       some of the characters with special meanings to it, listed
       under LLeexxiiccaall ssttrruuccttuurree.

   CCoommpplleettiioonn aanndd lliissttiinngg ((++))
       The shell is often able to complete  words  when  given  a
       unique abbreviation.  Type part of a word (for example `ls
       /usr/lost') and hit the tab key to run  the  _c_o_m_p_l_e_t_e_-_w_o_r_d
       editor   command.    The   shell  completes  the  filename
       `/usr/lost' to `/usr/lost+found/',  replacing  the  incom-
       plete  word  with  the  complete word in the input buffer.
       (Note the terminal `/'; completion adds a `/' to  the  end
       of  completed  directories and a space to the end of other
       completed words, to speed  typing  and  provide  a  visual
       indicator  of  successful completion.  The aaddddssuuffffiixx shell
       variable can be unset to prevent this.)  If  no  match  is
       found  (perhaps `/usr/lost+found' doesn't exist), the ter-
       minal  bell  rings.   If  the  word  is  already  complete



Cornell 6.06.00           29 April 1995                         4





TCSH(1)                                                   TCSH(1)


       (perhaps there is a `/usr/lost' on your system, or perhaps
       you were thinking too far ahead and typed the whole thing)
       a  `/'  or  space  is added to the end if it isn't already
       there.

       Completion works anywhere in the line,  not  just  at  the
       end;  completed  text  pushes  the rest of the line to the
       right. Completion in the middle of a word often results in
       leftover  characters to the right of the cursor which need
       to be deleted.

       Commands and variables can be completed in much  the  same
       way.  For example, typing `em[tab]' would complete `em' to
       `emacs' if _e_m_a_c_s were the  only  command  on  your  system
       beginning with `em'.  Completion can find a command in any
       directory in ppaatthh or if given  a  full  pathname.   Typing
       `echo  $ar[tab]'  would  complete  `$ar'  to `$argv' if no
       other variable began with `ar'.

       The shell parses the input buffer to determine whether the
       word  you  want to complete should be completed as a file-
       name, command or variable.  The first word in  the  buffer
       and  the first word following `;', `|', `|&', `&&' or `||'
       is considered to be a command.  A word beginning with  `$'
       is  considered to be a variable.  Anything else is a file-
       name. An empty line is `completed' as a filename.

       You can list the possible completions of  a  word  at  any
       time  by typing `^D' to run the _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-_l_i_s_t_-_o_r_-_e_o_f
       editor command.  The shell lists the possible  completions
       using the _l_s_-_F builtin (q.v.)  and reprints the prompt and
       unfinished command line, for example:

           > ls /usr/l[^D]
           lbin/       lib/        local/      lost+found/
           > ls /usr/l

       If the aauuttoolliisstt shell variable is set, the shell lists the
       remaining choices (if any) whenever completion fails:

           > set autolist
           > nm /usr/lib/libt[tab]
           libtermcap.a@ libtermlib.a@
           > nm /usr/lib/libterm

       If aauuttoolliisstt is set to `ambiguous', choices are listed only
       when completion fails and adds no new  characters  to  the
       word being completed.

       A filename to be completed can contain variables, your own
       or others' home  directories  abbreviated  with  `~'  (see
       FFiilleennaammee  ssuubbssttiittuuttiioonn) and directory stack entries abbre-
       viated with `=' (see DDiirreeccttoorryy  ssttaacckk  ssuubbssttiittuuttiioonn).  For
       example,



Cornell 6.06.00           29 April 1995                         5





TCSH(1)                                                   TCSH(1)


           > ls ~k[^D]
           kahn    kas     kellogg
           > ls ~ke[tab]
           > ls ~kellogg/

       or

           > set local = /usr/local
           > ls $lo[tab]
           > ls $local/[^D]
           bin/ etc/ lib/ man/ src/
           > ls $local/

       Note  that  variables can also be expanded explicitly with
       the _e_x_p_a_n_d_-_v_a_r_i_a_b_l_e_s editor command.

       _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-_l_i_s_t_-_o_r_-_e_o_f only lists at the  end  of  the
       line;  in  the  middle  of a line it deletes the character
       under the cursor and on an empty line it logs one out  or,
       if  iiggnnoorreeeeooff  is set, does nothing.  `M-^D', bound to the
       editor command _l_i_s_t_-_c_h_o_i_c_e_s, lists  completion  possibili-
       ties  anywhere  on a line, and _l_i_s_t_-_c_h_o_i_c_e_s (or any one of
       the related editor commands which do or don't delete, list
       and/or  log  out, listed under _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-_l_i_s_t_-_o_r_-_e_o_f)
       can be bound to `^D' with the _b_i_n_d_k_e_y builtin  command  if
       so desired.

       The  _c_o_m_p_l_e_t_e_-_w_o_r_d_-_f_w_d  and _c_o_m_p_l_e_t_e_-_w_o_r_d_-_b_a_c_k editor com-
       mands (not bound to any keys by default) can  be  used  to
       cycle  up  and  down  through the list of possible comple-
       tions, replacing the current word with the next or  previ-
       ous word in the list.

       The  shell  variable  ffiiggnnoorree can be set to a list of suf-
       fixes to be ignored by completion. Consider the following:

           > ls
           Makefile        condiments.h~   main.o          side.c
           README          main.c          meal            side.o
           condiments.h    main.c~
           > set fignore = (.o \~)
           > emacs ma[^D]
           main.c   main.c~  main.o
           > emacs ma[tab]
           > emacs main.c

       `main.c~'  and `main.o' are ignored by completion (but not
       listing), because they end in suffixes in  ffiiggnnoorree.   Note
       that  a  `\' was needed in front of `~' to prevent it from
       being expanded to hhoommee as described under FFiilleennaammee ssuubbssttii--
       ttuuttiioonn.  ffiiggnnoorree is ignored if only one completion is pos-
       sible.

       If the  ccoommpplleettee  shell  variable  is  set  to  `enhance',



Cornell 6.06.00           29 April 1995                         6





TCSH(1)                                                   TCSH(1)


       completion  1)  ignores  case  and  2)  considers periods,
       hyphens and underscores (`.', `-' and `_') to be word sep-
       arators  and  hyphens and underscores to be equivalent. If
       you had the following files

           comp.lang.c      comp.lang.perl   comp.std.c++
           comp.lang.c++    comp.std.c

       and typed `mail -f c.l.c[tab]', it would be  completed  to
       `mail -f comp.lang.c', and ^D would list `comp.lang.c' and
       `comp.lang.c++'.   `mail   -f   c..c++[^D]'   would   list
       `comp.lang.c++'    and    `comp.std.c++'.    Typing    `rm
       a--file[^D]' in the following directory

           A_silly_file                         a-hyphenated-file
           another_silly_file

       would  list  all  three files, because case is ignored and
       hyphens and underscores are equivalent. Periods,  however,
       are not equivalent to hyphens or underscores.

       Completion and listing are affected by several other shell
       variables: rreecceexxaacctt can be set to complete on the shortest
       possible unique match, even if more typing might result in
       a longer match:

           > ls
           fodder   foo      food     foonly
           > set recexact
           > rm fo[tab]

       just beeps, because `fo' could expand to `fod'  or  `foo',
       but if we type another `o',

           > rm foo[tab]
           > rm foo

       the  completion completes on `foo', even though `food' and
       `foonly' also match.  aauuttooeexxppaanndd can be  set  to  run  the
       _e_x_p_a_n_d_-_h_i_s_t_o_r_y   editor  command  before  each  completion
       attempt, aauuttooccoorrrreecctt can be set  to  spelling-correct  the
       word to be completed (see SSppeelllliinngg ccoorrrreeccttiioonn) before each
       completion attempt and ccoorrrreecctt can be set to complete com-
       mands  automatically  after  one hits `return'.  mmaattcchhbbeeeepp
       can be set to make completion beep or not beep in a  vari-
       ety  of situations, and nnoobbeeeepp can be set to never beep at
       all.  nnoossttaatt can be set to a list  of  directories  and/or
       patterns which match directories to prevent the completion
       mechanism from _s_t_a_t(2)ing those directories.  lliissttmmaaxx  and
       lliissttmmaaxxrroowwss  can  be  set to limit the number of items and
       rows (respectively) that are listed without asking  first.
       rreeccooggnniizzee__oonnllyy__eexxeeccuuttaabblleess  can  be  set to make the shell
       list only executables when listing  commands,  but  it  is
       quite slow.



Cornell 6.06.00           29 April 1995                         7





TCSH(1)                                                   TCSH(1)


       Finally,  the _c_o_m_p_l_e_t_e builtin command can be used to tell
       the shell how to complete words other than filenames, com-
       mands  and  variables.  Completion and listing do not work
       on glob-patterns  (see  FFiilleennaammee  ssuubbssttiittuuttiioonn),  but  the
       _l_i_s_t_-_g_l_o_b  and _e_x_p_a_n_d_-_g_l_o_b editor commands perform equiva-
       lent functions for glob-patterns.

   SSppeelllliinngg ccoorrrreeccttiioonn ((++))
       The shell can sometimes correct the spelling of filenames,
       commands  and  variable  names  as  well as completing and
       listing them.

       Individual words can be spelling-corrected with the _s_p_e_l_l_-
       _w_o_r_d editor command (usually bound to M-s and M-S) and the
       entire input buffer  with  _s_p_e_l_l_-_l_i_n_e  (usually  bound  to
       M-$).   The  ccoorrrreecctt shell variable can be set to `cmd' to
       correct the command name or `all' to  correct  the  entire
       line each time return is typed, and aauuttooccoorrrreecctt can be set
       to correct the word to be completed before each completion
       attempt.

       When  spelling  correction is invoked in any of these ways
       and the shell thinks that any part of the command line  is
       misspelled, it prompts with the corrected line:

           > set correct = cmd
           > lz /usr/bin
           CORRECT>ls /usr/bin (y|n|e|a)?

       One can answer `y' or space to execute the corrected line,
       `e' to leave the uncorrected command in the input  buffer,
       `a' to abort the command as if `^C' had been hit, and any-
       thing else to execute the original line unchanged.

       Spelling correction  recognizes  user-defined  completions
       (see  the _c_o_m_p_l_e_t_e builtin command). If an input word in a
       position for which a completion  is  defined  resembles  a
       word in the completion list, spelling correction registers
       a misspelling and suggests the latter word  as  a  correc-
       tion. However, if the input word does not match any of the
       possible completions for that position,  spelling  correc-
       tion does not register a misspelling.

       Like completion, spelling correction works anywhere in the
       line, pushing the rest of the line to the right and possi-
       bly leaving extra characters to the right of the cursor.

       Beware:  spelling correction is not guaranteed to work the
       way one intends, and is provided mostly as an experimental
       feature.  Suggestions and improvements are welcome.

   EEddiittoorr ccoommmmaannddss ((++))
       `bindkey'  lists  key  bindings and `bindkey -l' lists and
       briefly describes editor commands.  Only new or especially



Cornell 6.06.00           29 April 1995                         8





TCSH(1)                                                   TCSH(1)


       interesting  editor  commands  are  described  here.   See
       _e_m_a_c_s(1) and _v_i(1) for descriptions of each  editor's  key
       bindings.

       The character or characters to which each command is bound
       by default is given in parentheses. `^_c_h_a_r_a_c_t_e_r'  means  a
       control  character  and  `M-_c_h_a_r_a_c_t_e_r'  a  meta character,
       typed as escape-_c_h_a_r_a_c_t_e_r on terminals without a meta key.
       Case  counts,  but  commands which are bound to letters by
       default are bound to both lower- and uppercase letters for
       convenience.

       ccoommpplleettee--wwoorrdd (tab)
               Completes a word as described under CCoommpplleettiioonn aanndd
               lliissttiinngg.

       ccoommpplleettee--wwoorrdd--bbaacckk (not bound)
               Like _c_o_m_p_l_e_t_e_-_w_o_r_d_-_f_w_d, but steps up from the  end
               of the list.

       ccoommpplleettee--wwoorrdd--ffwwdd (not bound)
               Replaces  the  current word with the first word in
               the list of possible completions. May be  repeated
               to  step down through the list.  At the end of the
               list, beeps and reverts to the incomplete word.

       ccoommpplleettee--wwoorrdd--rraaww (^X-tab)
               Like _c_o_m_p_l_e_t_e_-_w_o_r_d, but ignores user-defined  com-
               pletions.

       ccooppyy--pprreevv--wwoorrdd (M-^_)
               Copies  the previous word in the current line into
               the input buffer.  See also _i_n_s_e_r_t_-_l_a_s_t_-_w_o_r_d.

       ddaabbbbrreevv--eexxppaanndd (M-/)
               Expands the current word to the most  recent  pre-
               ceding one for which the current is a leading sub-
               string, wrapping around the history list (once) if
               necessary.   Repeating  _d_a_b_b_r_e_v_-_e_x_p_a_n_d without any
               intervening typing changes to  the  next  previous
               word  etc.,  skipping  identical matches much like
               _h_i_s_t_o_r_y_-_s_e_a_r_c_h_-_b_a_c_k_w_a_r_d does.

       ddeelleettee--cchhaarr (not bound)
               Deletes the character under the cursor.  See  also
               _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-_l_i_s_t_-_o_r_-_e_o_f.

       ddeelleettee--cchhaarr--oorr--eeooff (not bound)
               Does _d_e_l_e_t_e_-_c_h_a_r if there is a character under the
               cursor or _e_n_d_-_o_f_-_f_i_l_e on an empty line.  See  also
               _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-_l_i_s_t_-_o_r_-_e_o_f.

       ddeelleettee--cchhaarr--oorr--lliisstt (not bound)
               Does _d_e_l_e_t_e_-_c_h_a_r if there is a character under the



Cornell 6.06.00           29 April 1995                         9





TCSH(1)                                                   TCSH(1)


               cursor or _l_i_s_t_-_c_h_o_i_c_e_s at the  end  of  the  line.
               See also _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-_l_i_s_t_-_o_r_-_e_o_f.

       ddeelleettee--cchhaarr--oorr--lliisstt--oorr--eeooff (^D)
               Does _d_e_l_e_t_e_-_c_h_a_r if there is a character under the
               cursor, _l_i_s_t_-_c_h_o_i_c_e_s at the end  of  the  line  or
               _e_n_d_-_o_f_-_f_i_l_e  on  an  empty  line.   See also those
               three commands, each of which only does  a  single
               action,  and  _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-_e_o_f,  _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-
               _l_i_s_t and _l_i_s_t_-_o_r_-_e_o_f, each of which does a differ-
               ent two out of the three.

       ddoowwnn--hhiissttoorryy (down-arrow, ^N)
               Like  _u_p_-_h_i_s_t_o_r_y,  but steps down, stopping at the
               original input line.

       eenndd--ooff--ffiillee (not bound)
               Signals an end of file, causing the shell to  exit
               unless  the iiggnnoorreeeeooff shell variable (q.v.) is set
               to prevent this.  See also _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-_l_i_s_t_-_o_r_-
               _e_o_f.

       eexxppaanndd--hhiissttoorryy (M-space)
               Expands history substitutions in the current word.
               See HHiissttoorryy ssuubbssttiittuuttiioonn.  See  also  _m_a_g_i_c_-_s_p_a_c_e,
               _t_o_g_g_l_e_-_l_i_t_e_r_a_l_-_h_i_s_t_o_r_y  and  the  aauuttooeexxppaanndd shell
               variable.

       eexxppaanndd--gglloobb (^X-*)
               Expands the glob-pattern to the left of  the  cur-
               sor.  See FFiilleennaammee ssuubbssttiittuuttiioonn.

       eexxppaanndd--lliinnee (not bound)
               Like _e_x_p_a_n_d_-_h_i_s_t_o_r_y, but expands history substitu-
               tions in each word in the input buffer,

       eexxppaanndd--vvaarriiaabblleess (^X-$)
               Expands the variable to the left  of  the  cursor.
               See VVaarriiaabbllee ssuubbssttiittuuttiioonn.

       hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd (M-p, M-P)
               Searches  backwards through the history list for a
               command beginning with the current contents of the
               input  buffer  up to the cursor and copies it into
               the input buffer.  The  search  string  may  be  a
               glob-pattern  (see FFiilleennaammee ssuubbssttiittuuttiioonn) contain-
               ing `*', `?', `[]' or `{}'.  _u_p_-_h_i_s_t_o_r_y and  _d_o_w_n_-
               _h_i_s_t_o_r_y will proceed from the appropriate point in
               the history list.  Emacs mode only.  See also _h_i_s_-
               _t_o_r_y_-_s_e_a_r_c_h_-_f_o_r_w_a_r_d and _i_-_s_e_a_r_c_h_-_b_a_c_k.

       hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd (M-n, M-N)
               Like  _h_i_s_t_o_r_y_-_s_e_a_r_c_h_-_b_a_c_k_w_a_r_d,  but  searches for-
               ward.



Cornell 6.06.00           29 April 1995                        10





TCSH(1)                                                   TCSH(1)


       ii--sseeaarrcchh--bbaacckk (not bound)
               Searches  backward  like  _h_i_s_t_o_r_y_-_s_e_a_r_c_h_-_b_a_c_k_w_a_r_d,
               copies  the first match into the input buffer with
               the cursor positioned at the end of  the  pattern,
               and  prompts  with  `bck:  '  and the first match.
               Additional characters may be typed to  extend  the
               search,  _i_-_s_e_a_r_c_h_-_b_a_c_k  may  be  typed to continue
               searching with the same pattern,  wrapping  around
               the history list if necessary, (_i_-_s_e_a_r_c_h_-_b_a_c_k must
               be bound to a single character for this  to  work)
               or  one of the following special characters may be
               typed:

                   ^W      Appends the rest of the word under the
                           cursor to the search pattern.
                   delete (or any character bound to _b_a_c_k_w_a_r_d_-
                           _d_e_l_e_t_e_-_c_h_a_r)
                           Undoes the effect of the last  charac-
                           ter typed and deletes a character from
                           the search pattern if appropriate.
                   ^G      If the previous search was successful,
                           aborts  the  entire  search.   If not,
                           goes  back  to  the  last   successful
                           search.
                   escape  Ends  the  search, leaving the current
                           line in the input buffer.

               Any other  character  not  bound  to  _s_e_l_f_-_i_n_s_e_r_t_-
               _c_o_m_m_a_n_d terminates the search, leaving the current
               line in the input buffer, and is then  interpreted
               as  normal input. In particular, a carriage return
               causes the current line  to  be  executed.   Emacs
               mode  only.   See  also  _i_-_s_e_a_r_c_h_-_f_w_d and _h_i_s_t_o_r_y_-
               _s_e_a_r_c_h_-_b_a_c_k_w_a_r_d.

       ii--sseeaarrcchh--ffwwdd (not bound)
               Like _i_-_s_e_a_r_c_h_-_b_a_c_k, but searches forward.

       iinnsseerrtt--llaasstt--wwoorrdd (M-_)
               Inserts the last word of the previous  input  line
               (`!$') into the input buffer.  See also _c_o_p_y_-_p_r_e_v_-
               _w_o_r_d.

       lliisstt--cchhooiicceess (M-^D)
               Lists completion possibilities as described  under
               CCoommpplleettiioonn  aanndd lliissttiinngg.  See also _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-
               _l_i_s_t_-_o_r_-_e_o_f and _l_i_s_t_-_c_h_o_i_c_e_s_-_r_a_w.

       lliisstt--cchhooiicceess--rraaww (^X-^D)
               Like _l_i_s_t_-_c_h_o_i_c_e_s, but ignores  user-defined  com-
               pletions.

       lliisstt--gglloobb (^X-g, ^X-G)
               Lists  (via the _l_s_-_F builtin) matches to the glob-



Cornell 6.06.00           29 April 1995                        11





TCSH(1)                                                   TCSH(1)


               pattern (see FFiilleennaammee ssuubbssttiittuuttiioonn) to the left of
               the cursor.

       lliisstt--oorr--eeooff (not bound)
               Does _l_i_s_t_-_c_h_o_i_c_e_s or _e_n_d_-_o_f_-_f_i_l_e on an empty line.
               See also _d_e_l_e_t_e_-_c_h_a_r_-_o_r_-_l_i_s_t_-_o_r_-_e_o_f.

       mmaaggiicc--ssppaaccee (not bound)
               Expands history substitutions in the current line,
               like  _e_x_p_a_n_d_-_h_i_s_t_o_r_y, and appends a space.  _m_a_g_i_c_-
               _s_p_a_c_e is designed to be bound to the spacebar, but
               is not bound by default.

       nnoorrmmaalliizzee--ccoommmmaanndd (^X-?)
               Searches  for  the current word in PATH and, if it
               is found, replaces it with the full  path  to  the
               executable. Special characters are quoted. Aliases
               are  expanded  and  quoted  but  commands   within
               aliases  are not. This command is useful with com-
               mands which take commands as arguments, e.g. `dbx'
               and `sh -x'.

       nnoorrmmaalliizzee--ppaatthh (^X-n, ^X-N)
               Expands  the  current  word as described under the
               `expand' setting of the ssyymmlliinnkkss shell variable.

       oovveerrwwrriittee--mmooddee (unbound)
               Toggles between input and overwrite modes.

       rruunn--ffgg--eeddiittoorr (M-^Z)
               Saves the current  input  line  and  looks  for  a
               stopped  job  with a name equal to the last compo-
               nent of the file name part of the EEDDIITTOORR or VVIISSUUAALL
               environment variables, or, if neither is set, `ed'
               or `vi'.  If such a job is found, it is  restarted
               as  if  `fg %_j_o_b' had been typed.  This is used to
               toggle back and forth between an  editor  and  the
               shell  easily.   Some  people bind this command to
               `^Z' so they can do this even more easily.

       rruunn--hheellpp (M-h, M-H)
               Searches for documentation on the current command,
               using  the same notion of `current command' as the
               completion routines, and prints it.  There  is  no
               way to use a pager; _r_u_n_-_h_e_l_p is designed for short
               help files.  Documentation should  be  in  a  file
               named  _c_o_m_m_a_n_d.help,  _c_o_m_m_a_n_d.1,  _c_o_m_m_a_n_d.6,  _c_o_m_-
               _m_a_n_d.8 or _c_o_m_m_a_n_d, which should be in one  of  the
               directories  listed  in the HHPPAATTHH enviroment vari-
               able.  If there is more than one  help  file  only
               the first is printed.

       sseellff--iinnsseerrtt--ccoommmmaanndd (text characters)
               In  insert  mode  (the default), inserts the typed



Cornell 6.06.00           29 April 1995                        12





TCSH(1)                                                   TCSH(1)


               character into the input line after the  character
               under the cursor.  In overwrite mode, replaces the
               character under the cursor with the typed  charac-
               ter.  The input mode is normally preserved between
               lines, but the iinnppuuttmmooddee shell variable can be set
               to  `insert'  or  `overwrite' to put the editor in
               that mode at the beginning of each line.  See also
               _o_v_e_r_w_r_i_t_e_-_m_o_d_e.

       sseeqquueennccee--lleeaadd--iinn (arrow prefix, meta prefix, ^X)
               Indicates  that  the following characters are part
               of a multi-key sequence. Binding a  command  to  a
               multi-key  sequence  really  creates two bindings:
               the first character to  _s_e_q_u_e_n_c_e_-_l_e_a_d_-_i_n  and  the
               whole  sequence  to  the  command.  All  sequences
               beginning with a character bound to _s_e_q_u_e_n_c_e_-_l_e_a_d_-
               _i_n  are  effectively bound to _u_n_d_e_f_i_n_e_d_-_k_e_y unless
               bound to another command.

       ssppeellll--lliinnee (M-$)
               Attempts to correct the spelling of each  word  in
               the  input  buffer,  like  _s_p_e_l_l_-_w_o_r_d, but ignores
               words whose first character is one  of  `!',  `.',
               `\',  `^',  `-', `*' or `%' to avoid problems with
               switches,  substitutions  and   the   like.    See
               SSppeelllliinngg ccoorrrreeccttiioonn.

       ssppeellll--wwoorrdd (M-s, M-S)
               Attempts  to  correct  the spelling of the current
               word  as  described  under  SSppeelllliinngg   ccoorrrreeccttiioonn.
               Checks  each  component of a word which appears to
               be a pathname.

       ttooggggllee--lliitteerraall--hhiissttoorryy (M-r, M-R)
               Expands or `unexpands'  history  substitutions  in
               the input buffer.  See also _e_x_p_a_n_d_-_h_i_s_t_o_r_y and the
               aauuttooeexxppaanndd shell variable.

       uunnddeeffiinneedd--kkeeyy (any unbound key)
               Beeps.

       uupp--hhiissttoorryy (up-arrow, ^P)
               Copies the previous entry in the history list into
               the  input  buffer.   If  hhiissttlliitt is set, uses the
               literal form of the entry.   May  be  repeated  to
               step  up through the history list, stopping at the
               top.

       vvii--sseeaarrcchh--bbaacckk (?)
               Prompts with `?' for a search string (which may be
               a  glob-pattern, as with _h_i_s_t_o_r_y_-_s_e_a_r_c_h_-_b_a_c_k_w_a_r_d),
               searches for it  and  copies  it  into  the  input
               buffer. The bell rings if no match is found.  Hit-
               ting return ends the search and  leaves  the  last



Cornell 6.06.00           29 April 1995                        13





TCSH(1)                                                   TCSH(1)


               match  in  the  input buffer.  Hitting escape ends
               the search and executes the match.  _v_i mode  only.

       vvii--sseeaarrcchh--ffwwdd (/)
               Like _v_i_-_s_e_a_r_c_h_-_b_a_c_k, but searches forward.

       wwhhiicchh--ccoommmmaanndd (M-?)
               Does  a  _w_h_i_c_h (see the description of the builtin
               command) on the first word of the input buffer.

   LLeexxiiccaall ssttrruuccttuurree
       The shell splits input lines  into  words  at  blanks  and
       tabs.   The  special  characters  `&', `|', `;', `<', `>',
       `(', and `)' and the doubled characters `&&',  `||',  `<<'
       and  `>>'  are  always separate words, whether or not they
       are surrounded by whitespace.

       When the shell's input is not a  terminal,  the  character
       `#'  is taken to begin a comment. Each `#' and the rest of
       the input line on which it  appears  is  discarded  before
       further parsing.

       A special character (including a blank or tab) may be pre-
       vented from having its special meaning, and possibly  made
       part  of  another  word,  by preceding it with a backslash
       (`\') or enclosing it in single  (`''),  double  (`"')  or
       backward (``') quotes. When not otherwise quoted a newline
       preceded by a `\' is equivalent to  a  blank,  but  inside
       quotes this sequence results in a newline.

       Furthermore,  all SSuubbssttiittuuttiioonnss (see below) except HHiissttoorryy
       ssuubbssttiittuuttiioonn can be prevented by enclosing the strings (or
       parts  of strings) in which they appear with single quotes
       or by quoting the crucial character(s) (e.g.  `$'  or  ``'
       for  VVaarriiaabbllee ssuubbssttiittuuttiioonn or CCoommmmaanndd ssuubbssttiittuuttiioonn respec-
       tively) with `\'. HHiissttoorryy ssuubbssttiittuuttiioonns are quoted in  the
       same way by backslashes but not by single quotes.  Strings
       quoted with double or  backward  quotes  undergo  VVaarriiaabbllee
       ssuubbssttiittuuttiioonn and CCoommmmaanndd ssuubbssttiittuuttiioonn, but other substitu-
       tions are prevented.

       Text inside single or double quotes becomes a single  word
       (or  part  of  one).   Metacharacters  in  these  strings,
       including blanks and tabs, do  not  form  separate  words.
       Only  in one special case (see CCoommmmaanndd ssuubbssttiittuuttiioonn below)
       can a double-quoted string yield parts of  more  than  one
       word;  single-quoted strings never do. Backward quotes are
       special: they signal CCoommmmaanndd  ssuubbssttiittuuttiioonn  (q.v.),  which
       may result in more than one word.

       Quoting  complex strings, particularly strings which them-
       selves  contain  quoting  characters,  can  be  confusing.
       Remember that quotes need not be used as they are in human
       writing! It may be easier to quote not an  entire  string,



Cornell 6.06.00           29 April 1995                        14





TCSH(1)                                                   TCSH(1)


       but  only  those  parts  of the string which need quoting,
       using different types of quoting to do so if  appropriate.

       The  bbaacckkssllaasshh__qquuoottee  shell  variable (q.v.) can be set to
       make backslashes always quote `\', `'', and `"'. (+)  This
       may  make  complex  quoting tasks easier, but it can cause
       syntax errors in _c_s_h(1) scripts.

   SSuubbssttiittuuttiioonnss
       We now describe the various transformations the shell per-
       forms  on  the  input in the order in which they occur. We
       note in passing the data structures involved and the  com-
       mands  and variables which affect them. Remember that sub-
       stitutions can be prevented by quoting as described  under
       LLeexxiiccaall ssttrruuccttuurree.

   HHiissttoorryy ssuubbssttiittuuttiioonn
       Each  command,  or  ``event'',  input from the terminal is
       saved in the history list.  The previous command is always
       saved, and the hhiissttoorryy shell variable can be set to a num-
       ber to save that many commands. The hhiissttdduupp shell variable
       can  be  set  to  not save duplicate events or consecutive
       duplicate events.

       Saved  commands  are  numbered  sequentially  from  1  and
       stamped with the time.  It is not usually necessary to use
       event numbers, but the current event number  can  be  made
       part  of  the prompt by placing an `!' in the pprroommpptt shell
       variable.

       The shell actually saves history in expanded  and  literal
       (unexpanded) forms.  If the hhiissttlliitt shell variable is set,
       commands that display and store history  use  the  literal
       form.

       The  _h_i_s_t_o_r_y  builtin  command can print, store in a file,
       restore and clear the history list at any  time,  and  the
       ssaavveehhiisstt and hhiissttffiillee shell variables can be can be set to
       store the history list automatically on logout and restore
       it on login.

       History  substitutions  introduce  words  from the history
       list into the input stream, making it easy to repeat  com-
       mands,  repeat arguments of a previous command in the cur-
       rent command, or fix spelling  mistakes  in  the  previous
       command  with  little  typing  and a high degree of confi-
       dence.

       History substitutions begin with the character  `!'.  They
       may  begin  anywhere  in the input stream, but they do not
       nest.  The `!' may be preceded by a  `\'  to  prevent  its
       special   meaning;   for  convenience,  a  `!'  is  passed
       unchanged when it is followed by a  blank,  tab,  newline,
       `='  or  `('.   History  substitutions  also occur when an



Cornell 6.06.00           29 April 1995                        15





TCSH(1)                                                   TCSH(1)


       input line begins with  `^'.   This  special  abbreviation
       will  be  described  later.  The characters used to signal
       history substitution (`!' and `^') can be changed by  set-
       ting  the  hhiissttcchhaarrss  shell variable. Any input line which
       contains a history substitution is printed  before  it  is
       executed.

       A  history  substitution  may  have  an ``event specifica-
       tion'', which indicates the event from which words are  to
       be  taken, a ``word designator'', which selects particular
       words from the chosen event, and/or a ``modifier'',  which
       manipulates the selected words.

       An event specification can be

           _n       A number, referring to a particular event
           -_n      An offset, referring to the event _n before the
                   current event
           #       The current event.  This should be used  care-
                   fully  in  _c_s_h(1), where there is no check for
                   recursion. _t_c_s_h allows 10 levels of recursion.
                   (+)
           !       The previous event (equivalent to `-1')
           _s       The  most recent event whose first word begins
                   with the string _s
           ?_s?     The  most  recent  event  which  contains  the
                   string _s.  The second `?' can be omitted if it
                   is immediately followed by a newline.

       For example, consider this bit of someone's history list:

            9  8:30    nroff -man wumpus.man
           10  8:31    cp wumpus.man wumpus.man.old
           11  8:36    vi wumpus.man
           12  8:37    diff wumpus.man.old wumpus.man

       The commands are shown with their event numbers  and  time
       stamps.  The current event, which we haven't typed in yet,
       is event 13.  `!11' and `!-2' refer  to  event  11.   `!!'
       refers  to the previous event, 12. `!!' can be abbreviated
       `!' if it is followed by `:'  (`:'  is  described  below).
       `!n'  refers  to event 9, which begins with `n'.  `!?old?'
       also refers to event 12, which  contains  `old'.   Without
       word  designators  or  modifiers history references simply
       expand to the entire event, so we might type `!cp' to redo
       the  copy  command  or  `!!|more'  if  the  `diff'  output
       scrolled off the top of the screen.

       History references may be insulated from  the  surrounding
       text with braces if necessary.  For example, `!vdoc' would
       look for a command beginning with  `vdoc',  and,  in  this
       example,  not  find  one, but `!{v}doc' would expand unam-
       biguously to `vi wumpus.mandoc'.  Even in braces,  history
       substitutions do not nest.



Cornell 6.06.00           29 April 1995                        16





TCSH(1)                                                   TCSH(1)


       (+)  While  _c_s_h(1)  expands, for example, `!3d' to event 3
       with the letter `d' appended to it, _t_c_s_h expands it to the
       last  event  beginning  with `3d'; only completely numeric
       arguments are treated as event  numbers.   This  makes  it
       possible  to  recall  events  beginning  with numbers.  To
       expand `!3d' as in _c_s_h(1) say `!\3d'.

       To select words from an event  we  can  follow  the  event
       specification  by  a  `:' and a designator for the desired
       words.  The words of an input line are  numbered  from  0,
       the  first (usually command) word being 0, the second word
       (first argument) being 1, etc. The basic word  designators
       are:

           0       The first (command) word
           _n       The _nth argument
           ^       The first argument, equivalent to `1'
           $       The last argument
           %       The word matched by an ?_s? search
           _x_-_y     A range of words
           _-_y      Equivalent to _`_0_-_y_'
           *       Equivalent  to  `^-$',  but returns nothing if
                   the event contains only 1 word
           _x_*      Equivalent to _`_x_-_$_'
           _x_-      Equivalent to _`_x_*_', but omitting the last word
                   (`$')

       Selected  words  are  inserted into the command line sepa-
       rated by single blanks.  For example, the  `diff'  command
       in  the  previous  example  might have been typed as `diff
       !!:1.old !!:1' (using `:1' to select  the  first  argument
       from  the  previous event) or `diff !-2:2 !-2:1' to select
       and swap the arguments from the `cp' command. If we didn't
       care  about  the  order  of  the `diff' we might have said
       `diff !-2:1-2' or simply `diff !-2:*'.  The  `cp'  command
       might  have  been  written `cp wumpus.man !#:1.old', using
       `#' to refer to  the  current  event.   `!n:-  hurkle.man'
       would  reuse  the first two words from the `nroff' command
       to say `nroff -man hurkle.man'.

       The `:' separating the event specification from  the  word
       designator  can be omitted if the argument selector begins
       with a `^', `$', `*', `%' or `-'.  For example, our `diff'
       command  might  have  been  `diff !!^.old !!^' or, equiva-
       lently, `diff !!$.old !!$'. However, if `!!'  is  abbrevi-
       ated  `!', an argument selector beginning with `-' will be
       interpreted as an event specification.

       A history reference may have  a  word  designator  but  no
       event specification.  It then references the previous com-
       mand.  Continuing our `diff' example, we could  have  said
       simply  `diff  !^.old  !^' or, to get the arguments in the
       opposite order, just `diff !*'.




Cornell 6.06.00           29 April 1995                        17





TCSH(1)                                                   TCSH(1)


       The word or words in a history reference can be edited, or
       ``modified'',  by following it with one or more modifiers,
       each preceded by a `:':

           h       Remove a trailing pathname component,  leaving
                   the head.
           t       Remove  all leading pathname components, leav-
                   ing the tail.
           r       Remove a filename  extension  `.xxx',  leaving
                   the root name.
           e       Remove all but the extension.
           u       Uppercase the first lowercase letter.
           l       Lowercase the first uppercase letter.
           s_/_l_/_r_/  Substitute _l for _r.  _l is simply a string like
                   _r, not a regular expression as in  the  epony-
                   mous _e_d(1) command.  Any character may be used
                   as the delimiter in place of `/'; a `\' can be
                   used  to  quote  the delimiter inside _l and _r.
                   The character `&' in the _r is replaced  by  _l;
                   `\'  also  quotes  `&'.  If _l is empty (``''),
                   the _l from a previous substitution  or  the  _s
                   from  a  previous `?_s?' event specification is
                   used.  The trailing delimiter may  be  omitted
                   if it is immediately followed by a newline.
           &       Repeat the previous substitution.
           g       Apply  the  following  modifier  once  to each
                   word.
           a (+)   Apply the following modifier as many times  as
                   possible to a single word.  `a' and `g' can be
                   used together to apply  a  modifier  globally.
                   In  the  current implementation, using the `a'
                   and `s' modifiers  together  can  lead  to  an
                   infinite  loop.  For example, `:as/f/ff/' will
                   never terminate.  This behavior  might  change
                   in the future.
           p       Print  the new command line but do not execute
                   it.
           q       Quote the substituted words,  preventing  fur-
                   ther substitutions.
           x       Like  q,  but break into words at blanks, tabs
                   and newlines.

       Modifiers are applied only to the  first  modifiable  word
       (unless  `g'  is  used).  It is an error for no word to be
       modifiable.

       For example, the `diff' command might have been written as
       `diff  wumpus.man.old  !#^:r', using `:r' to remove `.old'
       from the first argument on the same line (`!#^'). We could
       say `echo hello out there', then `echo !*:u' to capitalize
       `hello', `echo !*:au' to say it out loud, or `echo !*:agu'
       to  really  shout.   We might follow `mail -s "I forgot my
       password" rot' with `!:s/rot/root' to correct the spelling
       of  `root'  (but  see  SSppeelllliinngg ccoorrrreeccttiioonn for a different



Cornell 6.06.00           29 April 1995                        18





TCSH(1)                                                   TCSH(1)


       approach).

       There is a special abbreviation for  substitutions.   `^',
       when it is the first character on an input line, is equiv-
       alent to `!:s^'.  Thus we might have said  `^rot^root'  to
       make  the  spelling  correction  in  the previous example.
       This is the  only  history  substitution  which  does  not
       explicitly begin with `!'.

       (+)  In  _c_s_h  as such, only one modifier may be applied to
       each history or variable expansion. In _t_c_s_h, more than one
       may be used, for example

           % mv wumpus.man /usr/man/man1/wumpus.1
           % man !$:t:r
           man wumpus

       In  _c_s_h,  the result would be `wumpus.1:r'. A substitution
       followed by a colon may need to be insulated from it  with
       braces:

           > mv a.out /usr/games/wumpus
           > setenv PATH !$:h:$PATH
           Bad ! modifier: $.
           > setenv PATH !{-2$:h}:$PATH
           setenv PATH /usr/games:/bin:/usr/bin:.

       The  first attempt would succeed in _c_s_h but fails in _t_c_s_h,
       because _t_c_s_h expects another  modifier  after  the  second
       colon rather than `$'.

       Finally,  history  can  be  accessed through the editor as
       well as through the substitutions just described.  The _u_p_-
       and _d_o_w_n_-_h_i_s_t_o_r_y, _h_i_s_t_o_r_y_-_s_e_a_r_c_h_-_b_a_c_k_w_a_r_d and _-_f_o_r_w_a_r_d, _i_-
       _s_e_a_r_c_h_-_b_a_c_k and _-_f_w_d, _v_i_-_s_e_a_r_c_h_-_b_a_c_k and _-_f_w_d,  _c_o_p_y_-_p_r_e_v_-
       _w_o_r_d  and  _i_n_s_e_r_t_-_l_a_s_t_-_w_o_r_d  editor  commands  search  for
       events in the history list and copy them  into  the  input
       buffer.    The   _t_o_g_g_l_e_-_l_i_t_e_r_a_l_-_h_i_s_t_o_r_y   editor   command
       switches between the expanded and literal forms of history
       lines in the input buffer.  _e_x_p_a_n_d_-_h_i_s_t_o_r_y and _e_x_p_a_n_d_-_l_i_n_e
       expand history substitutions in the current  word  and  in
       the entire input buffer respectively.

   AAlliiaass ssuubbssttiittuuttiioonn
       The  shell  maintains  a list of aliases which can be set,
       unset and printed  by  the  _a_l_i_a_s  and  _u_n_a_l_i_a_s  commands.
       After  a  command line is parsed into simple commands (see
       CCoommmmaannddss) the first word of each  command,  left-to-right,
       is  checked  to  see if it has an alias.  If so, the first
       word is replaced by the alias. If  the  alias  contains  a
       history   reference,  it  undergoes  HHiissttoorryy  ssuubbssttiittuuttiioonn
       (q.v.) as though the original command  were  the  previous
       input line. If the alias does not contain a history refer-
       ence, the argument list is left untouched.



Cornell 6.06.00           29 April 1995                        19





TCSH(1)                                                   TCSH(1)


       Thus if the alias for `ls' were `ls -l'  the  command  `ls
       /usr'  would  become  `ls -l /usr', the argument list here
       being undisturbed.  If the alias for `lookup'  were  `grep
       !^ /etc/passwd' then `lookup bill' would become `grep bill
       /etc/passwd'.  Aliases can be  used  to  introduce  parser
       metasyntax.   For  example,  `alias  print 'pr \!* | lpr''
       defines a ``command'' (`print') which _p_r(1)s its arguments
       to the line printer.

       Alias substitution is repeated until the first word of the
       command has no alias. If an alias  substitution  does  not
       change  the  first word (as in the previous example) it is
       flagged to prevent a loop. Other loops  are  detected  and
       cause an error.

       Some  aliases  are  referred  to by the shell; see SSppeecciiaall
       aalliiaasseess.

   VVaarriiaabbllee ssuubbssttiittuuttiioonn
       The shell maintains a list of variables, each of which has
       as  value  a  list  of  zero or more words.  The values of
       shell variables can be displayed and changed with the  _s_e_t
       and  _u_n_s_e_t commands.  The system maintains its own list of
       ``environment'' variables.  These  can  be  displayed  and
       changed with _p_r_i_n_t_e_n_v, _s_e_t_e_n_v and _u_n_s_e_t_e_n_v.

       (+)  Variables  may be made read-only with `set -r' (q.v.)
       Read-only variables may not be modified or unset; attempt-
       ing  to do so will cause an error.  Once made read-only, a
       variable cannot be made writable, so `set  -r'  should  be
       used  with  caution.  Environment variables cannot be made
       read-only.

       Some variables are set by the shell or referred to by  it.
       For instance, the aarrggvv variable is an image of the shell's
       argument list, and words  of  this  variable's  value  are
       referred  to  in  special  ways.   Some  of  the variables
       referred to by the shell are toggles; the shell  does  not
       care  what  their  value  is, only whether they are set or
       not.  For instance, the vveerrbboossee variable is a toggle which
       causes  command  input  to be echoed.  The --vv command line
       option sets this variable.  SSppeecciiaall sshheellll vvaarriiaabblleess  lists
       all variables which are referred to by the shell.

       Other  operations  treat  variables  numerically.  The `@'
       command permits numeric calculations to be  performed  and
       the  result  assigned to a variable.  Variable values are,
       however, always represented as  (zero  or  more)  strings.
       For the purposes of numeric operations, the null string is
       considered to be zero, and the second and subsequent words
       of multiword values are ignored.

       After  the  input  line  is aliased and parsed, and before
       each  command  is  executed,  variable   substitution   is



Cornell 6.06.00           29 April 1995                        20





TCSH(1)                                                   TCSH(1)


       performed  keyed by `$' characters.  This expansion can be
       prevented by preceding the `$' with a  `\'  except  within
       `"'s  where  it  _a_l_w_a_y_s  occurs,  and within `''s where it
       _n_e_v_e_r occurs.  Strings quoted by ``' are interpreted later
       (see  CCoommmmaanndd ssuubbssttiittuuttiioonn below) so `$' substitution does
       not occur there until later, if at all.  A `$'  is  passed
       unchanged if followed by a blank, tab, or end-of-line.

       Input/output  redirections  are recognized before variable
       expansion, and are variable expanded  separately.   Other-
       wise,  the  command  name  and  entire  argument  list are
       expanded together.  It is  thus  possible  for  the  first
       (command)  word  (to this point) to generate more than one
       word, the first of which becomes the command name, and the
       rest of which become arguments.

       Unless  enclosed  in  `"'  or  given the `:q' modifier the
       results of variable substitution may eventually be command
       and  filename  substituted.   Within `"', a variable whose
       value consists of multiple words expands to a (portion  of
       a)  single  word,  with  the words of the variable's value
       separated by blanks.  When the `:q' modifier is applied to
       a  substitution the variable will expand to multiple words
       with each word separated by a blank and quoted to  prevent
       later command or filename substitution.

       The  following  metasequences are provided for introducing
       variable values into the shell input.  Except as noted, it
       is an error to reference a variable which is not set.

       $_n_a_m_e
       ${_n_a_m_e} Substitutes  the  words  of  the value of variable
               _n_a_m_e, each separated by a blank.  Braces  insulate
               _n_a_m_e  from following characters which would other-
               wise be part of it.  Shell  variables  have  names
               consisting of up to 20 letters and digits starting
               with a letter.  The underscore character  is  con-
               sidered  a  letter.   If _n_a_m_e is not a shell vari-
               able, but is set in  the  environment,  then  that
               value is returned (but `:' modifiers and the other
               forms given below are not available in this case).
       $_n_a_m_e[_s_e_l_e_c_t_o_r]
       ${_n_a_m_e[_s_e_l_e_c_t_o_r]}
               Substitutes only the selected words from the value
               of _n_a_m_e.  The _s_e_l_e_c_t_o_r is subjected to `$' substi-
               tution  and  may consist of a single number or two
               numbers separated by a `-'.  The first word  of  a
               variable's  value  is  numbered `1'.  If the first
               number of a range is omitted it defaults  to  `1'.
               If  the  last  member  of  a  range  is omitted it
               defaults to `$#_n_a_m_e'.  The  _s_e_l_e_c_t_o_r  `*'  selects
               all  words.   It is not an error for a range to be
               empty if the second  argument  is  omitted  or  in
               range.



Cornell 6.06.00           29 April 1995                        21





TCSH(1)                                                   TCSH(1)


       $0      Substitutes  the  name of the file from which com-
               mand input is being read.  An error occurs if  the
               name is not known.
       $_n_u_m_b_e_r
       ${_n_u_m_b_e_r}
               Equivalent to `$argv[_n_u_m_b_e_r]'.
       $*      Equivalent  to  `$argv',  which  is  equivalent to
               `$argv[*]'.

       The `:' modifiers described  under  HHiissttoorryy  ssuubbssttiittuuttiioonn,
       except  for  `:p',  can  be  applied  to the substitutions
       above. More than one may be used. (+) Braces may be needed
       to  insulate  a variable substitution from a literal colon
       just as with HHiissttoorryy ssuubbssttiittuuttiioonn  (q.v.);  any  modifiers
       must appear within the braces.

       The  following  substitutions can not be modified with `:'
       modifiers.

       $?_n_a_m_e
       ${?_n_a_m_e}
               Substitutes the string `1' if _n_a_m_e is set, `0'  if
               it is not.
       $?0     Substitutes  `1'  if the current input filename is
               known, `0' if it is not.  Always `0'  in  interac-
               tive shells.
       $#_n_a_m_e
       ${#_n_a_m_e}
               Substitutes the number of words in _n_a_m_e.
       $#      Equivalent to `$#argv'. (+)
       $%_n_a_m_e
       ${%_n_a_m_e}
               Substitutes the number of characters in _n_a_m_e. (+)
       $%_n_u_m_b_e_r
       ${%_n_u_m_b_e_r}
               Substitutes    the   number   of   characters   in
               $argv[_n_u_m_b_e_r]. (+)
       $?      Equivalent to `$status'. (+)
       $$      Substitutes the (decimal) process  number  of  the
               (parent) shell.
       $!      Substitutes  the  (decimal)  process number of the
               last background process started by this shell.
       $<      Substitutes a line from the standard  input,  with
               no  further  interpretation thereafter.  It can be
               used to read from the keyboard in a shell  script.
               (+)  While  _c_s_h  always  quotes  $<, as if it were
               equivalent to `$<:q', _t_c_s_h does not.  Furthermore,
               when  _t_c_s_h  is  waiting for a line to be typed the
               user  may  type  an  interrupt  to  interrupt  the
               sequence into which the line is to be substituted,
               but _c_s_h does not allow this.

       The editor command  _e_x_p_a_n_d_-_v_a_r_i_a_b_l_e_s,  normally  bound  to
       `^X-$',  can  be  used  to interactively expand individual



Cornell 6.06.00           29 April 1995                        22





TCSH(1)                                                   TCSH(1)


       variables.

   CCoommmmaanndd,, ffiilleennaammee aanndd ddiirreeccttoorryy ssttaacckk ssuubbssttiittuuttiioonn
       The remaining substitutions are applied selectively to the
       arguments  of  builtin commands.  This means that portions
       of expressions which are not evaluated are  not  subjected
       to  these expansions.  For commands which are not internal
       to the shell, the command name is  substituted  separately
       from  the  argument  list.   This  occurs very late, after
       input-output redirection is performed, and in a  child  of
       the main shell.

   CCoommmmaanndd ssuubbssttiittuuttiioonn
       Command substitution is indicated by a command enclosed in
       ``'.  The output from such a command is broken into  sepa-
       rate  words  at  blanks, tabs and newlines, and null words
       are discarded. The output is variable and command  substi-
       tuted and put in place of the original string.

       Command  substitutions  inside  double quotes (`"') retain
       blanks and tabs; only newlines force new words.  The  sin-
       gle  final  newline does not force a new word in any case.
       It is thus possible for a command  substitution  to  yield
       only  part  of  a word, even if the command outputs a com-
       plete line.

   FFiilleennaammee ssuubbssttiittuuttiioonn
       If a word contains any of the characters `*', `?', `['  or
       `{' or begins with the character `~' it is a candidate for
       filename substitution, also known  as  ``globbing''.  This
       word is then regarded as a pattern (``glob-pattern''), and
       replaced with an alphabetically sorted list of file  names
       which match the pattern.

       In  matching filenames, the character `.' at the beginning
       of a filename or immediately following a `/', as  well  as
       the character `/' must be matched explicitly.  The charac-
       ter `*' matches any string of  characters,  including  the
       null string.  The character `?' matches any single charac-
       ter.  The sequence `[...]' matches any one of the  charac-
       ters enclosed.  Within `[...]', a pair of characters sepa-
       rated by `-' matches any character lexically  between  the
       two.

       (+)  Some  glob-patterns  can  be  negated:  The  sequence
       `[^...]' matches any single character _n_o_t specified by the
       characters and/or ranges of characters in the braces.

       An entire glob-pattern can also be negated with `^':

           > echo *
           bang crash crunch ouch
           > echo ^cr*
           bang ouch



Cornell 6.06.00           29 April 1995                        23





TCSH(1)                                                   TCSH(1)


       Glob-patterns  which do not use `?', `*', or `[]' or which
       use `{}' or `~' (below) are not negated correctly.

       The metanotation `a{b,c,d}e' is a shorthand for  `abe  ace
       ade'.       Left-to-right      order     is     preserved:
       `/usr/source/s1/{oldls,ls}.c'          expands          to
       `/usr/source/s1/oldls.c  /usr/source/s1/ls.c'. The results
       of matches are sorted separately at a low  level  to  pre-
       serve   this   order:  `../{memo,*box}'  might  expand  to
       `../memo ../box  ../mbox'.   (Note  that  `memo'  was  not
       sorted with the results of matching `*box'.)  It is not an
       error when this construct expands to files  which  do  not
       exist,  but  it is possible to get an error from a command
       to which the expanded list is passed.  This construct  may
       be  nested.  As a special case the words `{', `}' and `{}'
       are passed undisturbed.

       The character `~' at the beginning of a filename refers to
       home directories.  Standing alone, i.e. `~', it expands to
       the invoker's home directory as reflected in the value  of
       the  hhoommee shell variable. When followed by a name consist-
       ing of  letters,  digits  and  `-'  characters  the  shell
       searches  for  a user with that name and substitutes their
       home directory; thus `~ken' might expand to `/usr/ken' and
       `~ken/chmach'  to `/usr/ken/chmach'.  If the character `~'
       is followed by a character other than a letter or  `/'  or
       appears  elsewhere  than at the beginning of a word, it is
       left  undisturbed.   A  command   like   `setenv   MANPATH
       /usr/man:/usr/local/man:~/lib/man' does not, therefore, do
       home directory substitution as one might hope.

       It is an error for a glob-pattern containing `*', `?', `['
       or  `~', with or without `^', not to match any files. How-
       ever, only one pattern in a  list  of  glob-patterns  must
       match  a  file (so that, e.g., `rm *.a *.c *.o' would fail
       only if there were no files in the current directory  end-
       ing  in  `.a',  `.c', or `.o'), and if the nnoonnoommaattcchh shell
       variable is set a pattern  (or  list  of  patterns)  which
       matches  nothing  is left unchanged rather than causing an
       error.

       The nnoogglloobb shell variable can be set to  prevent  filename
       substitution, and the _e_x_p_a_n_d_-_g_l_o_b editor command, normally
       bound to `^X-*', can be used to interactively expand indi-
       vidual filename substitutions.

   DDiirreeccttoorryy ssttaacckk ssuubbssttiittuuttiioonn ((++))
       The  directory  stack  is  a list of directories, numbered
       from zero, used by the _p_u_s_h_d, _p_o_p_d and _d_i_r_s  builtin  com-
       mands  (q.v.).   _d_i_r_s  can print, store in a file, restore
       and clear  the  directory  stack  at  any  time,  and  the
       ssaavveeddiirrss  and ddiirrssffiillee shell variables can be set to store
       the directory stack automatically on logout and restore it
       on  login.  The ddiirrssttaacckk shell variable can be examined to



Cornell 6.06.00           29 April 1995                        24





TCSH(1)                                                   TCSH(1)


       see the directory stack and set to put arbitrary  directo-
       ries into the directory stack.

       The  character  `=' followed by one or more digits expands
       to an entry in the directory stack. The special case  `=-'
       expands to the last directory in the stack. For example,

           > dirs -v
           0       /usr/bin
           1       /usr/spool/uucp
           2       /usr/accts/sys
           > echo =1
           /usr/spool/uucp
           > echo =0/calendar
           /usr/bin/calendar
           > echo =-
           /usr/accts/sys

       The  nnoogglloobb  and nnoonnoommaattcchh shell variables and the _e_x_p_a_n_d_-
       _g_l_o_b editor command apply to directory stack  as  well  as
       filename substitutions.

   OOtthheerr ssuubbssttiittuuttiioonnss ((++))
       There  are  several  more  transformations involving file-
       names, not strictly related to  the  above  but  mentioned
       here  for completeness.  _A_n_y filename may be expanded to a
       full path when the ssyymmlliinnkkss  variable  (q.v.)  is  set  to
       `expand'.   Quoting  prevents this expansion, and the _n_o_r_-
       _m_a_l_i_z_e_-_p_a_t_h editor command does it on demand.  The _n_o_r_m_a_l_-
       _i_z_e_-_c_o_m_m_a_n_d  editor  command expands commands in PATH into
       full paths on demand.  Finally, _c_d and _p_u_s_h_d interpret `-'
       as  the  old  working  directory  (equivalent to the shell
       variable oowwdd).  This is not a substitution at all, but  an
       abbreviation  recognized  only by those commands. Nonethe-
       less, it too can be prevented by quoting.

   CCoommmmaannddss
       The next three sections describe how  the  shell  executes
       commands and deals with their input and output.

   SSiimmppllee ccoommmmaannddss,, ppiippeelliinneess aanndd sseeqquueenncceess
       A  simple  command  is  a  sequence of words, the first of
       which specifies the command to be executed.  A  series  of
       simple commands joined by `|' characters forms a pipeline.
       The output of each command in a pipeline is  connected  to
       the input of the next.

       Simple commands and pipelines may be joined into sequences
       with `;', and will be executed sequentially.  Commands and
       pipelines  can  also be joined into sequences with `||' or
       `&&', indicating, as in the C language, that the second is
       to be executed only if the first fails or succeeds respec-
       tively.




Cornell 6.06.00           29 April 1995                        25





TCSH(1)                                                   TCSH(1)


       A simple command, pipeline or sequence may  be  placed  in
       parentheses,  `()', to form a simple command, which may in
       turn be a component of a pipeline or sequence. A  command,
       pipeline  or  sequence can be executed without waiting for
       it to terminate by following it with an `&'.

   BBuuiillttiinn aanndd nnoonn--bbuuiillttiinn ccoommmmaanndd eexxeeccuuttiioonn
       Builtin commands are executed within the  shell.   If  any
       component  of a pipeline except the last is a builtin com-
       mand, the pipeline is executed in a subshell.

       Parenthesized commands are always executed in a  subshell.

           (cd; pwd); pwd

       thus prints the hhoommee directory, leaving you where you were
       (printing this after the home directory), while

           cd; pwd

       leaves you in the hhoommee directory.  Parenthesized  commands
       are  most often used to prevent _c_d from affecting the cur-
       rent shell.

       When a command to be executed is found not to be a builtin
       command  the  shell  attempts  to  execute the command via
       _e_x_e_c_v_e(2).  Each word in the variable ppaatthh names a  direc-
       tory  in which the shell will look for the command.  If it
       is given neither a --cc nor a --tt option,  the  shell  hashes
       the  names  in these directories into an internal table so
       that it will only try an _e_x_e_c_v_e(2) in a directory if there
       is  a  possibility  that  the command resides there.  This
       greatly speeds command location when  a  large  number  of
       directories are present in the search path.  If this mech-
       anism has been turned off (via _u_n_h_a_s_h), if the  shell  was
       given  a  --cc or --tt argument or in any case for each direc-
       tory component of ppaatthh which does not begin  with  a  `/',
       the  shell concatenates the current working directory with
       the given command name to form a path name of a file which
       it then attempts to execute.

       If  the  file  has  execute permissions but is not an exe-
       cutable to the system (i.e. it is  neither  an  executable
       binary nor a script which specifies its interpreter), then
       it is assumed to be a file containing shell commands and a
       new  shell  is spawned to read it. The _s_h_e_l_l special alias
       may be set to specify an interpreter other than the  shell
       itself.

       On  systems which do not understand the `#!' script inter-
       preter convention the shell may be compiled to emulate it;
       see  the  vveerrssiioonn  shell variable. If so, the shell checks
       the first line of the file to see if it  is  of  the  form
       `#!_i_n_t_e_r_p_r_e_t_e_r  _a_r_g  ...'.  If  it  is,  the  shell starts



Cornell 6.06.00           29 April 1995                        26





TCSH(1)                                                   TCSH(1)


       _i_n_t_e_r_p_r_e_t_e_r with the given _a_r_gs and feeds the file  to  it
       on standard input.

   IInnppuutt//oouuttppuutt
       The standard input and standard output of a command may be
       redirected with the following syntax:

       < _n_a_m_e  Open file _n_a_m_e (which is first  variable,  command
               and filename expanded) as the standard input.
       << _w_o_r_d Read the shell input up to a line which is identi-
               cal to _w_o_r_d. _w_o_r_d is not  subjected  to  variable,
               filename  or  command substitution, and each input
               line is compared to _w_o_r_d before any  substitutions
               are  done  on  this  input line.  Unless a quoting
               `\', `"', `' or ``' appears in _w_o_r_d  variable  and
               command substitution is performed on the interven-
               ing lines, allowing `\' to quote `$', `\' and ``'.
               Commands  which  are  substituted have all blanks,
               tabs, and newlines preserved, except for the final
               newline  which  is dropped.  The resultant text is
               placed in an anonymous  temporary  file  which  is
               given to the command as standard input.
       > _n_a_m_e
       _>_! _n_a_m_e
       _>_& _n_a_m_e
       _>_&_! _n_a_m_e
               The  file _n_a_m_e is used as standard output.  If the
               file does not exist then it  is  created;  if  the
               file  exists,  its is truncated, its previous con-
               tents being lost.

               If the shell variable nnoocclloobbbbeerr is set,  then  the
               file must not exist or be a character special file
               (e.g. a  terminal  or  `/dev/null')  or  an  error
               results.   This  helps prevent accidental destruc-
               tion of files.  In this case the `!' forms can  be
               used to suppress this check.

               The  forms involving `&' route the diagnostic out-
               put into the specified file as well as  the  stan-
               dard  output.  _n_a_m_e is expanded in the same way as
               `<' input filenames are.
       >> _n_a_m_e
       _>_>_& _n_a_m_e
       _>_>_! _n_a_m_e
       _>_>_&_! _n_a_m_e
               Like `>', but appends output to the end  of  _n_a_m_e.
               If the shell variable nnoocclloobbbbeerr is set, then it is
               an error for the file _n_o_t to exist, unless one  of
               the `!' forms is given.

       A  command receives the environment in which the shell was
       invoked as modified by the input-output parameters and the
       presence  of the command in a pipeline.  Thus, unlike some



Cornell 6.06.00           29 April 1995                        27





TCSH(1)                                                   TCSH(1)


       previous shells, commands run from a file  of  shell  com-
       mands  have  no  access  to  the  text  of the commands by
       default; rather they receive the original  standard  input
       of  the  shell.  The `<<' mechanism should be used to pre-
       sent inline data.  This permits shell command  scripts  to
       function  as  components of pipelines and allows the shell
       to block read its input.  Note that the  default  standard
       input  for  a  command  run detached is _n_o_t the empty file
       _/_d_e_v_/_n_u_l_l, but the original standard input of  the  shell.
       If  this is a terminal and if the process attempts to read
       from the terminal, then the process  will  block  and  the
       user will be notified (see JJoobbss).

       Diagnostic  output may be directed through a pipe with the
       standard output.  Simply use the  form  `|&'  rather  than
       just `|'.

       The  shell  cannot  presently  redirect  diagnostic output
       without also redirecting standard output, but `(_c_o_m_m_a_n_d  >
       _o_u_t_p_u_t_-_f_i_l_e)   >&   _e_r_r_o_r_-_f_i_l_e'  is  often  an  acceptable
       workaround.   Either  _o_u_t_p_u_t_-_f_i_l_e  or  _e_r_r_o_r_-_f_i_l_e  may  be
       `/dev/tty' to send output to the terminal.

   FFeeaattuurreess
       Having  described  how  the shell accepts, parses and exe-
       cutes command lines, we now turn to a variety of its  use-
       ful features.

   CCoonnttrrooll ffllooww
       The  shell contains a number of commands which can be used
       to regulate the flow of control in  command  files  (shell
       scripts)  and  (in  limited but useful ways) from terminal
       input.  These commands all operate by forcing the shell to
       reread  or  skip  in its input and, due to the implementa-
       tion, restrict the placement of some of the commands.

       The _f_o_r_e_a_c_h, _s_w_i_t_c_h, and _w_h_i_l_e statements, as well as  the
       _i_f_-_t_h_e_n_-_e_l_s_e  form  of  the _i_f statement, require that the
       major keywords appear in a single  simple  command  on  an
       input line as shown below.

       If the shell's input is not seekable, the shell buffers up
       input whenever a loop is being read and performs seeks  in
       this  internal  buffer to accomplish the rereading implied
       by the loop.  (To the extent that  this  allows,  backward
       _g_o_t_os will succeed on non-seekable inputs.)

   EExxpprreessssiioonnss
       The  _i_f,  _w_h_i_l_e  and _e_x_i_t builtin commands use expressions
       with a common syntax. The expressions can include  any  of
       the  operators  described in the next three sections. Note
       that the _@ builtin command (q.v.)  has  its  own  separate
       syntax.




Cornell 6.06.00           29 April 1995                        28





TCSH(1)                                                   TCSH(1)


   LLooggiiccaall,, aarriitthhmmeettiiccaall aanndd ccoommppaarriissoonn ooppeerraattoorrss
       These  operators  are  similar  to those of C and have the
       same precedence.  They include

           ||  &&  |  ^  &  ==  !=  =~  !~  <=  >=
           <  > <<  >>  +  -  *  /  %  !  ~  (  )

       Here the precedence increases to the right, `==' `!=' `=~'
       and  `!~',  `<='  `>=' `<' and `>', `<<' and `>>', `+' and
       `-', `*' `/' and `%' being, in groups, at the same  level.
       The  `==' `!=' `=~' and `!~' operators compare their argu-
       ments as strings; all  others  operate  on  numbers.   The
       operators `=~' and `!~' are like `!=' and `==' except that
       the right hand side is a glob-pattern (see  FFiilleennaammee  ssuubb--
       ssttiittuuttiioonn) against which the left hand operand is matched.
       This reduces the need for use of the _s_w_i_t_c_h  builtin  com-
       mand  in  shell  scripts when all that is really needed is
       pattern matching.

       Strings which begin with `0' are considered octal numbers.
       Null or missing arguments are considered `0'.  The results
       of all expressions are strings,  which  represent  decimal
       numbers.   It  is important to note that no two components
       of an expression can appear in the same word; except  when
       adjacent  to components of expressions which are syntacti-
       cally significant to the parser (`&' `|' `<' `>' `('  `)')
       they should be surrounded by spaces.

   CCoommmmaanndd eexxiitt ssttaattuuss
       Commands  can  be  executed  in expressions and their exit
       status returned by enclosing them in braces (`{}'). Remem-
       ber  that the braces should be separated from the words of
       the command by spaces. Command executions succeed, return-
       ing  true,  i.e.  `1', if the command exits with status 0,
       otherwise they fail, returning false, i.e. `0'.   If  more
       detailed  status  information is required then the command
       should be executed outside of an expression and the ssttaattuuss
       shell variable examined.

   FFiillee iinnqquuiirryy ooppeerraattoorrss
       Some  of these operators perform true/false tests on files
       and related objects. They are of the form --_o_p _f_i_l_e,  where
       _o_p is one of

           rr   Read access
           ww   Write access
           xx   Execute access
           XX   Executable  in the path or shell builtin, e.g. `-X
               ls' and `-X ls-F'  are  generally  true,  but  `-X
               /bin/ls' is not (+)
           ee   Existence
           oo   Ownership
           zz   Zero size
           ss   Non-zero size (+)



Cornell 6.06.00           29 April 1995                        29





TCSH(1)                                                   TCSH(1)


           ff   Plain file
           dd   Directory
           ll   Symbolic link (+) *
           bb   Block special file (+)
           cc   Character special file (+)
           pp   Named pipe (fifo) (+) *
           SS   Socket special file (+) *
           uu   Set-user-ID bit is set (+)
           gg   Set-group-ID bit is set (+)
           kk   Sticky bit is set (+)
           tt   _f_i_l_e  (which  must  be  a  digit)  is an open file
               descriptor for a terminal device (+)
           LL   Applies  subsequent  operators  in   a   multiple-
               operator  test  to  a symbolic link rather than to
               the file to which the link points (+) *

       _f_i_l_e is command and filename expanded and then  tested  to
       see if it has the specified relationship to the real user.
       If _f_i_l_e does not exist or  is  inaccessible  or,  for  the
       operators  indicated  by  `*',  if the specified file type
       does not exist on the current system, then  all  enquiries
       return false, i.e. `0'.

       These  operators  may  be  combined  for conciseness: `-_x_y
       _f_i_l_e' is equivalent to `-_x _f_i_l_e && -_y _f_i_l_e'. (+) For exam-
       ple,  `-fx'  is  true  (returns  `1') for plain executable
       files, but not for directories.

       LL may be used in a multiple-operator test to apply  subse-
       quent operators to a symbolic link rather than to the file
       to which the link points.  For example, `-lLo' is true for
       links  owned  by  the  invoking  user.   LLrr, LLww and LLxx are
       always true for links and false for  non-links.  LL  has  a
       different meaning when it is the last operator in a multi-
       ple-operator test; see below.

       It is possible but not useful, and  sometimes  misleading,
       to  combine  operators which expect _f_i_l_e to be a file with
       operators which do not, (e.g. XX and tt). Following LL with a
       non-file   operator   can  lead  to  particularly  strange
       results.

       Other operators return other information,  i.e.  not  just
       `0'  or  `1'.  (+) They have the same format as before; _o_p
       may be one of

           AA       Last file access time, as the number  of  sec-
                   onds since the epoch
           AA::      Like AA, but in timestamp format, e.g. `Fri May
                   14 16:36:10 1993'
           MM       Last file modification time
           MM::      Like MM, but in timestamp format
           CC       Last inode modification time
           CC::      Like CC, but in timestamp format



Cornell 6.06.00           29 April 1995                        30





TCSH(1)                                                   TCSH(1)


           DD       Device number
           II       Inode number
           FF       Composite  ffile  identifier,   in   the   form
                   _d_e_v_i_c_e:_i_n_o_d_e
           LL       The  name of the file pointed to by a symbolic
                   link
           NN       Number of (hard) links
           PP       Permissions, in octal, without leading zero
           PP::      Like PP, with leading zero
           PP_m_o_d_e   Equivalent to `-P _f_i_l_e  &  _m_o_d_e',  e.g.  `-P22
                   _f_i_l_e'  returns  `22'  if  _f_i_l_e  is writable by
                   group and other, `20' if by  group  only,  and
                   `0' if by neither
           PP_m_o_d_e::  Like PP_m_o_d_e::, with leading zero
           UU       Numeric userid
           UU::      Username,  or  the numeric userid if the user-
                   name is unknown
           GG       Numeric groupid
           GG::      Groupname,  or  the  numeric  groupid  if  the
                   groupname is unknown
           ZZ       Size, in bytes

       Only  one  of  these  operators  may appear in a multiple-
       operator test, and it must be the last. Note that LL has  a
       different  meaning at the end of and elsewhere in a multi-
       ple-operator test. Because `0' is a valid return value for
       many  of these operators, they do not return `0' when they
       fail: most return `-1', and FF returns `:'.

       If the shell is compiled with POSIX defined (see the  vveerr--
       ssiioonn  shell  variable),  the  result  of a file inquiry is
       based on the permission bits of the file and  not  on  the
       result  of the _a_c_c_e_s_s(2) system call.  For example, if one
       tests a file with --ww whose  permissions  would  ordinarily
       allow  writing but which is on a file system mounted read-
       only, the test will succeed in a POSIX shell but fail in a
       non-POSIX shell.

       File  inquiry  operators  can  also  be evaluated with the
       _f_i_l_e_t_e_s_t builtin command (q.v.) (+).

   JJoobbss
       The shell associates a _j_o_b with each pipeline.  It keeps a
       table  of  current  jobs, printed by the _j_o_b_s command, and
       assigns them small integer numbers.  When a job is started
       asynchronously  with  `&',  the  shell prints a line which
       looks like

           [1] 1234

       indicating that the job which was  started  asynchronously
       was  job  number  1 and had one (top-level) process, whose
       process id was 1234.




Cornell 6.06.00           29 April 1995                        31





TCSH(1)                                                   TCSH(1)


       If you are running a job and wish to do something else you
       may hit the suspend key (usually `^Z'), which sends a STOP
       signal to the current job.  The shell will  then  normally
       indicate  that  the  job  has  been  `Suspended' and print
       another prompt.  If the lliissttjjoobbss shell  variable  is  set,
       all  jobs will be listed like the _j_o_b_s builtin command; if
       it is set to `long' the listing will be  in  long  format,
       like  `jobs -l'.  You can then manipulate the state of the
       suspended job.  You can put it in the ``background''  with
       the  _b_g  command or run some other commands and eventually
       bring the job back into the ``foreground'' with _f_g.   (See
       also  the  _r_u_n_-_f_g_-_e_d_i_t_o_r  editor  command.)   A `^Z' takes
       effect immediately and is like an interrupt in that  pend-
       ing  output  and  unread  input  are  discarded when it is
       typed.  The _w_a_i_t builtin command causes the shell to  wait
       for all background jobs to complete.

       The  `^]'  key  sends a delayed suspend signal, which does
       not generate a STOP signal until  a  program  attempts  to
       _r_e_a_d(2)  it,  to  the  current  job.  This can usefully be
       typed ahead when you have prepared some commands for a job
       which  you  wish to stop after it has read them.  The `^Y'
       key performs this function in _c_s_h(1); in _t_c_s_h, `^Y' is  an
       editing command. (+)

       A  job  being  run  in the background stops if it tries to
       read from the  terminal.   Background  jobs  are  normally
       allowed  to  produce  output,  but this can be disabled by
       giving the command `stty tostop'.  If  you  set  this  tty
       option,  then  background  jobs will stop when they try to
       produce output like they do when they try to read input.

       There are several ways to refer to jobs in the shell.  The
       character `%' introduces a job name.  If you wish to refer
       to job number 1, you can name it as `%1'.  Just  naming  a
       job  brings  it  to the foreground; thus `%1' is a synonym
       for `fg %1', bringing job  1  back  into  the  foreground.
       Similarly,  saying `%1 &' resumes job 1 in the background,
       just like `bg %1'. A job can also be  named  by  an  unam-
       bigous  prefix  of  the string typed in to start it: `%ex'
       would normally restart a suspended  _e_x(1)  job,  if  there
       were  only  one  suspended  job  whose name began with the
       string `ex'.  It is also possible  to  say  `%?_s_t_r_i_n_g'  to
       specify a job whose text contains _s_t_r_i_n_g, if there is only
       one such job.

       The shell maintains a notion of the current  and  previous
       jobs.   In  output  pertaining to jobs, the current job is
       marked with a `+' and the previous job with  a  `-'.   The
       abbreviations  `%+',  `%', and (by analogy with the syntax
       of the _h_i_s_t_o_r_y mechanism) `%%' all refer  to  the  current
       job, and `%-' refers to the previous job.

       The job control mechanism requires that the _s_t_t_y(1) option



Cornell 6.06.00           29 April 1995                        32





TCSH(1)                                                   TCSH(1)


       `new' be set on some systems.  It is an  artifact  from  a
       `new' implementation of the tty driver which allows gener-
       ation of interrupt characters from the  keyboard  to  tell
       jobs  to  stop.  See _s_t_t_y(1) and the _s_e_t_t_y builtin command
       for details on setting options in the new tty driver.

   SSttaattuuss rreeppoorrttiinngg
       The shell learns immediately whenever  a  process  changes
       state.   It  normally  informs  you whenever a job becomes
       blocked so that no further progress is possible, but  only
       just  before  it prints a prompt.  This is done so that it
       does not otherwise disturb your work.   If,  however,  you
       set  the  shell variable nnoottiiffyy, the shell will notify you
       immediately of  changes  of  status  in  background  jobs.
       There  is also a shell command _n_o_t_i_f_y which marks a single
       process so that its status  changes  will  be  immediately
       reported.   By  default  _n_o_t_i_f_y marks the current process;
       simply say `notify' after starting  a  background  job  to
       mark it.

       When  you  try  to leave the shell while jobs are stopped,
       you will be warned that `You have stopped jobs.'  You  may
       use the _j_o_b_s command to see what they are.  If you do this
       or immediately try to exit again, the shell will not  warn
       you  a  second time, and the suspended jobs will be termi-
       nated.

   AAuuttoommaattiicc,, ppeerriiooddiicc aanndd ttiimmeedd eevveennttss ((++))
       There are various ways to  run  commands  and  take  other
       actions  automatically  at  various  times  in  the ``life
       cycle'' of  the  shell.  They  are  summarized  here,  and
       described  in  detail  under  the appropriate BBuuiillttiinn ccoomm--
       mmaannddss, SSppeecciiaall sshheellll vvaarriiaabblleess and SSppeecciiaall aalliiaasseess.

       The _s_c_h_e_d builtin command puts commands  in  a  scheduled-
       event list, to be executed by the shell at a given time.

       The  _b_e_e_p_c_m_d,  _c_w_d_c_m_d, _p_e_r_i_o_d_i_c and _p_r_e_c_m_d SSppeecciiaall aalliiaasseess
       can be set, respectively, to  execute  commands  when  the
       shell  wants  to ring the bell, when the working directory
       changes, every ttppeerriioodd minutes and before each prompt.

       The aauuttoollooggoouutt shell variable can be set  to  log  out  or
       lock the shell after a given number of minutes of inactiv-
       ity.

       The mmaaiill shell variable can be set to check for  new  mail
       periodically.

       The  pprriinntteexxiittvvaalluuee shell variable can be set to print the
       exit status of commands which exit  with  a  status  other
       than zero.

       The rrmmssttaarr shell variable can be set to ask the user, when



Cornell 6.06.00           29 April 1995                        33





TCSH(1)                                                   TCSH(1)


       `rm *' is typed, if that is really what was meant.

       The ttiimmee shell variable can be set  to  execute  the  _t_i_m_e
       builtin  command  after the completion of any process that
       takes more than a given number of CPU seconds.

       The wwaattcchh and wwhhoo shell variables can  be  set  to  report
       when  selected  users  log  in or out, and the _l_o_g builtin
       command reports on those users at any time.

   NNaattiivvee LLaanngguuaaggee SSyysstteemm ssuuppppoorrtt ((++))
       The shell is eight bit clean (if so compiled; see the vveerr--
       ssiioonn  shell  variable)  and  thus  supports character sets
       needing this capability.  NLS support differs depending on
       whether  or not the shell was compiled to use the system's
       NLS (again, see vveerrssiioonn).  In either case, 7-bit ASCII  is
       the default for character classification (e.g. which char-
       acters are printable) and sorting, and changing  the  LLAANNGG
       or  LLCC__CCTTYYPPEE environment variables causes a check for pos-
       sible changes in these respects.

       When using the system's NLS, the _s_e_t_l_o_c_a_l_e(3) function  is
       called  to  determine appropriate character classification
       and sorting.  This function typically  examines  the  LLAANNGG
       and  LLCC__CCTTYYPPEE  environment  variables; refer to the system
       documentation for further details.   When  not  using  the
       system's  NLS, the shell simulates it by assuming that the
       ISO 8859-1 character set is used whenever  either  of  the
       LLAANNGG  and  LLCC__CCTTYYPPEE variables are set, regardless of their
       values. Sorting is not affected for the simulated NLS.

       In addition, with both real and simulated NLS, all  print-
       able  characters  in  the range \200-\377, i.e. those that
       have M-_c_h_a_r bindings, are automatically rebound  to  _s_e_l_f_-
       _i_n_s_e_r_t_-_c_o_m_m_a_n_d.  The corresponding binding for the escape-
       _c_h_a_r sequence, if any, is left  alone.   These  characters
       are  not  rebound  if the NNOORREEBBIINNDD environment variable is
       set. This may be useful for the simulated NLS or a  primi-
       tive  real  NLS  which assumes full ISO 8859-1. Otherwise,
       all M-_c_h_a_r bindings in the range \240-\377 are effectively
       undone.  Explicitly rebinding the relevant keys with _b_i_n_d_-
       _k_e_y is of course still possible.

       Unknown characters (i.e. those that are neither  printable
       nor  control  characters)  are printed in the format \nnn.
       If the tty is not in 8 bit mode, other  8  bit  characters
       are printed by converting them to ASCII and using standout
       mode. The shell never changes the 7/8 bit mode of the  tty
       and  tracks  user-initiated  changes  of 7/8 bit mode. NLS
       users (or, for that matter, those who want to use  a  meta
       key)  may  need  to  explicitly  set the tty in 8 bit mode
       through the appropriate  _s_t_t_y(1)  command  in,  e.g.,  the
       _~_/_._l_o_g_i_n file.




Cornell 6.06.00           29 April 1995                        34





TCSH(1)                                                   TCSH(1)


   OOSS vvaarriiaanntt ssuuppppoorrtt ((++))
       A  number  of new builtin commands are provided to support
       features  in  particular  operating   systems.   All   are
       described in detail in the BBuuiillttiinn ccoommmmaannddss section.

       On   systems   that  support  TCF  (aix-ibm370,  aix-ps2),
       _g_e_t_s_p_a_t_h and _s_e_t_s_p_a_t_h get and  set  the  system  execution
       path,  _g_e_t_x_v_e_r_s  and _s_e_t_x_v_e_r_s get and set the experimental
       version prefix  and  _m_i_g_r_a_t_e  migrates  processes  between
       sites.  The _j_o_b_s builtin prints the site on which each job
       is executing.

       Under Domain/OS, _i_n_l_i_b adds shared libraries to  the  cur-
       rent  environment,  _r_o_o_t_n_o_d_e  changes the rootnode and _v_e_r
       changes the systype.

       Under Mach, _s_e_t_p_a_t_h is equivalent to Mach's _s_e_t_p_a_t_h(1).

       Under Masscomp/RTU, _u_n_i_v_e_r_s_e sets the universe.

       Under Convex/OS, _w_a_r_p prints or sets the universe.

       The VVEENNDDOORR,  OOSSTTYYPPEE  and  MMAACCHHTTYYPPEE  environment  variables
       indicate  respectively  the  vendor,  operating system and
       machine type (microprocessor class or  machine  model)  of
       the system on which the shell thinks it is running.  These
       are particularly useful when sharing one's home  directory
       between several types of machines; one can, for example,

           set  path = (~/bin.$MACHTYPE /usr/ucb /bin /usr/bin .)

       in one's _~_/_._l_o_g_i_n and put executables  compiled  for  each
       machine in the appropriate directory.

       The  vveerrssiioonn  shell  variable  indicates what options were
       chosen when the shell was compiled.

       Note also the _n_e_w_g_r_p builtin, the aaffssuusseerr  and  eecchhoo__ssttyyllee
       shell  variables and the system-dependent locations of the
       shell's input files (see FFIILLEESS).

   SSiiggnnaall hhaannddlliinngg
       Login shells  ignore  interrupts  when  reading  the  file
       _~_/_._l_o_g_o_u_t.   The shell ignores quit signals unless started
       with --qq.  Login shells catch  the  terminate  signal,  but
       non-login shells inherit the terminate behavior from their
       parents.  Other signals have the values  which  the  shell
       inherited from its parent.

       In  shell  scripts,  the shell's handling of interrupt and
       terminate signals can be controlled with _o_n_i_n_t_r,  and  its
       handling  of hangups can be controlled with _h_u_p and _n_o_h_u_p.

       The shell exits on a hangup (see  also  the  llooggoouutt  shell



Cornell 6.06.00           29 April 1995                        35





TCSH(1)                                                   TCSH(1)


       variable).   By  default, the shell's children do too, but
       the shell does not send them a hangup when it exits.   _h_u_p
       arranges for the shell to send a hangup to a child when it
       exits, and _n_o_h_u_p sets a child to ignore hangups.

   TTeerrmmiinnaall mmaannaaggeemmeenntt ((++))
       The shell uses three different sets of terminal  (``tty'')
       modes: `edit', used when editing, `quote', used when quot-
       ing literal characters, and `execute', used when executing
       commands.  The shell holds some settings in each mode con-
       stant, so commands which leave the tty in a confused state
       do  not  interfere with the shell.  The shell also matches
       changes in the speed and padding of the tty.  The list  of
       tty modes that are kept constant can be examined and modi-
       fied with the _s_e_t_t_y builtin.  Note that although the  edi-
       tor  uses CBREAK mode (or its equivalent), it takes typed-
       ahead characters anyway.

       The _e_c_h_o_t_c, _s_e_t_t_c and  _t_e_l_l_t_c  commands  can  be  used  to
       manipulate  and  debug terminal capabilities from the com-
       mand line.

       On systems that support SIGWINCH or SIGWINDOW,  the  shell
       adapts  to  window  resizing automatically and adjusts the
       environment variables LLIINNEESS and CCOOLLUUMMNNSS  if  set.  If  the
       environment  variable TTEERRMMCCAAPP contains li# and co# fields,
       the shell adjusts them to reflect the new window size.

RREEFFEERREENNCCEE
       The next sections of  this  manual  describe  all  of  the
       available  BBuuiillttiinn  ccoommmmaannddss,  SSppeecciiaall aalliiaasseess and SSppeecciiaall
       sshheellll vvaarriiaabblleess.

   BBuuiillttiinn ccoommmmaannddss
       %%_j_o_b    A synonym for the _f_g builtin command.

       %%_j_o_b &&  A synonym for the _b_g builtin command.

       ::       Does nothing, successfully.

       @@
       @@ _n_a_m_e == _e_x_p_r
       @@ _n_a_m_e[_i_n_d_e_x] == _e_x_p_r
               The first form prints  the  values  of  all  shell
               variables.   The  second  form  sets the specified
               _n_a_m_e to the value of _e_x_p_r.  If _e_x_p_r contains  `<',
               `>',  `&'  or  `'  then at least that part of _e_x_p_r
               must  be  placed  within  `()'.   The  third  form
               assigns the value of _e_x_p_r to the _i_n_d_e_x'th argument
               of _n_a_m_e.  Both _n_a_m_e  and  its  _i_n_d_e_x'th  component
               must already exist.

               _e_x_p_r  may  contain the operators `*', `+', etc. as
               in C.  The space  separating  the  name  from  the



Cornell 6.06.00           29 April 1995                        36





TCSH(1)                                                   TCSH(1)


               assignment operator is optional.  Spaces are, how-
               ever, mandatory in separating components  of  _e_x_p_r
               which would otherwise be single words.

               Special  postfix `++' and `--' operators increment
               and decrement _n_a_m_e respectively, e.g. `@ i++'.

               Note that the syntax of _e_x_p_r  has  nothing  to  do
               with that described under EExxpprreessssiioonnss.

       aalliiaass [_n_a_m_e [_w_o_r_d_l_i_s_t]]
               Without arguments, prints all aliases.  With _n_a_m_e,
               prints  the  alias  for  name.   With   _n_a_m_e   and
               _w_o_r_d_l_i_s_t,  assigns  _w_o_r_d_l_i_s_t as the alias of _n_a_m_e.
               _w_o_r_d_l_i_s_t  is  command  and  filename  substituted.
               _n_a_m_e  may  not  be `alias' or `unalias'.  See also
               the _u_n_a_l_i_a_s builtin command.

       aalllloocc   Shows the amount of dynamic memory acquired,  bro-
               ken down into used and free memory.  With an argu-
               ment shows the number of free and used  blocks  in
               each  size category.  The categories start at size
               8 and double at each step.  This command's  output
               may  vary across system types, since systems other
               than the VAX may use a different memory allocator.

       bbgg [%%_j_o_b ...]
               Puts  the  specified  jobs (or, without arguments,
               the current job) into the  background,  continuing
               each  if  it  is  stopped.  _j_o_b may be a number, a
               string, `', `%', `+' or  `-'  as  described  under
               JJoobbss.

       bbiinnddkkeeyy [--ll|--dd|--ee|--vv|--uu] (+)
       bbiinnddkkeeyy [--aa] [--bb] [--kk] [--rr] [----] _k_e_y (+)
       bbiinnddkkeeyy [--aa] [--bb] [--kk] [--cc|--ss] [----] _k_e_y _c_o_m_m_a_n_d (+)
               Without  options,  the  first form lists all bound
               keys and the  editor  command  to  which  each  is
               bound, the second form lists the editor command to
               which _k_e_y is bound and the third  form  binds  the
               editor command _c_o_m_m_a_n_d to _k_e_y.  Options include:

               --ll  Lists all editor commands and a short descrip-
                   tion of each.
               --dd  Binds all keys to the  standard  bindings  for
                   the default editor.
               --ee  Binds  all keys to the standard GNU Emacs-like
                   bindings.
               --vv  Binds all  keys  to  the  standard  _v_i(1)-like
                   bindings.
               --aa  Lists  or changes key-bindings in the alterna-
                   tive key map.  This is the key map used in  _v_i
                   command mode.
               --bb  _k_e_y  is  interpreted  as  a  control character



Cornell 6.06.00           29 April 1995                        37





TCSH(1)                                                   TCSH(1)


                   written ^_c_h_a_r_a_c_t_e_r (e.g. `^A') or  C-_c_h_a_r_a_c_t_e_r
                   (e.g.  `C-A'),  a  meta  character  written M-
                   _c_h_a_r_a_c_t_e_r (e.g. `M-A'), a function key written
                   F-_s_t_r_i_n_g  (e.g.  `F-string'),  or  an extended
                   prefix key written X-_c_h_a_r_a_c_t_e_r (e.g. `X-A').
               --kk  _k_e_y is interpreted as  a  symbolic  arrow  key
                   name, which may be one of `down', `up', `left'
                   or `right'.
               --rr  Removes _k_e_y's binding.  Be  careful:  `bindkey
                   -r'  does  _n_o_t bind _k_e_y to _s_e_l_f_-_i_n_s_e_r_t_-_c_o_m_m_a_n_d
                   (q.v.), it unbinds _k_e_y completely.
               --cc  _c_o_m_m_a_n_d is interpreted as a builtin or  exter-
                   nal command instead of an editor command.
               --ss  _c_o_m_m_a_n_d  is  taken  as  a  literal  string and
                   treated as terminal input when _k_e_y  is  typed.
                   Bound  keys in _c_o_m_m_a_n_d are themselves reinter-
                   preted, and this continues for ten  levels  of
                   interpretation.
               ----  Forces  a break from option processing, so the
                   next word is taken as _k_e_y even  if  it  begins
                   with '-'.
               --uu (or any invalid option)
                   Prints a usage message.

               _k_e_y  may  be a single character or a string.  If a
               command is bound to a string, the first  character
               of the string is bound to _s_e_q_u_e_n_c_e_-_l_e_a_d_-_i_n and the
               entire string is bound to the command.

               Control characters in _k_e_y can be literal (they can
               be typed by preceding them with the editor command
               _q_u_o_t_e_d_-_i_n_s_e_r_t, normally bound to `^V') or  written
               caret-character  style, e.g. `^A'. Delete is writ-
               ten `^?'  (caret-question mark).  _k_e_y and  _c_o_m_m_a_n_d
               can  contain  backslashed escape sequences (in the
               style of System V _e_c_h_o(1)) as follows:

                   \\aa      Bell
                   \\bb      Backspace
                   \\ee      Escape
                   \\ff      Form feed
                   \\nn      Newline
                   \\rr      Carriage return
                   \\tt      Horizontal tab
                   \\vv      Vertical tab
                   \\_n_n_n    The ASCII character  corresponding  to
                           the octal number _n_n_n

               `\' nullifies the special meaning of the following
               character, if it has any, notably `\' and `^'.

       bbrreeaakk   Causes execution to resume after the  _e_n_d  of  the
               nearest  enclosing _f_o_r_e_a_c_h or _w_h_i_l_e. The remaining
               commands on the current line are executed.  Multi-



Cornell 6.06.00           29 April 1995                        38





TCSH(1)                                                   TCSH(1)


               level breaks are thus possible by writing them all
               on one line.

       bbrreeaakkssww Causes a break from a _s_w_i_t_c_h, resuming  after  the
               _e_n_d_s_w.

       bbuuiillttiinnss (+)
               Prints the names of all builtin commands.

       bbyyee (+) A  synonym for the _l_o_g_o_u_t builtin command.  Avail-
               able only if the shell was so  compiled;  see  the
               vveerrssiioonn shell variable.

       ccaassee _l_a_b_e_l::
               A  label in a _s_w_i_t_c_h statement as discussed below.

       ccdd [--pp] [--ll] [--nn|--vv] [_n_a_m_e]
               If a directory _n_a_m_e is given, changes the  shell's
               working  directory  to  _n_a_m_e.  If  not, changes to
               hhoommee.  If _n_a_m_e is `-' it  is  interpreted  as  the
               previous  working  directory  (see OOtthheerr ssuubbssttiittuu--
               ttiioonnss). (+) If _n_a_m_e is not a subdirectory  of  the
               current  directory  (and  does not begin with `/',
               `./' or `../'), each  component  of  the  variable
               ccddppaatthh  is checked to see if it has a subdirectory
               _n_a_m_e. Finally, if all else fails  but  _n_a_m_e  is  a
               shell  variable  whose value begins with `/', then
               this is tried to see if it is a directory.

               With --pp, prints the final  directory  stack,  just
               like  _d_i_r_s.  The --ll, --nn and --vv flags have the same
               effect on _c_d as on _d_i_r_s, and they imply --pp. (+)

       cchhddiirr   A synonym for the _c_d builtin command.

       ccoommpplleettee [_c_o_m_m_a_n_d  [_w_o_r_d//_p_a_t_t_e_r_n//_l_i_s_t[::_s_e_l_e_c_t]//[[_s_u_f_f_i_x]//]
               ...]] (+)
               Without arguments, lists  all  completions.   With
               _c_o_m_m_a_n_d, lists completions for _c_o_m_m_a_n_d.  With _c_o_m_-
               _m_a_n_d and _w_o_r_d etc., defines completions.

               _c_o_m_m_a_n_d may be a full  command  name  or  a  glob-
               pattern  (see FFiilleennaammee ssuubbssttiittuuttiioonn). It can begin
               with `-' to indicate  that  completion  should  be
               used only when _c_o_m_m_a_n_d is ambiguous.

               _w_o_r_d  specifies which word relative to the current
               word is to be completed, and may  be  one  of  the
               following:

                   cc   Current-word  completion.   _p_a_t_t_e_r_n  is  a
                       glob-pattern which must match  the  begin-
                       ning  of  the  current word on the command
                       line. _p_a_t_t_e_r_n is ignored  when  completing



Cornell 6.06.00           29 April 1995                        39





TCSH(1)                                                   TCSH(1)


                       the current word.
                   CC   Like cc, but includes _p_a_t_t_e_r_n when complet-
                       ing the current word.
                   nn   Next-word completion.  _p_a_t_t_e_r_n is a  glob-
                       pattern  which must match the beginning of
                       the previous word on the command line.
                   NN   Like nn, but must match  the  beginning  of
                       the word two before the current word.
                   pp   Position-dependent completion.  _p_a_t_t_e_r_n is
                       a numeric range, with the same syntax used
                       to   index  shell  variables,  which  must
                       include the current word.

               _l_i_s_t, the list of possible completions, may be one
               of the following:

                   aa       Aliases
                   bb       Bindings (editor commands)
                   cc       Commands  (builtin  or  external  com-
                           mands)
                   CC       External commands which begin with the
                           supplied path prefix
                   dd       Directories
                   DD       Directories  which begin with the sup-
                           plied path prefix
                   ee       Environment variables
                   ff       Filenames
                   FF       Filenames which begin  with  the  sup-
                           plied path prefix
                   gg       Groupnames
                   jj       Jobs
                   ll       Limits
                   nn       Nothing
                   ss       Shell variables
                   SS       Signals
                   tt       Plain (``text'') files
                   TT       Plain  (``text'')  files  which  begin
                           with the supplied path prefix
                   vv       Any variables
                   uu       Usernames
                   xx       Like nn, but prints _s_e_l_e_c_t  when  _l_i_s_t_-
                           _c_h_o_i_c_e_s is used.
                   XX       Completions
                   $_v_a_r    Words from the variable _v_a_r
                   (...)   Words from the given list
                   `...`   Words from the output of command

               _s_e_l_e_c_t  is  an  optional  glob-pattern.  If given,
               only words from _l_i_s_t which match _s_e_l_e_c_t  are  con-
               sidered and the ffiiggnnoorree shell variable is ignored.
               The last three types of completion may not have  a
               _s_e_l_e_c_t  pattern,  and xx uses _s_e_l_e_c_t as an explana-
               tory message when the _l_i_s_t_-_c_h_o_i_c_e_s editor  command
               is used.



Cornell 6.06.00           29 April 1995                        40





TCSH(1)                                                   TCSH(1)


               _s_u_f_f_i_x  is  a single character to be appended to a
               successful completion.  If null, no  character  is
               appended.  If  omitted  (in  which case the fourth
               delimiter  can  also  be  omitted),  a  slash   is
               appended  to  directories  and  a  space  to other
               words.

               Now for some examples.  Some  commands  take  only
               directories as arguments, so there's no point com-
               pleting plain files.

                   > complete cd 'p/1/d/'

               completes  only  the  first  word  following  `cd'
               (`p/1')  with  a directory.  pp-type completion can
               also be used to narrow down command completion:

                   > co[^D]
                   complete compress
                   > complete -co* 'p/0/(compress)/'
                   > co[^D]
                   > compress

               This completion completes commands (words in posi-
               tion  0, `p/0') which begin with `co' (thus match-
               ing `co*') to `compress' (the  only  word  in  the
               list).   The  leading `-' indicates that this com-
               pletion is to be used  only  with  ambiguous  com-
               mands.

                   > complete find 'n/-user/u/'

               is  an example of nn-type completion. Any word fol-
               lowing `find' and immediately following `-user' is
               completed from the list of users.

                   > complete cc 'c/-I/d/'

               demonstrates cc-type completion. Any word following
               `cc' and beginning with `-I'  is  completed  as  a
               directory. `-I' is not taken as part of the direc-
               tory because we used lowercase cc.

               Different _l_i_s_ts are  useful  with  different  com-
               mands.

                   > complete alias 'p/1/a/'
                   > complete man 'p/*/c/'
                   > complete set 'p/1/s/'
                   > complete true 'p/1/x:Truth has no options./'

               These  complete  words  following   `alias'   with
               aliases, `man' with commands, and `set' with shell
               variables.  `true' doesn't have any options, so  xx



Cornell 6.06.00           29 April 1995                        41





TCSH(1)                                                   TCSH(1)


               does  nothing  when  completion  is  attempted and
               prints `Truth has  no  options.'  when  completion
               choices are listed.

               Note that the _m_a_n example, and several other exam-
               ples below, could just as well have used 'c/*'  or
               'n/*' as 'p/*'.

               Words  can  be completed from a variable evaluated
               at completion time,

                   > complete ftp 'p/1/$hostnames/'
                   >    set     hostnames     =     (rtfm.mit.edu
                   tesla.ee.cornell.edu)
                   > ftp [^D]
                   rtfm.mit.edu tesla.ee.cornell.edu
                   > ftp [^C]
                   >     set     hostnames     =    (rtfm.mit.edu
                   tesla.ee.cornell.edu uunet.uu.net)
                   > ftp [^D]
                   rtfm.mit.edu tesla.ee.cornell.edu uunet.uu.net

               or from a command run at completion time:

                   >   complete  kill  'p/*/`ps  |  awk  \{print\
                   \$1\}`/'
                   > kill -9 [^D]
                   23113 23377 23380 23406 23429 23529 23530 PID

               Note that the _c_o_m_p_l_e_t_e  command  does  not  itself
               quote  its arguments, so the braces, space and `$'
               in `{print $1}' must be quoted explicitly.

               One command can have multiple completions:

                   > complete dbx 'p/2/(core)/' 'p/*/c/'

               completes the second argument to  `dbx'  with  the
               word `core' and all other arguments with commands.
               Note that the positional completion  is  specified
               before  the  next-word  completion.  Since comple-
               tions are evaluated from left  to  right,  if  the
               next-word completion were specified first it would
               always match and the positional  completion  would
               never  be  executed. This is a common mistake when
               defining a completion.

               The _s_e_l_e_c_t pattern is useful when a command  takes
               only files with particular forms as arguments. For
               example,

                   > complete cc 'p/*/f:*.[cao]/'

               completes `cc' arguments only to files  ending  in



Cornell 6.06.00           29 April 1995                        42





TCSH(1)                                                   TCSH(1)


               `.c',  `.a',  or  `.o'.   _s_e_l_e_c_t  can also exclude
               files,  using  negation  of  a   glob-pattern   as
               described  under  FFiilleennaammee ssuubbssttiittuuttiioonn. One might
               use

                   >                 complete                  rm
                   'p/*/f:^*.{c,h,cc,C,tex,1,man,l,y}/'

               to  exclude precious source code from `rm' comple-
               tion. Of course, one  could  still  type  excluded
               names  manually  or override the completion mecha-
               nism using the _c_o_m_p_l_e_t_e_-_w_o_r_d_-_r_a_w or  _l_i_s_t_-_c_h_o_i_c_e_s_-
               _r_a_w editor commands (q.v.).

               The `C', `D', `F' and `T' _l_i_s_ts are like `c', `d',
               `f' and `t' respectively, but they use the  _s_e_l_e_c_t
               argument  in  a different way: to restrict comple-
               tion to files beginning  with  a  particular  path
               prefix. For example, the Elm mail program uses `='
               as an abbreviation for one's mail  directory.  One
               might use

                   > complete elm 'c@=@F:$HOME/Mail/@'

               to  complete  `elm  -f  ='  as  if it were `elm -f
               ~/Mail/'. Note that we used `@' instead of `/'  to
               avoid  confusion  with the _s_e_l_e_c_t argument, and we
               used `$HOME' instead of `~' because home directory
               substitution  only  works  at  the  beginning of a
               word.

               _s_u_f_f_i_x is used to add a  nonstandard  suffix  (not
               space  or `/' for directories) to completed words.

                   > complete finger 'c/*@/$hostnames/' 'p/1/u/@'

               completes  arguments  to `finger' from the list of
               users, appends an `@', and  then  completes  after
               the  `@' from the `hostnames' variable. Note again
               the order in which the completions are  specified.

               Finally, here's a complex example for inspiration:

                   > complete find \
                   'n/-name/f/' 'n/-newer/f/' 'n/-{,n}cpio/f/' \
                   'n/-exec/c/' 'n/-ok/c/' 'n/-user/u/' \
                   'n/-group/g/' 'n/-fstype/(nfs 4.2)/' \
                   'n/-type/(b c d f l p s)/' \
                   'c/-/(name newer cpio ncpio exec ok user \
                   group fstype type atime ctime depth inum \
                   ls mtime nogroup nouser perm print prune \
                   size xdev)/' \
                   'p/*/d/'




Cornell 6.06.00           29 April 1995                        43





TCSH(1)                                                   TCSH(1)


               This completes words following `-name',  `-newer',
               `-cpio' or `ncpio' (note the pattern which matches
               both) to files, words following `-exec'  or  `-ok'
               to commands, words following `user' and `group' to
               users and groups respectively and words  following
               `-fstype'  or  `-type'  to  members  of  the given
               lists. It also completes the  switches  themselves
               from  the  given list (note the use of cc-type com-
               pletion) and completes anything not otherwise com-
               pleted to a directory. Whew.

               Remember  that  programmed completions are ignored
               if the word being completed is a  tilde  substitu-
               tion (beginning with `~') or a variable (beginning
               with `$').  _c_o_m_p_l_e_t_e is an  experimental  feature,
               and  the  syntax  may change in future versions of
               the shell.  See also the _u_n_c_o_m_p_l_e_t_e  builtin  com-
               mand.

       ccoonnttiinnuuee
               Continues execution of the nearest enclosing _w_h_i_l_e
               or _f_o_r_e_a_c_h.  The rest of the commands on the  cur-
               rent line are executed.

       ddeeffaauulltt::
               Labels the default case in a _s_w_i_t_c_h statement.  It
               should come after all _c_a_s_e labels.

       ddiirrss [--ll] [--nn|--vv]
       ddiirrss --SS|--LL [_f_i_l_e_n_a_m_e] (+)
       ddiirrss --cc (+)
               The first form prints the directory stack. The top
               of  the  stack is at the left and the first direc-
               tory in the stack is the current directory.   With
               --ll,  `~'  or  `~_n_a_m_e'  in  the  output is expanded
               explicitly to hhoommee or the  pathname  of  the  home
               directory  for user _n_a_m_e. (+) With --nn, entries are
               wrapped before they reach the edge of the  screen.
               (+)  With  --vv,  entries  are printed one per line,
               preceded by their stack postions. (+) If more than
               one of --nn or --vv is given, --vv takes precedence.  --pp
               is accepted but does nothing.

               With --SS, the second form saves the directory stack
               to  _f_i_l_e_n_a_m_e as a series of _c_d and _p_u_s_h_d commands.
               With --LL, the shell sources _f_i_l_e_n_a_m_e, which is pre-
               sumably  a  directory  stack  file saved by the --SS
               option or the ssaavveeddiirrss mechanism.  In either case,
               ddiirrssffiillee  is  used  if  _f_i_l_e_n_a_m_e  is not given and
               _~_/_._c_s_h_d_i_r_s is used if ddiirrssffiillee is unset.

               Note that login shells do the equivalent of  `dirs
               -L'  on startup and, if ssaavveeddiirrss is set, `dirs -S'
               before  exiting.   Because   only   _~_/_._t_c_s_h_r_c   is



Cornell 6.06.00           29 April 1995                        44





TCSH(1)                                                   TCSH(1)


               normally   sourced   before  _~_/_._c_s_h_d_i_r_s,  ddiirrssffiillee
               should be set in _~_/_._t_c_s_h_r_c rather than _~_/_._l_o_g_i_n.

               The last form clears the directory stack.

       eecchhoo [--nn] _w_o_r_d ...
               Writes each _w_o_r_d to the shell's  standard  output,
               separated by spaces and terminated with a newline.
               The eecchhoo__ssttyyllee shell variable may be set  to  emu-
               late  (or  not)  the flags and escape sequences of
               the BSD and/or System  V  versions  of  _e_c_h_o;  see
               _e_c_h_o(1).

       eecchhoottcc [--ssvv] _a_r_g ... (+)
               Exercises  the  terminal  capabilities  (see _t_e_r_m_-
               _c_a_p(5)) in _a_r_g_s.  For example, 'echotc home' sends
               the  cursor to the home position, 'echotc cm 3 10'
               sends it to column 3 and row 10, and 'echotc ts 0;
               echo "This is a test."; echotc fs' prints "This is
               a test."  in the status line.

               If _a_r_g  is  'baud',  'cols',  'lines',  'meta'  or
               'tabs', prints the value of that capability ("yes"
               or "no" indicating that the terminal does or  does
               not  have  that capability). One might use this to
               make the output from a shell script  less  verbose
               on  slow terminals, or limit command output to the
               number of lines on the screen:

                   > set history=`echotc lines`
                   > @ history--

               Termcap strings may contain wildcards  which  will
               not  echo correctly.  One should use double quotes
               when setting a shell variable to a terminal  capa-
               bility  string,  as  in the following example that
               places the date in the status line:

                   > set tosl="`echotc ts 0`"
                   > set frsl="`echotc fs`"
                   > echo -n "$tosl";date; echo -n "$frsl"

               With --ss, nonexistent capabilities return the empty
               string  rather  than  causing  an error.  With --vv,
               messages are verbose.

       eellssee
       eenndd
       eennddiiff
       eennddssww   See the description of the  _f_o_r_e_a_c_h,  _i_f,  _s_w_i_t_c_h,
               and _w_h_i_l_e statements below.

       eevvaall _a_r_g ...
               Treats  the  arguments  as  input to the shell and



Cornell 6.06.00           29 April 1995                        45





TCSH(1)                                                   TCSH(1)


               executes the resulting command(s) in  the  context
               of the current shell. This is usually used to exe-
               cute commands generated as the result  of  command
               or  variable  substitution,  since  parsing occurs
               before these substitutions.   See  _t_s_e_t(1)  for  a
               sample use of _e_v_a_l.

       eexxeecc _c_o_m_m_a_n_d
               Executes  the  specified  command  in place of the
               current shell.

       eexxiitt [_e_x_p_r]
               The shell exits either with the value of the spec-
               ified  _e_x_p_r  (an  expression,  as  described under
               EExxpprreessssiioonnss) or, without _e_x_p_r, with the  value  of
               the ssttaattuuss variable.

       ffgg [%%_j_o_b ...]
               Brings  the specified jobs (or, without arguments,
               the current job) into the  foreground,  continuing
               each  if  it  is  stopped.  _j_o_b may be a number, a
               string, `', `%', `+' or  `-'  as  described  under
               JJoobbss.   See also the _r_u_n_-_f_g_-_e_d_i_t_o_r editor command.

       ffiilleetteesstt --_o_p _f_i_l_e ... (+)
               Applies _o_p (which is a file  inquiry  operator  as
               described  under  FFiillee  iinnqquuiirryy ooppeerraattoorrss) to each
               _f_i_l_e and returns the results as a  space-separated
               list.

       ffoorreeaacchh _n_a_m_e ((_w_o_r_d_l_i_s_t))
       ...
       eenndd     Successively sets the variable _n_a_m_e to each member
               of _w_o_r_d_l_i_s_t and executes the sequence of  commands
               between  this command and the matching _e_n_d.  (Both
               _f_o_r_e_a_c_h and _e_n_d  must  appear  alone  on  separate
               lines.)   The builtin command _c_o_n_t_i_n_u_e may be used
               to continue the loop prematurely and  the  builtin
               command  _b_r_e_a_k  to terminate it prematurely.  When
               this command is read from the terminal,  the  loop
               is  read  once  prompting  with  `foreach?  '  (or
               pprroommpptt22) before any statements  in  the  loop  are
               executed.   If you make a mistake typing in a loop
               at the terminal you can rub it out.

       ggeettssppaatthh (+)
               Prints the system execution path. (TCF only)

       ggeettxxvveerrss (+)
               Prints the experimental version prefix. (TCF only)

       gglloobb _w_o_r_d_l_i_s_t
               Like  _e_c_h_o,  but no `\' escapes are recognized and
               words are delimited  by  null  characters  in  the



Cornell 6.06.00           29 April 1995                        46





TCSH(1)                                                   TCSH(1)


               output.  Useful for programs which wish to use the
               shell to filename expand a list of words.

       ggoottoo _w_o_r_d
               _w_o_r_d is filename and command-substituted to  yield
               a  string  of the form `label'.  The shell rewinds
               its input as much as possible, searches for a line
               of  the form `label:', possibly preceded by blanks
               or tabs, and continues execution after that  line.

       hhaasshhssttaatt
               Prints  a statistics line indicating how effective
               the internal hash table has been at locating  com-
               mands  (and avoiding _e_x_e_c's). An _e_x_e_c is attempted
               for each component of  the  ppaatthh  where  the  hash
               function  indicates  a  possible  hit, and in each
               component which does not begin with a `/'.

       On machines without _v_f_o_r_k(2), prints only the  number  and
       size of hash buckets.  hhiissttoorryy [--hhrr] [_n]
       hhiissttoorryy --SS|--LL||--MM [_f_i_l_e_n_a_m_e] (+)
       hhiissttoorryy --cc (+)
               The  first form prints the history event list.  If
               _n is given only  the  _n  most  recent  events  are
               printed  or  saved.   With --hh, the history list is
               printed without leading  numbers  and  with  time-
               stamps  in comment form. (This can be used to pro-
               duce files suitable for loading with 'history  -L'
               or  'source  -h'.)  With --rr, the order of printing
               is most recent first rather than oldest first.

               With --SS, the second form saves the history list to
               _f_i_l_e_n_a_m_e.  If the first word of the ssaavveehhiisstt shell
               variable is set to a number,  at  most  that  many
               lines  are  saved.  If the second word of ssaavveehhiisstt
               is set to `merge', the history list is merged with
               the  existing history file instead of replacing it
               (if there is one) and sorted by  time  stamp.  (+)
               Merging  is intended for an environment like the X
               Window System with several shells in  simultaneous
               use.   Currently  it only succeeds when the shells
               quit nicely one after another.

               With --LL, the shell appends _f_i_l_e_n_a_m_e, which is pre-
               sumably  a  history list saved by the --SS option or
               the ssaavveehhiisstt mechanism, to the history  list.   --MM
               is  like  --LL,  but  the  contents  of _f_i_l_e_n_a_m_e are
               merged into the history list and sorted by  times-
               tamp.   In  either case, hhiissttffiillee is used if _f_i_l_e_-
               _n_a_m_e is not given and _~_/_._h_i_s_t_o_r_y is used if  hhiisstt--
               ffiillee  is  unset.   `history  -L'  is  exactly like
               'source -h' except that  it  does  not  require  a
               filename.




Cornell 6.06.00           29 April 1995                        47





TCSH(1)                                                   TCSH(1)


               Note  that login shells do the equivalent of `his-
               tory -L' on startup and, if ssaavveehhiisstt is set, `his-
               tory  -S'  before exiting.  Because only _~_/_._t_c_s_h_r_c
               is normally sourced  before  _~_/_._h_i_s_t_o_r_y,  hhiissttffiillee
               should be set in _~_/_._t_c_s_h_r_c rather than _~_/_._l_o_g_i_n.

               If  hhiissttlliitt  is  set,  the  first and second forms
               print and save the literal  (unexpanded)  form  of
               the history list.

               The last form clears the history list.

       hhuupp [_c_o_m_m_a_n_d] (+)
               With  _c_o_m_m_a_n_d, runs _c_o_m_m_a_n_d such that it will exit
               on a hangup signal and arranges for the  shell  to
               send  it  a  hangup  signal  when the shell exits.
               Note that commands may set their own  response  to
               hangups,  overriding  _h_u_p.   Without  an  argument
               (allowed only in a shell script), causes the shell
               to  exit  on  a  hangup  for  the remainder of the
               script.  See also SSiiggnnaall hhaannddlliinngg  and  the  _n_o_h_u_p
               builtin command.

       iiff ((_e_x_p_r)) _c_o_m_m_a_n_d
               If _e_x_p_r (an expression, as described under EExxpprreess--
               ssiioonnss) evaluates true, then _c_o_m_m_a_n_d  is  executed.
               Variable substitution on _c_o_m_m_a_n_d happens early, at
               the same time it does for the rest of the _i_f  com-
               mand.   _c_o_m_m_a_n_d  must  be a simple command, not an
               alias, a pipeline, a command list or  a  parenthe-
               sized  command  list,  but  it may have arguments.
               Input/output redirection occurs even  if  _e_x_p_r  is
               false  and _c_o_m_m_a_n_d is thus _n_o_t executed; this is a
               bug.

       iiff ((_e_x_p_r)) tthheenn
       ...
       eellssee iiff ((_e_x_p_r_2)) tthheenn
       ...
       eellssee
       ...
       eennddiiff   If the specified _e_x_p_r is true then the commands to
               the first _e_l_s_e are executed; otherwise if _e_x_p_r_2 is
               true then the commands to the second _e_l_s_e are exe-
               cuted,  etc.  Any number of _e_l_s_e_-_i_f pairs are pos-
               sible; only one _e_n_d_i_f is needed.  The _e_l_s_e part is
               likewise optional.  (The words _e_l_s_e and _e_n_d_i_f must
               appear at the beginning of  input  lines;  the  _i_f
               must  appear  alone  on its input line or after an
               _e_l_s_e.)

       iinnlliibb _s_h_a_r_e_d_-_l_i_b_r_a_r_y ... (+)
               Adds each _s_h_a_r_e_d_-_l_i_b_r_a_r_y to the  current  environ-
               ment.  There is no way to remove a shared library.



Cornell 6.06.00           29 April 1995                        48





TCSH(1)                                                   TCSH(1)


               (Domain/OS only)

       jjoobbss [--ll]
               Lists the active jobs. With --ll, lists process  IDs
               in addition to the normal information. On TCF sys-
               tems, prints the site on which each job is execut-
               ing.

       kkiillll [--_s_i_g_n_a_l] %%_j_o_b|_p_i_d ...
       kkiillll --ll The  first form sends the specified _s_i_g_n_a_l (or, if
               none is given, the TERM (terminate) signal) to the
               specified jobs or processes.  _j_o_b may be a number,
               a string, `', `%', `+' or `-' as  described  under
               JJoobbss.   Signals  are  either given by number or by
               name (as given in _/_u_s_r_/_i_n_c_l_u_d_e_/_s_i_g_n_a_l_._h,  stripped
               of  the  prefix  `SIG').  There is no default _j_o_b;
               saying just `kill' does not send a signal  to  the
               current  job.   If  the  signal being sent is TERM
               (terminate) or HUP (hangup), then the job or  pro-
               cess  is  sent  a  CONT (continue) signal as well.
               The second form lists the signal names.

       lliimmiitt [--hh] [_r_e_s_o_u_r_c_e [_m_a_x_i_m_u_m_-_u_s_e]]
               Limits the consumption by the current process  and
               each process it creates to not individually exceed
               _m_a_x_i_m_u_m_-_u_s_e on the specified _r_e_s_o_u_r_c_e. If no _m_a_x_i_-
               _m_u_m_-_u_s_e  is  given,  then  the  current  limit  is
               printed; if no _r_e_s_o_u_r_c_e is given, then all limita-
               tions  are  given.   If  the --hh flag is given, the
               hard limits are used instead of the  current  lim-
               its.  The hard limits impose a ceiling on the val-
               ues of the current limits.   Only  the  super-user
               may raise the hard limits, but a user may lower or
               raise the current limits within the legal range.

               Controllable resources currently  include  _c_p_u_t_i_m_e
               (the  maximum  number of cpu-seconds to be used by
               each process), _f_i_l_e_s_i_z_e (the largest  single  file
               which  can  be  created),  _d_a_t_a_s_i_z_e  (the  maximum
               growth of the data+stack region via sbrk(2) beyond
               the end of the program text), _s_t_a_c_k_s_i_z_e (the maxi-
               mum  size  of  the  automatically-extended   stack
               region),  _c_o_r_e_d_u_m_p_s_i_z_e  (the  size  of the largest
               core dump that will be  created),  and  _m_e_m_o_r_y_u_s_e,
               the  maximum  amount  of physical memory a process
               may have allocated to it at a given time.

               _m_a_x_i_m_u_m_-_u_s_e may be given as a (floating  point  or
               integer)  number  followed by a scale factor.  For
               all limits other than _c_p_u_t_i_m_e the default scale is
               `k' or `kilobytes' (1024 bytes); a scale factor of
               `m' or `megabytes' may also be used.  For  _c_p_u_t_i_m_e
               the  default  scaling  is `seconds', while `m' for
               minutes or `h' for hours, or a time  of  the  form



Cornell 6.06.00           29 April 1995                        49





TCSH(1)                                                   TCSH(1)


               `mm:ss' giving minutes and seconds may be used.

               For  both  _r_e_s_o_u_r_c_e names and scale factors, unam-
               biguous prefixes of the names suffice.

       lloogg (+) Prints the wwaattcchh shell  variable  and  reports  on
               each  user  indicated  in  wwaattcchh who is logged in,
               regardless of when they last logged in.  See  also
               _w_a_t_c_h_l_o_g.

       llooggiinn   Terminates  a  login  shell,  replacing it with an
               instance of _/_b_i_n_/_l_o_g_i_n_. This is  one  way  to  log
               off, included for compatibility with _s_h(1).

       llooggoouutt  Terminates  a  login  shell.  Especially useful if
               iiggnnoorreeeeooff is set.

       llss--FF [-_s_w_i_t_c_h ...] [_f_i_l_e ...] (+)
               Lists files like `ls  -F',  but  much  faster.  It
               identifies  each type of special file in the list-
               ing with a special character:

               /   Directory
               *   Executable
               #   Block device
               %   Character device
               |   Named pipe (systems with named pipes only)
               =   Socket (systems with sockets only)
               @   Symbolic link  (systems  with  symbolic  links
                   only)
               +   Hidden  directory (AIX only) or context depen-
                   dent (HP/UX only)
               :   Network special (HP/UX only)

               If the lliissttlliinnkkss shell variable is  set,  symbolic
               links  are  identified  in  more  detail (only, of
               course, on systems which have them):

               @   Symbolic link to a non-directory
               >   Symbolic link to a directory
               &   Symbolic link to nowhere

               lliissttlliinnkkss also slows down _l_s_-_F and  causes  parti-
               tions  holding  files pointed to by symbolic links
               to be mounted.

               If the lliissttffllaaggss shell variable is set to `x', `a'
               or  `A',  or  any combination thereof (e.g. `xA'),
               they are used as flags to _l_s_-_F, making it act like
               `ls  -xF',  `ls  -Fa',  `ls  -FA' or a combination
               (e.g. `ls -FxA').  On machines where  `ls  -C'  is
               not  the  default, _l_s_-_F acts like `ls -CF', unless
               lliissttffllaaggss contains an `x', in which case  it  acts
               like `ls -xF'.  _l_s_-_F passes its arguments to _l_s(1)



Cornell 6.06.00           29 April 1995                        50





TCSH(1)                                                   TCSH(1)


               if it is given any switches, so  `alias  ls  ls-F'
               generally  does  the  right  thing.  _l_s_-_F includes
               file identification characters when sorting  file-
               names; this is a bug.

       mmiiggrraattee [--_s_i_t_e] _p_i_d|%%_j_o_b_i_d ... (+)
       mmiiggrraattee --_s_i_t_e (+)
               The  first form migrates the process or job to the
               site specified or the default site  determined  by
               the system path.  The second form is equivalent to
               `migrate -_s_i_t_e $$': it migrates the  current  pro-
               cess  to  the  specified site. Migrating the shell
               itself can cause unexpected  behavior,  since  the
               shell does not like to lose its tty. (TCF only)

       nneewwggrrpp [--] _g_r_o_u_p (+)
               Equivalent   to   `exec  newgrp';  see  _n_e_w_g_r_p(1).
               Available only if the shell was so  compiled;  see
               the vveerrssiioonn shell variable.

       nniiccee [++_n_u_m_b_e_r] [_c_o_m_m_a_n_d]
               Sets the scheduling priority for the shell to _n_u_m_-
               _b_e_r, or, without _n_u_m_b_e_r, to 4. With _c_o_m_m_a_n_d,  runs
               _c_o_m_m_a_n_d  at the appropriate priority.  The greater
               the _n_u_m_b_e_r, the less cpu the  process  gets.   The
               super-user  may specify negative priority by using
               `nice -number ...'.  Command is always executed in
               a  sub-shell,  and the restrictions placed on com-
               mands in simple _i_f statements apply.

       nnoohhuupp [_c_o_m_m_a_n_d]
               With _c_o_m_m_a_n_d,  runs  _c_o_m_m_a_n_d  such  that  it  will
               ignore hangup signals.  Note that commands may set
               their own response to hangups,  overriding  _n_o_h_u_p.
               Without  an  argument  (allowed  only  in  a shell
               script), causes the shell to  ignore  hangups  for
               the remainder of the script.  See also SSiiggnnaall hhaann--
               ddlliinngg and the _h_u_p builtin command.

       nnoottiiffyy [%%_j_o_b ...]
               Causes the shell to notify the user asynchronously
               when  the status of any of the specified jobs (or,
               without %_j_o_b, the current job) changes, instead of
               waiting  until  the  next prompt as is usual.  _j_o_b
               may be a number, a string, `', `%', `+' or `-'  as
               described  under  JJoobbss.  See also the nnoottiiffyy shell
               variable.

       oonniinnttrr [--|_l_a_b_e_l]
               Controls the action of the  shell  on  interrupts.
               Without  arguments, restores the default action of
               the shell on interrupts,  which  is  to  terminate
               shell scripts or to return to the terminal command
               input level.  With `-', causes all  interrupts  to



Cornell 6.06.00           29 April 1995                        51





TCSH(1)                                                   TCSH(1)


               be  ignored.  With _l_a_b_e_l, causes the shell to exe-
               cute a `goto _l_a_b_e_l' when an interrupt is  received
               or  a  child  process  terminates  because  it was
               interrupted.

               _o_n_i_n_t_r is ignored if the shell is running detached
               and  in  system  startup  files (see FFIILLEESS), where
               interrupts are disabled anyway.

       ppooppdd [--pp] [--ll] [--nn|--vv] [++_n]
               Without arguments, pops the  directory  stack  and
               returns  to  the new top directory.  With a number
               `+_n', discards the _n'th entry in the stack.

               Finally, all forms of _p_o_p_d print the final  direc-
               tory  stack, just like _d_i_r_s. The ppuusshhddssiilleenntt shell
               variable can be set to prevent  this  and  the  --pp
               flag  can  be  given to override ppuusshhddssiilleenntt.  The
               --ll, --nn and --vv flags have the same effect  on  _p_o_p_d
               as on _d_i_r_s. (+)

       pprriinntteennvv [_n_a_m_e] (+)
               Prints  the  names  and  values of all environment
               variables or, with _n_a_m_e, the value of the environ-
               ment variable _n_a_m_e.

       ppuusshhdd [--pp] [--ll] [--nn|--vv] [_n_a_m_e|++_n]
               Without  arguments, exchanges the top two elements
               of the directory stack.  If  ppuusshhddttoohhoommee  is  set,
               _p_u_s_h_d  without  arguments does `pushd ~', like _c_d.
               (+) With _n_a_m_e, pushes the current  working  direc-
               tory onto the directory stack and changes to _n_a_m_e.
               If _n_a_m_e is `-' it is interpreted as  the  previous
               working directory (see FFiilleennaammee ssuubbssttiittuuttiioonn). (+)
               If dduunniiqquuee is set, _p_u_s_h_d removes any instances  of
               _n_a_m_e  from  the  stack  before pushing it onto the
               stack. (+) With a number  `+_n',  rotates  the  _nth
               element  of  the  directory stack around to be the
               top element and changes to  it.   If  ddeexxttrraacctt  is
               set,  however,  `pushd +_n' extracts the _nth direc-
               tory, pushes it onto the  top  of  the  stack  and
               changes to it. (+)

               Finally, all forms of _p_u_s_h_d print the final direc-
               tory stack, just like _d_i_r_s. The ppuusshhddssiilleenntt  shell
               variable  can  be  set  to prevent this and the --pp
               flag can be given to  override  ppuusshhddssiilleenntt.   The
               --ll,  --nn and --vv flags have the same effect on _p_u_s_h_d
               as on _d_i_r_s. (+)

       rreehhaasshh  Causes the internal hash table of the contents  of
               the  directories in the ppaatthh variable to be recom-
               puted.  This is needed if new commands  are  added
               to  directories  in  ppaatthh while you are logged in.



Cornell 6.06.00           29 April 1995                        52





TCSH(1)                                                   TCSH(1)


               This should only be necessary if you add  commands
               to  one  of  your own directories, or if a systems
               programmer changes the contents of one of the sys-
               tem  directories.  Also  flushes the cache of home
               directories built by tilde expansion.

       rreeppeeaatt _c_o_u_n_t _c_o_m_m_a_n_d
               The specified _c_o_m_m_a_n_d, which  is  subject  to  the
               same  restrictions  as the _c_o_m_m_a_n_d in the one line
               _i_f statement above, is executed _c_o_u_n_t times.   I/O
               redirections  occur exactly once, even if _c_o_u_n_t is
               0.

       rroooottnnooddee ////_n_o_d_e_n_a_m_e (+)
               Changes the rootnode to //_n_o_d_e_n_a_m_e,  so  that  `/'
               will  be  interpreted  as `//_n_o_d_e_n_a_m_e'. (Domain/OS
               only)

       sscchheedd (+)
       sscchheedd [++]_h_h_:_m_m _c_o_m_m_a_n_d (+)
       sscchheedd --_n (+)
               The first form prints  the  scheduled-event  list.
               The  sscchheedd shell variable may be set to define the
               format  in  which  the  scheduled-event  list   is
               printed.   The  second  form  adds  _c_o_m_m_a_n_d to the
               scheduled-event list.  For example,

                   > sched 11:00 echo It\'s eleven o\'clock.

               causes the shell to echo `It's eleven o'clock.' at
               11 AM.  The time may be in 12-hour AM/PM format

                   > sched 5pm set prompt='[%h] It\'s after 5; go
                   home: >'

               or may be relative to the current time:

                   > sched +2:15 /usr/lib/uucp/uucico -r1 -sother

               A  relative  time  specification may not use AM/PM
               format.  The third form removes item  _n  from  the
               event list:

                   > sched
                        1  Wed Apr  4 15:42  /usr/lib/uucp/uucico
                   -r1 -sother
                        2  Wed Apr  4 17:00  set prompt=[%h] It's
                   after 5; go home: >
                   > sched -2
                   > sched
                        1  Wed Apr  4 15:42  /usr/lib/uucp/uucico
                   -r1 -sother

               A command in the scheduled-event list is  executed



Cornell 6.06.00           29 April 1995                        53





TCSH(1)                                                   TCSH(1)


               just  before the first prompt is printed after the
               time when the command is scheduled.  It is  possi-
               ble  to miss the exact time when the command is to
               be run, but an overdue command will execute at the
               next  prompt.  A command which comes due while the
               shell is waiting for user input is executed  imme-
               diately.  However, normal operation of an already-
               running command will not be interrupted so that  a
               scheduled-event list element may be run.

               This mechanism is similar to, but not the same as,
               the _a_t(1) command on some Unix systems.  Its major
               disadvantage  is  that it may not run a command at
               exactly the specified time.  Its  major  advantage
               is  that  because  _s_c_h_e_d  runs  directly  from the
               shell, it has access to shell variables and  other
               structures.   This provides a mechanism for chang-
               ing one's working environment based on the time of
               day.

       sseett
       sseett _n_a_m_e ...
       sseett _n_a_m_e==_w_o_r_d ...
       sseett _n_a_m_e==((_w_o_r_d_l_i_s_t)) ...
       sseett _n_a_m_e_[_i_n_d_e_x_]==_w_o_r_d ...
       sseett --rr (+)
       sseett --rr _n_a_m_e ... (+)
       sseett --rr _n_a_m_e==_w_o_r_d ... (+)
       sseett --rr _n_a_m_e==((_w_o_r_d_l_i_s_t)) ... (+)
               The  first form of the command prints the value of
               all shell variables.  Variables which contain more
               than  a  single word print as a parenthesized word
               list.  The second  form  sets  _n_a_m_e  to  the  null
               string.   The  third  form sets _n_a_m_e to the single
               _w_o_r_d.  The fourth form sets _n_a_m_e to  the  list  of
               words  in _w_o_r_d_l_i_s_t. In all cases the value is com-
               mand and filename expanded.  The fifth  form  sets
               the  _i_n_d_e_x'th component of name to _w_o_r_d; this com-
               ponent must already exist.  The sixth  form  lists
               the  names (only) of all shell variables which are
               read-only.  The seventh form makes _n_a_m_e read-only,
               whether  or  not  it has a value.  The second form
               sets _n_a_m_e to the  null  string.   The  eighth  and
               ninth  forms  are the same as the third and fourth
               forms, but make _n_a_m_e read-only at the same time.

               These arguments can be repeated to set and/or make
               read-only  multiple variables in a single set com-
               mand.  Note, however, that variable expansion hap-
               pens  for all arguments before any setting occurs.
               Note also that `=' can be adjacent  to  both  _n_a_m_e
               and _w_o_r_d or separated from both by whitespace, but
               cannot be adjacent to only one or the other.   See
               also the _u_n_s_e_t builtin command.



Cornell 6.06.00           29 April 1995                        54





TCSH(1)                                                   TCSH(1)


       sseetteennvv [_n_a_m_e [_v_a_l_u_e]]
               Without  arguments, prints the names and values of
               all environment variables.  Given _n_a_m_e,  sets  the
               environment  variable  _n_a_m_e  to  _v_a_l_u_e or, without
               _v_a_l_u_e, to the null string.

       sseettppaatthh _p_a_t_h (+)
               Equivalent to _s_e_t_p_a_t_h(1). (Mach only)

       sseettssppaatthh LOCAL|_s_i_t_e|_c_p_u ... (+)
               Sets the system execution path. (TCF only)

       sseettttcc _c_a_p _v_a_l_u_e (+)
               Tells the shell to believe that the terminal capa-
               bility  _c_a_p  (as  defined  in  _t_e_r_m_c_a_p(5)) has the
               value _v_a_l_u_e.  No sanity checking is done.  Concept
               terminal  users  may  have to `settc xn no' to get
               proper wrapping at the rightmost column.

       sseettttyy [--dd|--qq|--xx] [--aa] [[++|--]_m_o_d_e] (+)
               Controls which tty modes (see TTeerrmmiinnaall mmaannaaggeemmeenntt)
               the  shell does not allow to change.  --dd, --qq or --xx
               tells _s_e_t_t_y to act on the `edit', `quote' or `exe-
               cute'  set  of tty modes respectively; without --dd,
               --qq or --xx, `execute' is used.

               Without other arguments, _s_e_t_t_y lists the modes  in
               the chosen set which are fixed on (`+mode') or off
               (`-mode').  The available modes, and thus the dis-
               play,  vary from system to system.  With --aa, lists
               all tty modes in the chosen  set  whether  or  not
               they  are fixed.  With ++_m_o_d_e, --_m_o_d_e or _m_o_d_e, fixes
               _m_o_d_e on or off or removes control from _m_o_d_e in the
               chosen  set.   For  example,  `setty +echok echoe'
               fixes `echok' mode on and allows commands to  turn
               `echoe'  mode  on  or  off, both when the shell is
               executing commands.

       sseettxxvveerrss [_s_t_r_i_n_g] (+)
               Set the experimental version prefix to _s_t_r_i_n_g,  or
               removes it if _s_t_r_i_n_g is omitted. (TCF only)

       sshhiifftt [_v_a_r_i_a_b_l_e]
               Without arguments, discards aarrggvv[1] and shifts the
               members of aarrggvv to the left. It is  an  error  for
               aarrggvv  not  to be set or to have less than one word
               as value. With _v_a_r_i_a_b_l_e, performs the  same  func-
               tion on _v_a_r_i_a_b_l_e.

       ssoouurrccee [--hh] _n_a_m_e [_a_r_g_s ...]
               The  shell  reads and executes commands from _n_a_m_e.
               The commands are not placed on the  history  list.
               If  any  _a_r_g_s  are given, they are placed in aarrggvv.
               (+) _s_o_u_r_c_e commands may be  nested;  if  they  are



Cornell 6.06.00           29 April 1995                        55





TCSH(1)                                                   TCSH(1)


               nested  too  deeply  the shell may run out of file
               descriptors.  An error in a _s_o_u_r_c_e  at  any  level
               terminates  all  nested _s_o_u_r_c_e commands.  With --hh,
               commands are placed on the history list instead of
               being executed, much like `history -L'.

       ssttoopp %%_j_o_b|_p_i_d ...
               Stops  the  specified  jobs or processes which are
               executing in the background.  _j_o_b may be a number,
               a  string,  `', `%', `+' or `-' as described under
               JJoobbss.  There is no default _j_o_b; saying just `stop'
               does not stop the current job.

       ssuussppeenndd Causes the shell to stop in its tracks, much as if
               it had been sent a stop signal with  ^^ZZ.  This  is
               most often used to stop shells started by _s_u(1).

       sswwiittcchh ((_s_t_r_i_n_g))
       ccaassee _s_t_r_1::
           ...
           bbrreeaakkssww
       ...
       ddeeffaauulltt::
           ...
           bbrreeaakkssww
       eennddssww   Each  case  label is successively matched, against
               the specified _s_t_r_i_n_g which is  first  command  and
               filename  expanded.   The file metacharacters `*',
               `?' and `[...]'  may be used in the  case  labels,
               which  are  variable  expanded.   If  none  of the
               labels match before a `default'  label  is  found,
               then the execution begins after the default label.
               Each case label and the default label must  appear
               at  the  beginning of a line.  The command _b_r_e_a_k_s_w
               causes execution to continue after the _e_n_d_s_w. Oth-
               erwise  control  may  fall through case labels and
               default labels as in C.  If no label  matches  and
               there is no default, execution continues after the
               _e_n_d_s_w.

       tteellllttcc (+)
               Lists the values of all terminal capabilities (see
               _t_e_r_m_c_a_p(5)).

       ttiimmee [_c_o_m_m_a_n_d]
               Executes  _c_o_m_m_a_n_d (which must be a simple command,
               not an alias, a pipeline,  a  command  list  or  a
               parenthesized command list) and prints a time sum-
               mary as described under  the  ttiimmee  variable.   If
               necessary,  an extra shell is created to print the
               time statistic when the command completes.   With-
               out _c_o_m_m_a_n_d, prints a time summary for the current
               shell and its children.




Cornell 6.06.00           29 April 1995                        56





TCSH(1)                                                   TCSH(1)


       uummaasskk [_v_a_l_u_e]
               Sets the file creation mask  to  _v_a_l_u_e,  which  is
               given  in  octal.   Common values for the mask are
               002, giving all access to the group and  read  and
               execute access to others, and 022, giving read and
               execute access to the group and  others.   Without
               _v_a_l_u_e, prints the current file creation mask.

       uunnaalliiaass _p_a_t_t_e_r_n
               Removes  all  aliases  whose  names match _p_a_t_t_e_r_n.
               `unalias *' thus removes all aliases.  It  is  not
               an error for nothing to be _u_n_a_l_i_a_sed.

       uunnccoommpplleettee _p_a_t_t_e_r_n (+)
               Removes all completions whose names match _p_a_t_t_e_r_n.
               `uncomplete *' thus removes all  completions.   It
               is not an error for nothing to be _u_n_c_o_m_p_l_e_t_ed.

       uunnhhaasshh  Disables  use  of the internal hash table to speed
               location of executed programs.

       uunniivveerrssee _u_n_i_v_e_r_s_e (+)
               Sets the universe to _u_n_i_v_e_r_s_e. (Masscomp/RTU only)

       uunnlliimmiitt [--hh] [_r_e_s_o_u_r_c_e]
               Removes  the  limitation  on  _r_e_s_o_u_r_c_e  or,  if no
               _r_e_s_o_u_r_c_e is specified, all  _r_e_s_o_u_r_c_e  limitations.
               With   --hh,   the  corresponding  hard  limits  are
               removed.  Only the super-user may do this.

       uunnsseett _p_a_t_t_e_r_n
               Removes all variables whose names  match  _p_a_t_t_e_r_n,
               unless they are read-only.  `unset *' thus removes
               all variables unless they are read-only; this is a
               bad  idea.   It  is not an error for nothing to be
               _u_n_s_e_t.

       uunnsseetteennvv _p_a_t_t_e_r_n
               Removes  all  environment  variables  whose  names
               match  _p_a_t_t_e_r_n.   `unsetenv  *'  thus  removes all
               environment variables; this is a bad idea.  It  is
               not an error for nothing to be _u_n_s_e_t_e_n_ved.

       vveerr [_s_y_s_t_y_p_e [_c_o_m_m_a_n_d]] (+)
               Without  arguments,  prints SSYYSSTTYYPPEE. With _s_y_s_t_y_p_e,
               sets SSYYSSTTYYPPEE to _s_y_s_t_y_p_e. With _s_y_s_t_y_p_e and _c_o_m_m_a_n_d,
               executes  _c_o_m_m_a_n_d  under  _s_y_s_t_y_p_e.  _s_y_s_t_y_p_e may be
               `bsd4.3' or `sys5.3'.  (Domain/OS only)

       wwaaiitt    The shell waits for all background jobs.   If  the
               shell  is  interactive,  an interrupt will disrupt
               the wait and cause the shell to  print  the  names
               and job numbers of all outstanding jobs.




Cornell 6.06.00           29 April 1995                        57





TCSH(1)                                                   TCSH(1)


       wwaarrpp _u_n_i_v_e_r_s_e (+)
               Sets the universe to _u_n_i_v_e_r_s_e. (Convex/OS only)

       wwaattcchhlloogg (+)
               An  alternate  name  for  the  _l_o_g builtin command
               (q.v.).  Available only if the shell was  so  com-
               piled; see the vveerrssiioonn shell variable.

       wwhheerree _c_o_m_m_a_n_d (+)
               Reports  all known instances of _c_o_m_m_a_n_d, including
               aliases, builtins and executables in ppaatthh.

       wwhhiicchh _c_o_m_m_a_n_d (+)
               Displays the command that will be executed by  the
               shell  after  substitutions,  ppaatthh searching, etc.
               The builtin command is just like _w_h_i_c_h(1), but  it
               correctly reports _t_c_s_h aliases and builtins and is
               10 to 100  times  faster.   See  also  the  _w_h_i_c_h_-
               _c_o_m_m_a_n_d editor command.

       wwhhiillee ((_e_x_p_r))
       ...
       eenndd     Executes  the  commands  between the _w_h_i_l_e and the
               matching  _e_n_d  while  _e_x_p_r  (an   expression,   as
               described  under  EExxpprreessssiioonnss) evaluates non-zero.
               _w_h_i_l_e and _e_n_d must appear  alone  on  their  input
               lines.   _b_r_e_a_k  and _c_o_n_t_i_n_u_e may be used to termi-
               nate or continue the  loop  prematurely.   If  the
               input  is  a  terminal,  the  user is prompted the
               first time through the loop as with _f_o_r_e_a_c_h.

   SSppeecciiaall aalliiaasseess ((++))
       If set, each of these aliases  executes  automatically  at
       the indicated time.  They are all initially undefined.

       bbeeeeppccmmdd Runs  when  the  shell  wants to ring the terminal
               bell.

       ccwwddccmmdd  Runs after every change of working directory.  For
               example,  if  the  user  is working on an X window
               system using _x_t_e_r_m(1) and  a  re-parenting  window
               manager  that  supports  title bars such as _t_w_m(1)
               and does

                   > alias cwdcmd   'echo  -n  "^[]2;${HOST}:$cwd
                   ^G"'

               then  the  shell will change the title of the run-
               ning _x_t_e_r_m(1) to be the name of the host, a colon,
               and the full current working directory.  A fancier
               way to do that is

                   >      alias       cwdcmd       'echo       -n
                   "^[]2;${HOST}:$cwd^G^[]1;${HOST}^G"'



Cornell 6.06.00           29 April 1995                        58





TCSH(1)                                                   TCSH(1)


               This  will  put the hostname and working directory
               on the title bar but only the hostname in the icon
               manager menu.

               Note  that  putting  a _c_d, _p_u_s_h_d or _p_o_p_d in _c_w_d_c_m_d
               may cause an infinite loop.  It  is  the  author's
               opinion  that  anyone  doing so will get what they
               deserve.

       ppeerriiooddiicc
               Runs every ttppeerriioodd minutes. This provides a conve-
               nient  means for checking on common but infrequent
               changes such as new mail. For example, if one does

                   > set tperiod = 30
                   > alias periodic checknews

               then  the  _c_h_e_c_k_n_e_w_s(1) program runs every 30 min-
               utes.  If _p_e_r_i_o_d_i_c is set but ttppeerriioodd is unset  or
               set to 0, _p_e_r_i_o_d_i_c behaves like _p_r_e_c_m_d.

       pprreeccmmdd  Runs just before each prompt is printed. For exam-
               ple, if one does

                   > alias precmd date

               then _d_a_t_e(1) runs just before  the  shell  prompts
               for  each  command.   There  are no limits on what
               _p_r_e_c_m_d can be set to do, but discretion should  be
               used.

       sshheellll   Specifies  the  interpreter for executable scripts
               which do not themselves  specify  an  interpreter.
               The  first  word should be a full path name to the
               desired   interpreter    (e.g.    `/bin/csh'    or
               `/usr/local/bin/tcsh').

   SSppeecciiaall sshheellll vvaarriiaabblleess
       The variables described in this section have special mean-
       ing to the shell.

       The  shell  sets  aaddddssuuffffiixx,  aarrggvv,  aauuttoollooggoouutt,  ccoommmmaanndd,
       eecchhoo__ssttyyllee,  eeddiitt,  ggiidd,  ggrroouupp, hhoommee, llooggiinnsshh, ooiidd, ppaatthh,
       pprroommpptt, pprroommpptt22, pprroommpptt33, sshheellll, sshhllvvll, ttccsshh,  tteerrmm,  ttttyy,
       uuiidd,  uusseerr  and  vveerrssiioonn  at  startup;  they do not change
       thereafter unless changed by the user. The  shell  updates
       ccwwdd,  ddiirrssttaacckk,  oowwdd  and  ssttaattuuss when necessary, and sets
       llooggoouutt on logout.

       The shell synchronizes aaffssuusseerr, ggrroouupp, hhoommee, ppaatthh,  sshhllvvll,
       tteerrmm  and  uusseerr with the environment variables of the same
       names: whenever the environment variable changes the shell
       changes  the corresponding shell variable to match (unless
       the shell variable is read-only) and vice versa. Note that



Cornell 6.06.00           29 April 1995                        59





TCSH(1)                                                   TCSH(1)


       although ccwwdd and PPWWDD have identical meanings, they are not
       synchronized in this manner, and that the shell  automati-
       cally  interconverts  the  different  formats  of ppaatthh and
       PPAATTHH.

       aaddddssuuffffiixx (+)
               If set, filename completion adds `/' to the end of
               directories and a space to the end of normal files
               when they are matched exactly.  Set by default.

       aaffssuusseerr (+)
               If set, aauuttoollooggoouutt's  autolock  feature  uses  its
               value  instead  of the local username for kerberos
               authentication.

       aammppmm (+)
               If set, all times are shown in 12-hour AM/PM  for-
               mat.

       aarrggvv    The  arguments to the shell. Positional parameters
               are taken from aarrggvv,  i.e.  `$1'  is  replaced  by
               `$argv[1]',  etc.   Set  by  default,  but usually
               empty in interactive shells.

       aauuttooccoorrrreecctt (+)
               If set, the _s_p_e_l_l_-_w_o_r_d editor command  is  invoked
               automatically before each completion attempt.

       aauuttooeexxppaanndd (+)
               If  set,  the  _e_x_p_a_n_d_-_h_i_s_t_o_r_y  editor  command  is
               invoked  automatically  before   each   completion
               attempt.

       aauuttoolliisstt (+)
               If  set, possibilities are listed after an ambigu-
               ous completion.  If set to `ambiguous', possibili-
               ties  are  listed  only when no new characters are
               added by completion.

       aauuttoollooggoouutt (+)
               The first word is the number of minutes  of  inac-
               tivity  before automatic logout. The optional sec-
               ond word is the number of  minutes  of  inactivity
               before automatic locking.  When the shell automat-
               ically logs out, it prints `auto-logout', sets the
               variable  logout  to  `automatic' and exits.  When
               the  shell  automatically  locks,  the   user   is
               required  to  enter his password to continue work-
               ing. Five incorrect attempts result  in  automatic
               logout.   Set  to  `60' (automatic logout after 60
               minutes, and no locking) by default in  login  and
               superuser  shells,  but not if the shell thinks it
               is running under a window system (i.e. the DDIISSPPLLAAYY
               environment variable is set), the tty is a pseudo-



Cornell 6.06.00           29 April 1995                        60





TCSH(1)                                                   TCSH(1)


               tty (pty) or the shell was not  so  compiled  (see
               the vveerrssiioonn shell variable).  See also the aaffssuusseerr
               and llooggoouutt shell variables.

       bbaacckkssllaasshh__qquuoottee (+)
               If set, backslashes (`\') always quote  `\',  `'',
               and  `"'. This may make complex quoting tasks eas-
               ier, but it can  cause  syntax  errors  in  _c_s_h(1)
               scripts.

       ccddppaatthh  A  list  of  directories in which _c_d should search
               for subdirectories if they  aren't  found  in  the
               current directory.

       ccoommmmaanndd (+)
               If  set, the command which was passed to the shell
               with the --cc flag (q.v.).

       ccoommpplleettee (+)
               If set to `enhance', completion  1)  ignores  case
               and  2) considers periods, hyphens and underscores
               (`.', `-' and  `_')  to  be  word  separators  and
               hyphens and underscores to be equivalent.

       ccoorrrreecctt (+)
               If   set  to  `cmd',  commands  are  automatically
               spelling-corrected.  If set  to  `complete',  com-
               mands  are  automatically  completed.   If  set to
               `all', the entire command line is corrected.

       ccwwdd     The full pathname of the current  directory.   See
               also the ddiirrssttaacckk and oowwdd shell variables.

       ddeexxttrraacctt (+)
               If set, `pushd +_n' extracts the _nth directory from
               the directory stack rather than rotating it to the
               top.

       ddiirrssffiillee (+)
               The  default location in which `dirs -S' and `dirs
               -L' look for a history file. If unset,  _~_/_._c_s_h_d_i_r_s
               is  used.   Because  only  _~_/_._t_c_s_h_r_c  is  normally
               sourced before _~_/_._c_s_h_d_i_r_s, ddiirrssffiillee should be  set
               in _~_/_._t_c_s_h_r_c rather than _~_/_._l_o_g_i_n.

       ddiirrssttaacckk (+)
               An  array  of all the directories on the directory
               stack.   `$dirstack[1]'  is  the  current  working
               directory,  `$dirstack[2]'  the first directory on
               the stack, etc.  Note  that  the  current  working
               directory  is `$dirstack[1]' but `=0' in directory
               stack substitutions,  etc.   One  can  change  the
               stack  arbitrarily  by  setting  ddiirrssttaacckk, but the
               first element (the current working  directory)  is



Cornell 6.06.00           29 April 1995                        61





TCSH(1)                                                   TCSH(1)


               always  correct.   See  also the ccwwdd and oowwdd shell
               variables.

       dduunniiqquuee (+)
               If set, _p_u_s_h_d removes any instances of  _n_a_m_e  from
               the stack before pushing it onto the stack.

       eecchhoo    If  set, each command with its arguments is echoed
               just before it is executed.  For non-builtin  com-
               mands   all   expansions   occur  before  echoing.
               Builtin commands are  echoed  before  command  and
               filename  substitution,  since these substitutions
               are then done selectively.  Set by the --xx  command
               line option.

       eecchhoo__ssttyyllee (+)
               The style of the _e_c_h_o builtin. May be set to

               bsd     Don't echo a newline if the first argument
                       is `-n'.
               sysv    Recognize backslashed escape sequences  in
                       echo strings.
               both    Recognize  both  the  `-n'  flag and back-
                       slashed escape sequences; the default.
               none    Recognize neither.

               Set by default to `both'. The  BSD  and  System  V
               options  are  described in the _e_c_h_o(1) manpages on
               the appropriate systems.

       eeddiitt (+)
               If set, the command-line editor is used.   Set  by
               default in interactive shells.

       eelllliippssiiss (+)
               If  set,  the  `%c'/`%.' and `%C' prompt sequences
               (see the pprroommpptt shell variable)  indicate  skipped
               directories  with  an ellipsis (`...')  instead of
               `/<skipped>'.

       ffiiggnnoorree (+)
               Lists file name suffixes to be ignored by  comple-
               tion.

       ffiilleecc   In  _t_c_s_h, completion is always used and this vari-
               able is ignored.  If set in _c_s_h, filename  comple-
               tion is used.

       ggiidd (+) The user's real group ID.

       ggrroouupp (+)
               The user's group name.





Cornell 6.06.00           29 April 1995                        62





TCSH(1)                                                   TCSH(1)


       hhiissttcchhaarrss
               A  string value determining the characters used in
               HHiissttoorryy ssuubbssttiittuuttiioonn (q.v.).  The first  character
               of  its  value is used as the history substitution
               character, replacing the  default  character  `!'.
               The  second  character  of  its value replaces the
               character `^' in quick substitutions.

       hhiissttdduupp (+)
               Controls handling of duplicate entries in the his-
               tory  list.   If  set to `all' only unique history
               events are entered in the history list. If set  to
               `prev'  and  the last history event is the same as
               the current command, then the current  command  is
               not entered in the history.  If set to `erase' and
               the same event is found in the history list,  that
               old  event  gets  erased  and the current one gets
               inserted.

       hhiissttffiillee (+)
               The default location in  which  `history  -S'  and
               `history  -L'  look  for a history file. If unset,
               _~_/_._h_i_s_t_o_r_y is used.  hhiissttffiillee is useful when shar-
               ing  the  same  home  directory  between different
               machines, or when  saving  separate  histories  on
               different  terminals.   Because  only _~_/_._t_c_s_h_r_c is
               normally  sourced  before   _~_/_._h_i_s_t_o_r_y,   hhiissttffiillee
               should be set in _~_/_._t_c_s_h_r_c rather than _~_/_._l_o_g_i_n.

       hhiissttlliitt (+)
               If  set, builtin and editor commands and the ssaavvee--
               hhiisstt mechanism use the literal  (unexpanded)  form
               of  lines  in the history list.  See also the _t_o_g_-
               _g_l_e_-_l_i_t_e_r_a_l_-_h_i_s_t_o_r_y editor command.

       hhiissttoorryy The first word indicates  the  number  of  history
               events  to  save.   The  optional  second word (+)
               indicates the format in which history is  printed;
               if  not given, `%h\t%T\t%R\n' is used.  The format
               sequences are described below under  pprroommpptt;  note
               the  variable  meaning  of  `%R'.  Set to `100' by
               default.

       hhoommee    Initialized to the home directory of the  invoker.
               The filename expansion of `_~' refers to this vari-
               able.

       iiggnnoorreeeeooff
               If set to the empty string or `0'  and  the  input
               device  is  a  terminal,  the  _e_n_d_-_o_f_-_f_i_l_e command
               (usually generated by the user by typing  `^D'  on
               an  empty  line)  causes  the  shell to print `Use
               "exit" to leave tcsh.' instead of  exiting.   This
               prevents the shell from accidentally being killed.



Cornell 6.06.00           29 April 1995                        63





TCSH(1)                                                   TCSH(1)


               If set to a number _n, the shell ignores _n - 1 con-
               secutive _e_n_d_-_o_f_-_f_i_l_es and exits on the _nth. (+) If
               unset, `1' is used, i.e. the shell exits on a sin-
               gle `^D'.

       iinnppuuttmmooddee (+)
               If set to `insert' or `overwrite', puts the editor
               into that input mode  at  the  beginning  of  each
               line.

       lliissttffllaaggss (+)
               If  set  to  `x',  `a'  or `A', or any combination
               thereof (e.g. `xA'), they are  used  as  flags  to
               _l_s_-_F,  making  it act like `ls -xF', `ls -Fa', `ls
               -FA' or a combination (e.g. `ls -FxA'): `a'  shows
               all  files  (even  if  they start with a `.'), `A'
               shows all files but `.' and `..',  and  `x'  sorts
               across  instead  of  down.   If the second word of
               lliissttffllaaggss is set,  it  is  used  as  the  path  to
               `ls(1)'.

       lliissttjjoobbss (+)
               If  set,  all  jobs  are listed when a job is sus-
               pended. If set to `long', the listing is  in  long
               format.

       lliissttlliinnkkss (+)
               If set, the _l_s_-_F builtin command shows the type of
               file to which each symbolic link points.

       lliissttmmaaxx (+)
               The maximum number of items which the _l_i_s_t_-_c_h_o_i_c_e_s
               editor command will list without asking first.

       lliissttmmaaxxrroowwss (+)
               The  maximum  number  of  rows  of items which the
               _l_i_s_t_-_c_h_o_i_c_e_s editor command will list without ask-
               ing first.

       llooggiinnsshh (+)
               Set  by the shell if it is a login shell.  Setting
               or unsetting it within a shell has no effect.  See
               also sshhllvvll.

       llooggoouutt (+)
               Set  by  the  shell  to  `normal'  before a normal
               logout, `automatic' before  an  automatic  logout,
               and  `hangup'  if the shell was killed by a hangup
               signal (see SSiiggnnaall hhaannddlliinngg).  See also the aauuttooll--
               ooggoouutt shell variable.

       mmaaiill    The names of the files or directories to check for
               incoming  mail,  separated  by   whitespace,   and
               optionally  preceeded  by  a numeric word.  Before



Cornell 6.06.00           29 April 1995                        64





TCSH(1)                                                   TCSH(1)


               each prompt, if 10 minutes have passed  since  the
               last  check,  the  shell checks each file and says
               `You have new mail.' (or, if mmaaiill contains  multi-
               ple  files,  `You  have new mail in _n_a_m_e.') if the
               filesize is greater than zero in size  and  has  a
               modification time greater than its access time.


               If  you are in a login shell, then no mail file is
               reported unless it has  been  modified  after  the
               time the shell has started up, in order to prevent
               redundant notifications.  Most login programs will
               tell you whether or not you have mail when you log
               in.

               If a file specified in mmaaiill is  a  directory,  the
               shell  will  count each file within that directory
               as a separate message, and will report `You have _n
               mails.'  or  `You have _n mails in _n_a_m_e.' as appro-
               priate.  This functionality is provided  primarily
               for those systems which store mail in this manner,
               such as the Andrew Mail System.

               If the first word of mmaaiill is numeric it  is  taken
               as a different mail checking interval, in seconds.

               Under  very  rare  circumstances,  the  shell  may
               report  `You  have mail.' instead of `You have new
               mail.'

       mmaattcchhbbeeeepp (+)
               If set to `never', completion never beeps.  If set
               to  `nomatch',  it  beeps  only  when  there is no
               match.  If set to `ambiguous, it beeps when  there
               are  multiple  matches.  If set to `notunique', it
               beeps when there is one  exact  and  other  longer
               matches.  If unset, `ambiguous' is used.

       nnoobbeeeepp (+)
               If  set, beeping is completely disabled.  See also
               vviissiibblleebbeellll.

       nnoocclloobbbbeerr
               If set, restrictions are placed on output redirec-
               tion  to  insure  that  files are not accidentally
               destroyed and  that  `>>'  redirections  refer  to
               existing  files,  as described in the IInnppuutt//oouuttppuutt
               section.

       nnoogglloobb  If set, FFiilleennaammee ssuubbssttiittuuttiioonn and DDiirreeccttoorryy  ssttaacckk
               ssuubbssttiittuuttiioonn  (q.v.)  are inhibited.  This is most
               useful in shell scripts which  do  not  deal  with
               filenames,  or  after a list of filenames has been
               obtained and further expansions are not desirable.



Cornell 6.06.00           29 April 1995                        65





TCSH(1)                                                   TCSH(1)


       nnookkaannjjii (+)
               If  set and the shell supports Kanji (see the vveerr--
               ssiioonn shell variable), it is disabled so  that  the
               meta key can be used.

       nnoonnoommaattcchh
               If set, a FFiilleennaammee ssuubbssttiittuuttiioonn or DDiirreeccttoorryy ssttaacckk
               ssuubbssttiittuuttiioonn  (q.v.)  which  does  not  match  any
               existing files is left untouched rather than caus-
               ing an error.  It is still an error for  the  sub-
               stitution  to  be  malformed,  e.g. `echo [' still
               gives an error.

       nnoossttaatt (+)
               A list  of  directories  (or  glob-patterns  which
               match directories; see FFiilleennaammee ssuubbssttiittuuttiioonn) that
               should not be _s_t_a_t(2)ed during a completion opera-
               tion.  This is usually used to exclude directories
               which take too much time to _s_t_a_t(2),  for  example
               _/_a_f_s.

       nnoottiiffyy  If  set, the shell announces job completions asyn-
               chronously.  The default is to present job comple-
               tions just before printing a prompt.

       ooiidd (+) The user's real organization ID. (Domain/OS only)

       oowwdd (+) The  old  working directory, equivalent to the `-'
               used by _c_d  and  _p_u_s_h_d.   See  also  the  ccwwdd  and
               ddiirrssttaacckk shell variables.

       ppaatthh    A  list  of  directories in which to look for exe-
               cutable commands.  A null word specifies the  cur-
               rent directory.  If there is no ppaatthh variable then
               only full path names will execute.  ppaatthh is set by
               the  shell  at  startup  from the PPAATTHH environment
               variable or, if PPAATTHH does not exist, to a  system-
               dependent  default something like `(/usr/local/bin
               /usr/bsd /bin /usr/bin .)'.  The shell may put `.'
               first  or last in ppaatthh or omit it entirely depend-
               ing on how it was compiled; see the vveerrssiioonn  shell
               variable.   A  shell which is given neither the --cc
               nor the --tt  option  hashes  the  contents  of  the
               directories  in  ppaatthh  after reading _~_/_._t_c_s_h_r_c and
               each time ppaatthh is reset.  If one adds a  new  com-
               mand  to  a  directory  in ppaatthh while the shell is
               active, one may need to do a _r_e_h_a_s_h for the  shell
               to find it.

       pprriinntteexxiittvvaalluuee (+)
               If  set  and  an  interactive program exits with a
               non-zero status, the shell prints `Exit ssttaattuuss'.

       pprroommpptt  The string which is printed  before  reading  each



Cornell 6.06.00           29 April 1995                        66





TCSH(1)                                                   TCSH(1)


               command from the terminal.  pprroommpptt may include any
               of the following formatting sequences  (+),  which
               are replaced by the given information:

               %/  The current working directory.
               %~  The  current working directory, but with one's
                   home directory represented by  `~'  and  other
                   users' home directories represented by `~user'
                   as per FFiilleennaammee ssuubbssttiittuuttiioonn. `~user'  substi-
                   tution  happens  only if the shell has already
                   used `~_u_s_e_r' in a pathname in the current ses-
                   sion.
               %c[[0]_n], %.[[0]_n]
                   The  trailing component of the current working
                   directory, or _n trailing components if a digit
                   _n  is given.  If _n begins with `0', the number
                   of skipped  components  precede  the  trailing
                   component(s)        in        the       format
                   `/<_s_k_i_p_p_e_d>trailing'.  If the  eelllliippssiiss  shell
                   variable is set, skipped components are repre-
                   sented by an ellipsis  so  the  whole  becomes
                   `...trailing'.  `~' substitution is done as in
                   `%~' above, but the `~' component  is  ignored
                   when counting trailing components.
               %C  Like %c, but without `~' substitution.
               %h, %!, !
                   The current history event number.
               %M  The full hostname.
               %m  The hostname up to the first `.'.
               %S (%s)
                   Start (stop) standout mode.
               %B (%b)
                   Start (stop) boldfacing mode.
               %U (%u)
                   Start (stop) underline mode.
               %t, %@
                   The time of day in 12-hour AM/PM format.
               %T  Like  `%t', but in 24-hour format (but see the
                   aammppmm shell variable).
               %p  The `precise' time of  day  in  12-hour  AM/PM
                   format, with seconds.
               %P  Like  `%p', but in 24-hour format (but see the
                   aammppmm shell variable).
               \_c  _c is parsed as in _b_i_n_d_k_e_y.
               ^_c  _c is parsed as in _b_i_n_d_k_e_y.
               %%  A single `%'.
               %n  The user name.
               %d  The weekday in `Day' format.
               %D  The day in `dd' format.
               %w  The month in `Mon' format.
               %W  The month in `mm' format.
               %y  The year in `yy' format.
               %Y  The year in `yyyy' format.
               %l  The shell's tty.



Cornell 6.06.00           29 April 1995                        67





TCSH(1)                                                   TCSH(1)


               %L  Clears from the end of the prompt  to  end  of
                   the display or the end of the line.
               %#  `>' (or the first character of the pprroommppttcchhaarrss
                   shell variable) for normal users, `#' (or  the
                   second character of pprroommppttcchhaarrss) for the supe-
                   ruser.
               %{_s_t_r_i_n_g%}
                   Includes _s_t_r_i_n_g as a literal escape  sequence.
                   It  should  be  used  only  to change terminal
                   attributes and  should  not  move  the  cursor
                   location.  This cannot be the last sequence in
                   pprroommpptt.
               %?  The return code of the command  executed  just
                   before the prompt.
               %R  In  pprroommpptt22,  the  status  of  the parser.  In
                   pprroommpptt33, the corrected  string.   In  hhiissttoorryy,
                   the history string.

               `%B',  `%S',  `%U'  and `%{_s_t_r_i_n_g%}' are available
               only in eight-bit-clean shells;  see  the  vveerrssiioonn
               shell variable.

               The  bold,  standout  and  underline sequences are
               often used to distinguish a superuser  shell.  For
               example,

                   >  set  prompt  =  "%m  [%h] %B[%@]%b [%/] you
                   rang? "
                   tut [37] [[22::5544ppmm]] [/usr/accts/sys] you rang? _

               Set by default to `%# ' in interactive shells.

       pprroommpptt22 (+)
               The string with which to prompt in _w_h_i_l_e and _f_o_r_e_-
               _a_c_h loops and after lines ending in `\'.  The same
               format  sequences may be used as in pprroommpptt (q.v.);
               note the variable meaning of `%R'.  Set by default
               to `%R? ' in interactive shells.

       pprroommpptt33 (+)
               The  string  with  which to prompt when confirming
               automatic spelling correction.   The  same  format
               sequences  may  be  used as in pprroommpptt (q.v.); note
               the variable meaning of `%R'.  Set by  default  to
               `CORRECT>%R (y|n|e)? ' in interactive shells.

       pprroommppttcchhaarrss (+)
               If  set (to a two-character string), the `%#' for-
               matting sequence in the pprroommpptt shell  variable  is
               replaced with the first character for normal users
               and the second character for the superuser.

       ppuusshhddttoohhoommee (+)
               If set, _p_u_s_h_d without arguments  does  `pushd  ~',



Cornell 6.06.00           29 April 1995                        68





TCSH(1)                                                   TCSH(1)


               like _c_d.

       ppuusshhddssiilleenntt (+)
               If  set, _p_u_s_h_d and _p_o_p_d do not print the directory
               stack.

       rreecceexxaacctt (+)
               If set, completion completes  on  an  exact  match
               even if a longer match is possible.

       rreeccooggnniizzee__oonnllyy__eexxeeccuuttaabblleess (+)
               If set, command listing displays only files in the
               path that are executable. Slow.

       rrmmssttaarr (+)
               If set, the user is prompted before `rm *' is exe-
               cuted.

       ssaavveeddiirrss (+)
               If set, the shell does `dirs -S' before exiting.

       ssaavveehhiisstt
               If  set,  the shell does `history -S' before exit-
               ing.  If the first word is set  to  a  number,  at
               most  that many lines are saved.  (The number must
               be less than or equal to hhiissttoorryy.)  If the  second
               word is set to `merge', the history list is merged
               with the existing history file instead of  replac-
               ing  it (if there is one) and sorted by time stamp
               and the most recent events are retained. (+)

       sscchheedd (+)
               The format in  which  the  _s_c_h_e_d  builtin  command
               prints    scheduled    events;   if   not   given,
               `%h\t%T\t%R\n' is used.  The format sequences  are
               described  above  under  pprroommpptt; note the variable
               meaning of `%R'.

       sshheellll   The file in which the shell resides.  This is used
               in  forking  shells  to interpret files which have
               execute bits set, but which are not executable  by
               the  system.   (See the description of BBuuiillttiinn aanndd
               nnoonn--bbuuiillttiinn ccoommmmaanndd  eexxeeccuuttiioonn.)   Initialized  to
               the (system-dependent) home of the shell.

       sshhllvvll (+)
               The  number of nested shells.  Reset to 1 in login
               shells.  See also llooggiinnsshh.

       ssttaattuuss  The status returned by the last  command.   If  it
               terminated  abnormally,  then 0200 is added to the
               status.  Builtin commands which fail  return  exit
               status `1', all other builtin commands return sta-
               tus `0'.



Cornell 6.06.00           29 April 1995                        69





TCSH(1)                                                   TCSH(1)


       ssyymmlliinnkkss (+)
               Can be set to several different values to  control
               symbolic link (`symlink') resolution:

               If  set to `chase', whenever the current directory
               changes to a directory containing a symbolic link,
               it  is  expanded to the real name of the directory
               to which the link points. This does not  work  for
               the user's home directory; this is a bug.

               If set to `ignore', the shell tries to construct a
               current directory relative to the  current  direc-
               tory before the link was crossed.  This means that
               _c_ding through a symbolic link and then `cd  ..'ing
               returns  one  to the original directory. This only
               affects builtin commands and filename  completion.

               If  set  to  `expand', the shell tries to fix sym-
               bolic links by actually expanding arguments  which
               look  like  path  names. This affects any command,
               not just builtins. Unfortunately,  this  does  not
               work  for  hard-to-recognize  filenames,  such  as
               those embedded in command options.  Expansion  may
               be  prevented  by  quoting.  While this setting is
               usually the most convenient, it is sometimes  mis-
               leading  and  sometimes confusing when it fails to
               recognize an argument which should be expanded.  A
               compromise  is  to use `ignore' and use the editor
               command _n_o_r_m_a_l_i_z_e_-_p_a_t_h (bound by default to  ^X-n)
               when necessary.

               Some  examples  are  in order. First, let's set up
               some play directories:

                   > cd /tmp
                   > mkdir from from/src to
                   > ln -s from/src to/dist

               Here's the behavior with ssyymmlliinnkkss unset,

                   > cd /tmp/to/dist; echo $cwd
                   /tmp/to/dist
                   > cd ..; echo $cwd
                   /tmp/from

               here's the behavior with ssyymmlliinnkkss set to `chase',

                   > cd /tmp/to/dst; echo $cwd
                   /tmp/from/src
                   > cd ..; echo $cwd
                   /tmp/from

               here's the behavior with ssyymmlliinnkkss set to `ignore',




Cornell 6.06.00           29 April 1995                        70





TCSH(1)                                                   TCSH(1)


                   > cd /tmp/to/dist; echo $cwd
                   /tmp/to/dst
                   > cd ..; echo $cwd
                   /tmp/to

               and  here's  the  behavior  with  ssyymmlliinnkkss  set to
               `expand'.

                   > cd /tmp/to/dist; echo $cwd
                   /tmp/to/dst
                   > cd ..; echo $cwd
                   /tmp/to
                   > cd /tmp/to/dist; echo $cwd
                   /tmp/to/dst
                   > cd ".."; echo $cwd
                   /tmp/from
                   > /bin/echo ..
                   /tmp/to
                   > /bin/echo ".."
                   ..

               Note that `expand' expansion 1)  works  just  like
               `ignore'  for builtins like _c_d, 2) is prevented by
               quoting,  and  3)  happens  before  filenames  are
               passed to non-builtin commands.

       ttccsshh (+)
               The  version  number  of  the  shell in the format
               `R.VV.PP', where `R' is the major release  number,
               `VV'  the current version and `PP' the patchlevel.

       tteerrmm    The terminal type.  Usually  set  in  _~_/_._l_o_g_i_n  as
               described under SSttaarrttuupp aanndd sshhuuttddoowwnn.

       ttiimmee    If  set  to a number, then the _t_i_m_e builtin (q.v.)
               executes automatically after  each  command  which
               takes  more  than that many CPU seconds.  If there
               is a second word, it is used as  a  format  string
               for  the  output of the _t_i_m_e builtin. (u) The fol-
               lowing sequences may be used in the format string:

               %U  The time the process spent in user mode in cpu
                   seconds.
               %S  The time the process spent in kernel  mode  in
                   cpu seconds.
               %E  The elapsed (wall clock) time in seconds.
               %P  The CPU percentage computed as (%U + %S) / %E.
               %W  Number of times the process was swapped.
               %X  The average amount in (shared) text space used
                   in Kbytes.
               %D  The  average  amount  in (unshared) data/stack
                   space used in Kbytes.
               %K  The total space used (%X + %D) in Kbytes.
               %M  The maximum memory the process had in  use  at



Cornell 6.06.00           29 April 1995                        71





TCSH(1)                                                   TCSH(1)


                   any time in Kbytes.
               %F  The  number  of major page faults (page needed
                   to be brought from disk).
               %R  The number of minor page faults.
               %I  The number of input operations.
               %O  The number of output operations.
               %r  The number of socket messages received.
               %s  The number of socket messages sent.
               %k  The number of signals received.
               %w  The  number  of  voluntary  context   switches
                   (waits).
               %c  The number of involuntary context switches.

               Only  the  first  four  sequences are supported on
               systems without BSD resource limit functions.  The
               default  time  format  is  `%Uu  %Ss  %E %P %X+%Dk
               %I+%Oio  %Fpf+%Ww'  for   systems   that   support
               resource  usage  reporting and `%Uu %Ss %E %P' for
               systems that do not.

               Under Sequent's DYNIX/ptx, %X, %D, %K, %r  and  %s
               are  not  available,  but the following additional
               sequences are:

               %Y  The number of system calls performed.
               %Z  The number of pages which are  zero-filled  on
                   demand.
               %i  The  number  of times a process's resident set
                   size was increased by the kernel.
               %d  The number of times a process's  resident  set
                   size was decreased by the kernel.
               %l  The number of read system calls performed.
               %m  The number of write system calls performed.
               %p  The number of reads from raw disk devices.
               %q  The number of writes to raw disk devices.

               and  the  default  time  format  is `%Uu %Ss $E %P
               %I+%Oio %Fpf+%Ww'.  Note that the  CPU  percentage
               can be higher than 100% on multi-processors.

       ttppeerriioodd (+)
               The  period, in minutes, between executions of the
               _p_e_r_i_o_d_i_c special alias.

       ttttyy (+) The name of the tty, or empty if not  attached  to
               one.

       uuiidd (+) The user's real user ID.

       uusseerr    The user's login name.

       vveerrbboossee If  set,  causes  the  words of each command to be
               printed, after history substitution (if any).  Set
               by the --vv command line option.



Cornell 6.06.00           29 April 1995                        72





TCSH(1)                                                   TCSH(1)


       vveerrssiioonn (+)
               The version ID stamp. It contains the shell's ver-
               sion number (see ttccsshh), origin, release date, ven-
               dor,  operating  system  and  machine (see VVEENNDDOORR,
               OOSSTTYYPPEE and MMAACCHHTTYYPPEE) and a comma-separated list of
               options  which  were set at compile time.  Options
               which are set by default in the  distribution  are
               noted.

               8b  The shell is eight bit clean; default
               7b  The shell is not eight bit clean
               nls The  system's NLS is used; default for systems
                   with NLS
               lf  Login  shells  execute  _/_e_t_c_/_c_s_h_._l_o_g_i_n  before
                   instead  of  after _/_e_t_c_/_c_s_h_._c_s_h_r_c and _~_/_._l_o_g_i_n
                   before instead of after _~_/_._t_c_s_h_r_c and  _~_/_._h_i_s_-
                   _t_o_r_y.
               dl  `.' is put last in ppaatthh for security; default
               nd  `.' is omitted from ppaatthh for security
               vi  _v_i-style  editing  is  the default rather than
                   _e_m_a_c_s
               dtr Login shells drop DTR when exiting
               bye _b_y_e is a synonym for  _l_o_g_o_u_t  and  _l_o_g  is  an
                   alternate name for _w_a_t_c_h_l_o_g
               al  aauuttoollooggoouutt is enabled; default
               kan Kanji  is  used  and  the ISO character set is
                   ignored, unless the nnookkaannjjii shell variable  is
                   set
               sm  The system's _m_a_l_l_o_c(3) is used
               hb  The  `#!<program>  <args>'  convention is emu-
                   lated when executing shell scripts
               ng  The _n_e_w_g_r_p builtin is available
               rh  The shell attempts to set the RREEMMOOTTEEHHOOSSTT envi-
                   ronment variable
               afs The shell verifies your password with the ker-
                   beros server if  local  authentication  fails.
                   The  aaffssuusseerr  shell  variable  or  the AAFFSSUUSSEERR
                   environment variable override your local user-
                   name if set.

               An  administrator  may enter additional strings to
               indicate differences in the local version.

       vviissiibblleebbeellll (+)
               If set, a screen flash is  used  rather  than  the
               audible bell.  See also nnoobbeeeepp.

       wwaattcchh (+)
               A  list of user/terminal pairs to watch for logins
               and logouts.  If either the user is `any' all ter-
               minals  are  watched  for  the given user and vice
               versa.  Setting wwaattcchh to `(any any)'  watches  all
               users and terminals.  For example,




Cornell 6.06.00           29 April 1995                        73





TCSH(1)                                                   TCSH(1)


                   set  watch  =  (george ttyd1 any console $user
                   any)

               reports activity of the user  `george'  on  ttyd1,
               any  user  on the console, and oneself (or a tres-
               passer) on any terminal.

               Logins and logouts are checked every 10 minutes by
               default, but the first word of wwaattcchh can be set to
               a number to check  every  so  many  minutes.   For
               example,

                   set watch = (1 any any)

               reports  any  login/logout  once every minute. For
               the impatient, the _l_o_g builtin command triggers  a
               wwaattcchh  report  at any time. All current logins are
               reported (as with the _l_o_g builtin) when  wwaattcchh  is
               first set.

               The  wwhhoo  shell  variable  controls  the format of
               wwaattcchh reports.

       wwhhoo (+) The format string for wwaattcchh messages. The  follow-
               ing  sequences  are replaced by the given informa-
               tion:

               %n  The name of the user who logged in/out.
               %a  The observed action, i.e. `logged on', `logged
                   off' or `replaced _o_l_d_u_s_e_r on'.
               %l  The  terminal  (tty)  on which the user logged
                   in/out.
               %M  The full  hostname  of  the  remote  host,  or
                   `local' if the login/logout was from the local
                   host.
               %m  The hostname of the  remote  host  up  to  the
                   first  `.'.  The full name is printed if it is
                   an IP address or an X Window System display.

               %M and %m are  available  only  on  systems  which
               store the remote hostname in _/_e_t_c_/_u_t_m_p.  If unset,
               `%n has %a %l from %m.' is used,  or  `%n  has  %a
               %l.' on systems which don't store the remote host-
               name.

       wwoorrddcchhaarrss (+)
               A list of non-alphanumeric characters to  be  con-
               sidered  part of a word by the _f_o_r_w_a_r_d_-_w_o_r_d, _b_a_c_k_-
               _w_a_r_d_-_w_o_r_d  etc.  editor   commands.    If   unset,
               `*?_-.[]~=' is used.

EENNVVIIRROONNMMEENNTT
       AAFFSSUUSSEERR (+)
               Equivalent to the aaffssuusseerr shell variable.



Cornell 6.06.00           29 April 1995                        74





TCSH(1)                                                   TCSH(1)


       CCOOLLUUMMNNSS The  number of columns in the terminal. See TTeerrmmii--
               nnaall mmaannaaggeemmeenntt.

       DDIISSPPLLAAYY Used by X Window System (see _X(1)).  If  set,  the
               shell does not set aauuttoollooggoouutt (q.v.).

       EEDDIITTOORR  The  pathname  to  a default editor.  See also the
               VVIISSUUAALL environment variable and the  _r_u_n_-_f_g_-_e_d_i_t_o_r
               editor command.

       GGRROOUUPP (+)
               Equivalent to the ggrroouupp shell variable.

       HHOOMMEE    Equivalent to the hhoommee shell variable.

       HHOOSSTT (+)
               Initialized  to  the  name of the machine on which
               the shell is running, as determined by  the  _g_e_t_h_-
               _o_s_t_n_a_m_e(2) system call.

       HHOOSSTTTTYYPPEE (+)
               Initialized  to  the  type of machine on which the
               shell is running, as determined at  compile  time.
               This variable is obsolete and will be removed in a
               future version.

       HHPPAATTHH (+)
               A colon-separated list of directories in which the
               _r_u_n_-_h_e_l_p editor command looks for command documen-
               tation.

       LLAANNGG    Gives the preferred  character  environment.   See
               NNaattiivvee LLaanngguuaaggee SSyysstteemm ssuuppppoorrtt.

       LLCC__CCTTYYPPEE
               If  set, only ctype character handling is changed.
               See NNaattiivvee LLaanngguuaaggee SSyysstteemm ssuuppppoorrtt.

       LLIINNEESS   The number of lines in the terminal. See  TTeerrmmiinnaall
               mmaannaaggeemmeenntt.

       MMAACCHHTTYYPPEE (+)
               The  machine type (microprocessor class or machine
               model), as determined at compile time.

       NNOORREEBBIINNDD (+)
               If set, printable characters are  not  rebound  to
               _s_e_l_f_-_i_n_s_e_r_t_-_c_o_m_m_a_n_d.   See  NNaattiivvee LLaanngguuaaggee SSyysstteemm
               ssuuppppoorrtt.

       OOSSTTYYPPEE (+)
               The operating system,  as  determined  at  compile
               time.




Cornell 6.06.00           29 April 1995                        75





TCSH(1)                                                   TCSH(1)


       PPAATTHH    A  colon-separated list of directories in which to
               look for  executables.   Equivalent  to  the  ppaatthh
               shell variable, but in a different format.

       PPWWDD (+) Equivalent to the ccwwdd shell variable, but not syn-
               chronized to it;  updated  only  after  an  actual
               directory change.

       RREEMMOOTTEEHHOOSSTT (+)
               The  host  from  which  the  user  has  logged  in
               remotely, if this is the case  and  the  shell  is
               able to determine it. Set only if the shell was so
               compiled; see the vveerrssiioonn shell variable.

       SSHHLLVVLL (+)
               Equivalent to the sshhllvvll shell variable.

       SSYYSSTTYYPPEE (+)
               The current system type. (Domain/OS only)

       TTEERRMM    Equivalent to the tteerrmm shell variable.

       TTEERRMMCCAAPP The terminal capability string. See TTeerrmmiinnaall  mmaann--
               aaggeemmeenntt.

       UUSSEERR    Equivalent to the uusseerr shell variable.

       VVEENNDDOORR (+)
               The vendor, as determined at compile time.

       VVIISSUUAALL  The pathname to a default full-screen editor.  See
               also the EEDDIITTOORR environment variable and the  _r_u_n_-
               _f_g_-_e_d_i_t_o_r editor command.

FFIILLEESS
       _/_e_t_c_/_c_s_h_._c_s_h_r_c  Read  first  by  every  shell.   ConvexOS,
                       Stellix and Intel use _/_e_t_c_/_c_s_h_r_c and NeXTs
                       use  _/_e_t_c_/_c_s_h_r_c_._s_t_d.  A/UX, AMIX, Cray and
                       IRIX have no  equivalent  in  _c_s_h(1),  but
                       read  this  file  in _t_c_s_h anyway.  Solaris
                       2.x does not  have  it  either,  but  _t_c_s_h
                       reads _/_e_t_c_/_._c_s_h_r_c. (+)
       _/_e_t_c_/_c_s_h_._l_o_g_i_n  Read by login shells after _/_e_t_c_/_c_s_h_._c_s_h_r_c.
                       ConvexOS,   Stellix    and    Intel    use
                       _/_e_t_c_/_l_o_g_i_n,   NeXTs   use  _/_e_t_c_/_l_o_g_i_n_._s_t_d,
                       Solaris 2.x  uses  _/_e_t_c_/_._l_o_g_i_n  and  A/UX,
                       AMIX, Cray and IRIX use _/_e_t_c_/_c_s_h_r_c.
       _~_/_._t_c_s_h_r_c (+)   Read  by  every shell after _/_e_t_c_/_c_s_h_._c_s_h_r_c
                       or its equivalent.
       _~_/_._c_s_h_r_c        Read by every shell, if _~_/_._t_c_s_h_r_c  doesn't
                       exist, after _/_e_t_c_/_c_s_h_._c_s_h_r_c or its equiva-
                       lent.  This  manual  uses  `_~_/_._t_c_s_h_r_c'  to
                       mean  `_~_/_._t_c_s_h_r_c  or,  if _~_/_._t_c_s_h_r_c is not
                       found, _~_/_._c_s_h_r_c'.



Cornell 6.06.00           29 April 1995                        76





TCSH(1)                                                   TCSH(1)


       _~_/_._h_i_s_t_o_r_y      Read by login shells  after  _~_/_._t_c_s_h_r_c  if
                       ssaavveehhiisstt is set, but see also hhiissttffiillee.
       _~_/_._l_o_g_i_n        Read  by  login  shells after _~_/_._t_c_s_h_r_c or
                       _~_/_._h_i_s_t_o_r_y.  The shell may be compiled  to
                       read  _~_/_._l_o_g_i_n  before  instead  of  after
                       _~_/_._t_c_s_h_r_c and _~_/_._h_i_s_t_o_r_y; see the  vveerrssiioonn
                       shell variable.
       _~_/_._c_s_h_d_i_r_s (+)  Read  by  login  shells  after _~_/_._l_o_g_i_n if
                       ssaavveeddiirrss is set, but see also ddiirrssffiillee.
       _/_e_t_c_/_c_s_h_._l_o_g_o_u_t Read by login shells at logout.  ConvexOS,
                       Stellix  and  Intel  use  _/_e_t_c_/_l_o_g_o_u_t  and
                       NeXTs use  _/_e_t_c_/_l_o_g_o_u_t_._s_t_d.   A/UX,  AMIX,
                       Cray   and  IRIX  have  no  equivalent  in
                       _c_s_h(1), but read this file in _t_c_s_h anyway.
                       Solaris  2.x  does not have it either, but
                       _t_c_s_h reads _/_e_t_c_/_._c_s_h_r_c. (+)
       _~_/_._l_o_g_o_u_t       Read  by  login  shells  at  logout  after
                       _/_e_t_c_/_c_s_h_._l_o_g_o_u_t or its equivalent.
       _/_b_i_n_/_s_h         Used to interpret shell scripts not start-
                       ing with a `#'.
       _/_t_m_p_/_s_h_*        Temporary file for `<<'.
       _/_e_t_c_/_p_a_s_s_w_d     Source of  home  directories  for  `~name'
                       substitutions.

       The  order  in  which startup files are read may differ if
       the shell was so compiled; see SSttaarrttuupp  aanndd  sshhuuttddoowwnn  and
       the vveerrssiioonn shell variable.

NNEEWW FFEEAATTUURREESS ((++))
       This manual describes _t_c_s_h as a single entity, but experi-
       enced _c_s_h(1) users will want to pay special  attention  to
       _t_c_s_h's new features.

       A   command-line  editor,  which  supports  GNU  Emacs  or
       _v_i(1)-style key bindings. See TThhee ccoommmmaanndd--lliinnee eeddiittoorr  and
       EEddiittoorr ccoommmmaannddss.

       Programmable,  interactive  word  completion  and listing.
       See CCoommpplleettiioonn aanndd lliissttiinngg and the _c_o_m_p_l_e_t_e and _u_n_c_o_m_p_l_e_t_e
       builtin commands.

       SSppeelllliinngg  ccoorrrreeccttiioonn  (q.v.)  of  filenames,  commands and
       variables.

       EEddiittoorr ccoommmmaannddss (q.v.) which perform  other  useful  func-
       tions  in the middle of typed commands, including documen-
       tation lookup (_r_u_n_-_h_e_l_p), quick editor restarting (_r_u_n_-_f_g_-
       _e_d_i_t_o_r) and command resolution (_w_h_i_c_h_-_c_o_m_m_a_n_d).

       An  enhanced history mechanism. Events in the history list
       are time-stamped.  See also the _h_i_s_t_o_r_y  command  and  its
       associated  shell  variables,  the previously undocumented
       `#' event specifier and new modifiers under  HHiissttoorryy  ssuubb--
       ssttiittuuttiioonn,  the  _*_-_h_i_s_t_o_r_y,  _h_i_s_t_o_r_y_-_s_e_a_r_c_h_-_*, _i_-_s_e_a_r_c_h_-_*,



Cornell 6.06.00           29 April 1995                        77





TCSH(1)                                                   TCSH(1)


       _v_i_-_s_e_a_r_c_h_-_* and _t_o_g_g_l_e_-_l_i_t_e_r_a_l_-_h_i_s_t_o_r_y editor commands and
       the hhiissttlliitt shell variable.

       Enhanced  directory  parsing and directory stack handling.
       See the _c_d, _p_u_s_h_d, _p_o_p_d and _d_i_r_s commands and their  asso-
       ciated shell variables, the description of DDiirreeccttoorryy ssttaacckk
       ssuubbssttiittuuttiioonn, the ddiirrssttaacckk, oowwdd and ssyymmlliinnkkss  shell  vari-
       ables  and the _n_o_r_m_a_l_i_z_e_-_c_o_m_m_a_n_d and _n_o_r_m_a_l_i_z_e_-_p_a_t_h editor
       commands.

       Negation in glob-patterns. See FFiilleennaammee ssuubbssttiittuuttiioonn.

       New FFiillee iinnqquuiirryy ooppeerraattoorrss (q.v.) and a  _f_i_l_e_t_e_s_t  builtin
       which uses them.

       A  variety  of AAuuttoommaattiicc,, ppeerriiooddiicc aanndd ttiimmeedd eevveennttss (q.v.)
       including scheduled  events,  special  aliases,  automatic
       logout  and  terminal locking, command timing and watching
       for logins and logouts.

       Support for the Native Language System  (see  NNaattiivvee  LLaann--
       gguuaaggee SSyysstteemm ssuuppppoorrtt), OS variant features (see OOSS vvaarriiaanntt
       ssuuppppoorrtt and the eecchhoo__ssttyyllee  shell  variable)  and  system-
       dependent file locations (see FFIILLEESS).

       Extensive  terminal-managment  capabilities.  See TTeerrmmiinnaall
       mmaannaaggeemmeenntt.

       New builtin commands including _b_u_i_l_t_i_n_s, _h_u_p,  _l_s_-_F,  _n_e_w_-
       _g_r_p, _p_r_i_n_t_e_n_v, _w_h_i_c_h and _w_h_e_r_e (q.v.).

       New  variables  that make useful information easily avail-
       able to the shell.  See  the  ggiidd,  llooggiinnsshh,  ooiidd,  sshhllvvll,
       ttccsshh,  ttttyy,  uuiidd and vveerrssiioonn shell variables and the HHOOSSTT,
       RREEMMOOTTEEHHOOSSTT, VVEENNDDOORR, OOSSTTYYPPEE and MMAACCHHTTYYPPEE environment  vari-
       ables.

       A  new  syntax  for  including  useful  information in the
       prompt string (see pprroommpptt).  and special prompts for loops
       and spelling correction (see pprroommpptt22 and pprroommpptt33).

       Read-only variables. See VVaarriiaabbllee ssuubbssttiittuuttiioonn.

BBUUGGSS
       When  a  suspended  command is restarted, the shell prints
       the directory it started in if this is different from  the
       current  directory. This can be misleading (i.e. wrong) as
       the job may have changed directories internally.

       Shell builtin  functions  are  not  stoppable/restartable.
       Command  sequences  of  the  form `a ; b ; c' are also not
       handled gracefully when stopping  is  attempted.   If  you
       suspend  `b', the shell will then immediately execute `c'.
       This is especially noticeable if  this  expansion  results



Cornell 6.06.00           29 April 1995                        78





TCSH(1)                                                   TCSH(1)


       from  an  _a_l_i_a_s. It suffices to place the sequence of com-
       mands in ()'s to force it to a subshell, i.e. `( a ; b ; c
       )'.

       Control  over  tty  output  after processes are started is
       primitive; perhaps this will inspire someone to work on  a
       good  virtual  terminal  interface.  In a virtual terminal
       interface much more interesting things could be done  with
       output control.

       Alias substitution is most often used to clumsily simulate
       shell procedures;  shell  procedures  should  be  provided
       rather than aliases.

       Commands  within loops are not placed in the history list.
       Control structures should be parsed rather than being rec-
       ognized  as  built-in  commands.  This would allow control
       commands to be placed anywhere, to be combined  with  `|',
       and to be used with `&' and `;' metasyntax.

       _f_o_r_e_a_c_h doesn't ignore here documents when looking for its
       _e_n_d.

       It should be possible to use the `:' modifiers on the out-
       put of command substitutions.

       The  screen  update for lines longer than the screen width
       is very poor if the terminal cannot  move  the  cursor  up
       (i.e. terminal type `dumb').

       HHPPAATTHH and NNOORREEBBIINNDD don't need to be environment variables.

       Glob-patterns which do not use `?', `*' or `[]'  or  which
       use `{}' or `~' are not negated correctly.

       The single-command form of _i_f does output redirection even
       if the expression is false and the  command  is  not  exe-
       cuted.

       _l_s_-_F  includes file identification characters when sorting
       filenames.

       Report bugs to tcsh-bugs@mx.gw.com, preferably with fixes.
       If  you  want to help maintain and test tcsh, send mail to
       listserv@mx.gw.com with the  text  `subscribe  tcsh  <your
       name>' on a line by itself in the body. You can also `sub-
       scribe tcsh-bugs <your name>' to get all bug  reports,  or
       `subscribe  tcsh-diffs <your name>' to get the development
       list plus diffs for each patchlevel.

TTHHEE TT IINN TTCCSSHH
       In 1964, DEC produced the PDP-6. The PDP-10  was  a  later
       re-implementation.  It  was re-christened the DECsystem-10
       in 1970 or so when DEC brought out the second  model,  the



Cornell 6.06.00           29 April 1995                        79





TCSH(1)                                                   TCSH(1)


       KI10.

       TENEX  was created at Bolt, Beranek & Newman (a Cambridge,
       Mass. think tank) in 1972 as an experiment in demand-paged
       virtual  memory  operating systems. They built a new pager
       for the DEC PDP-10 and created the OS to go  with  it.  It
       was extremely successful in academia.

       In  1975,  DEC  brought out a new model of the PDP-10, the
       KL10; they intended to have only a version of TENEX, which
       they  had  licensed from BBN, for the new box. They called
       their version  TOPS-20  (their  capitalization  is  trade-
       marked).   A  lot  of TOPS-10 users (`The OPerating System
       for PDP-10') objected; thus DEC found themselves  support-
       ing  two  incompatible  systems  on the same hardware--but
       then there were 6 on the PDP-11!

       TENEX, and TOPS-20 to version 3,  had  command  completion
       via  a  user-code-level  subroutine library called ULTCMD.
       With version 3, DEC moved all  that  capability  and  more
       into  the  monitor (`kernel' for you Unix types), accessed
       by the COMND% JSYS  (`Jump  to  SYStem'  instruction,  the
       supervisor  call  mechanism  [are  my IBM roots also show-
       ing?]).

       The creator of tcsh was impressed by this feature and sev-
       eral others of TENEX and TOPS-20, and created a version of
       csh which mimicked them.

LLIIMMIITTAATTIIOONNSS
       Words can be no longer than 1024 characters.

       The system limits argument lists to 10240 characters.

       The number of arguments to a command which involves  file-
       name  expansion  is limited to 1/6th the number of charac-
       ters allowed in an argument list.

       Command substitutions may substitute  no  more  characters
       than are allowed in an argument list.

       To detect looping, the shell restricts the number of _a_l_i_a_s
       substitutions on a single line to 20.

SSEEEE AALLSSOO
       csh(1), emacs(1),  ls(1),  newgrp(1),  sh(1),  setpath(1),
       stty(1),   su(1),   tset(1),   vi(1),   x(1),   access(2),
       execve(2),  fork(2),  killpg(2),  pipe(2),   setrlimit(2),
       sigvec(2),  stat(2),  umask(2),  vfork(2),  wait(2),  mal-
       loc(3), setlocale(3), tty(4), a.out(5), termcap(5),  envi-
       ron(7), termio(7), Introduction to the C Shell

VVEERRSSIIOONN
       This manual documents tcsh 6.06.00 (Cornell) 1995-04-29.



Cornell 6.06.00           29 April 1995                        80





TCSH(1)                                                   TCSH(1)


AAUUTTHHOORRSS
       William Joy
         Original author of _c_s_h(1)
       J.E. Kulp, IIASA, Laxenburg, Austria
         Job control and directory stack features
       Ken Greer, HP Labs, 1981
         File name completion
       Mike Ellis, Fairchild, 1983
         Command name recognition/completion
       Paul Placeway, Ohio State CIS Dept., 1983-1993
         Command  line  editor,  prompt routines, new glob syntax
         and numerous fixes and speedups
       Karl Kleinpaste, CCI 1983-4
         Special  aliases,  directory  stack  extraction   stuff,
         login/logout  watch,  scheduled  events, and the idea of
         the new prompt format
       Rayan Zachariassen, University of Toronto, 1984
         _l_s_-_F and _w_h_i_c_h builtins and numerous bug fixes,  modifi-
         cations and speedups
       Chris Kingsley, Caltech
         Fast storage allocator routines
       Chris Grevstad, TRW, 1987
         Incorporated 4.3BSD _c_s_h into _t_c_s_h
       Christos S. Zoulas, Cornell U. EE Dept., 1987-94
         Ports to HPUX, SVR2 and SVR3, a SysV version of getwd.c,
         SHORT_STRINGS support and a new version of sh.glob.c
       James J Dempsey, BBN, and Paul Placeway, OSU, 1988
         A/UX port
       Daniel Long, NNSC, 1988
         wwoorrddcchhaarrss
       Patrick Wolfe, Kuck and Associates, Inc., 1988
         _v_i mode cleanup
       David C Lawrence, Rensselaer Polytechnic Institute, 1989
         aauuttoolliisstt and ambiguous completion listing
       Alec Wolman, DEC, 1989
         Newlines in the prompt
       Matt Landau, BBN, 1989
         _~_/_._t_c_s_h_r_c
       Ray Moody, Purdue Physics, 1989
         Magic spacebar history expansion
       Mordechai ????, Intel, 1989
         printprompt() fixes and additions
       Kazuhiro Honda, Dept. of Computer Science, Keio
         University, 1989
         Automatic spelling correction and pprroommpptt33
       Per Hedeland, Ellemtel, Sweden, 1990-
         Various bugfixes, improvements and manual updates
       Hans J. Albertsson (Sun Sweden)
         aammppmm, _s_e_t_t_c and _t_e_l_l_t_c
       Michael Bloom
         Interrupt handling fixes
       Michael Fine, Digital Equipment Corp
         Extended key support




Cornell 6.06.00           29 April 1995                        81





TCSH(1)                                                   TCSH(1)


       Eric Schnoebelen, Convex, 1990
         Convex  support, lots of _c_s_h bug fixes, save and restore
         of directory stack
       Ron Flax, Apple, 1990
         A/UX 2.0 (re)port
       Dan Oscarsson, LTH Sweden, 1990
         NLS support and simulated NLS support for non NLS sites,
         fixes
       Johan Widen, SICS Sweden, 1990
         sshhllvvll, Mach support, _c_o_r_r_e_c_t_-_l_i_n_e, 8-bit printing
       Matt Day, Sanyo Icon, 1990
         POSIX termio support, SysV limit fixes
       Jaap Vermeulen, Sequent, 1990-91
         Vi  mode fixes, expand-line, window change fixes, Symme-
         try port
       Martin Boyer, Institut de recherche d'Hydro-Quebec, 1991
         aauuttoolliisstt beeping options, modified the history search to
         search  for  the  whole string from the beginning of the
         line to the cursor.
       Scott Krotz, Motorola, 1991
         Minix port
       David Dawes, Sydney U. Australia, Physics Dept., 1991
         SVR4 job control fixes
       Jose Sousa, Interactive Systems Corp., 1991
         Extended _v_i fixes and _v_i delete command
       Marc Horowitz, MIT, 1991
         ANSIfication fixes, new exec hashing code, imake  fixes,
         _w_h_e_r_e
       Bruce Sterling Woodcock, sterling@netcom.com, 1991-1995
         ETA   and   Pyramid   port,  Makefile  and  lint  fixes,
         iiggnnoorreeeeooff=n  addition,  and  various  other  portability
         changes and bug fixes
       Jeff Fink, 1992
         _c_o_m_p_l_e_t_e_-_w_o_r_d_-_f_w_d and _c_o_m_p_l_e_t_e_-_w_o_r_d_-_b_a_c_k
       Harry C. Pulley, 1992
         Coherent port
       Andy Phillips, Mullard Space Science Lab U.K., 1992
         VMS-POSIX port
       Beto Appleton, IBM Corp., 1992
         Walking  process  group fixes, _c_s_h bug fixes, POSIX file
         tests, POSIX SIGHUP
       Scott Bolte, Cray Computer Corp., 1992
         CSOS port
       Kaveh R. Ghazi, Rutgers University, 1992
         Tek, m88k, Titan and Masscomp ports and fixes
       Mark Linderman, Cornell University, 1992
         OS/2 port
       Mika Liljeberg, liljeber@kruuna.Helsinki.FI, 1992
         Linux port
       Tim P. Starrin, NASA Langley Research Center Operations,
         1993
         Read-only variables
       Dave Schweisguth, Yale University, 1993-4
         New manpage and tcsh.man2html



Cornell 6.06.00           29 April 1995                        82





TCSH(1)                                                   TCSH(1)


       Larry Schwimmer, Stanford University, 1993
         AFS and HESIOD patches
       Luke Mewburn, RMIT University, 1994
         Enhanced directory printing in prompt


TTHHAANNKKSS TTOO
       Bryan Dunlap, Clayton Elwell, Karl Kleinpaste, Bob Manson,
       Steve Romig, Diana Smetters, Bob Sutterfield, Mark Verber,
       Elizabeth  Zwicky  and  all the other people at Ohio State
       for suggestions and encouragement

       All the people on the net, for putting up with,  reporting
       bugs  in,  and  suggesting new additions to each and every
       version

       Richard M. Alderson III, for writing the `T in tcsh'  sec-
       tion







































Cornell 6.06.00           29 April 1995                        83


