{
    "mode": "man",
    "parameter": "csh",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/csh/1/json",
    "generated": "2026-05-30T02:52:15Z",
    "synopsis": "tcsh [-bcdefFimnqstvVxX] [-Dname[=value]] [arg ...]",
    "sections": {
        "NAME": {
            "content": "tcsh - C shell with file name completion and command line editing\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "tcsh [-bcdefFimnqstvVxX] [-Dname[=value]] [arg ...]",
            "subsections": [
                {
                    "name": "tcsh -l",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "tcsh  is  an enhanced but completely compatible version of the Berkeley UNIX C shell, csh(1).\nIt is a command language interpreter usable both as an interactive login shell  and  a  shell\nscript  command  processor.  It includes a command-line editor (see The command-line editor),\nprogrammable word completion (see Completion and listing), spelling correction (see  Spelling\ncorrection),  a history mechanism (see History substitution), job control (see Jobs) and a C-\nlike syntax.  The NEW FEATURES section describes major  enhancements  of  tcsh  over  csh(1).\nThroughout  this  manual, features of tcsh not found in most csh(1) implementations (specifi‐\ncally, the 4.4BSD csh) are labeled with `(+)', and features which are present in  csh(1)  but\nnot usually documented are labeled with `(u)'.\n",
            "subsections": [
                {
                    "name": "Argument list processing",
                    "content": "If  the  first  argument  (argument 0) to the shell is `-' then it is a login shell.  A login\nshell can be also specified by invoking the shell with the -l flag as the only argument.\n\nThe rest of the flag arguments are interpreted as follows:\n"
                },
                {
                    "name": "-b",
                    "content": "treated  as  non-option  arguments.   The  remaining arguments will not be interpreted as\nshell options.  This may be used to pass options to a shell script without  confusion  or\npossible subterfuge.  The shell will not run a set-user ID script without this option.\n",
                    "flag": "-b"
                },
                {
                    "name": "-c",
                    "content": "gle argument), stored in the command shell variable for reference, and executed.  Any re‐\nmaining arguments are placed in the argv shell variable.\n",
                    "flag": "-c"
                },
                {
                    "name": "-d",
                    "content": "down, whether or not it is a login shell. (+)\n",
                    "flag": "-d"
                },
                {
                    "name": "-D",
                    "content": "Sets the environment variable name to value. (Domain/OS only) (+)\n",
                    "flag": "-D"
                },
                {
                    "name": "-e",
                    "content": "status.\n",
                    "flag": "-e"
                },
                {
                    "name": "-f",
                    "content": "and thus starts faster.\n",
                    "flag": "-f"
                },
                {
                    "name": "-F",
                    "content": "",
                    "flag": "-F"
                },
                {
                    "name": "-i",
                    "content": "be  a  terminal.   Shells are interactive without this option if their inputs and outputs\nare terminals.\n",
                    "flag": "-i"
                },
                {
                    "name": "-l -l",
                    "content": "",
                    "flag": "-l"
                },
                {
                    "name": "-m",
                    "content": "sions of su(1) can pass -m to the shell. (+)\n",
                    "flag": "-m"
                },
                {
                    "name": "-n",
                    "content": "scripts.\n",
                    "flag": "-n"
                },
                {
                    "name": "-q",
                    "content": "bugger.  Job control is disabled. (u)\n",
                    "flag": "-q"
                },
                {
                    "name": "-s",
                    "content": "",
                    "flag": "-s"
                },
                {
                    "name": "-t",
                    "content": "newline at the end of this line and continue onto another line.\n",
                    "flag": "-t"
                },
                {
                    "name": "-v",
                    "content": "tion.\n",
                    "flag": "-v"
                },
                {
                    "name": "-x",
                    "content": "",
                    "flag": "-x"
                },
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                },
                {
                    "name": "-X -x -V -v",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "--help",
                    "content": "Print a help message on the standard output and exit. (+)\n",
                    "long": "--help"
                },
                {
                    "name": "--version",
                    "content": "Print the version/platform/compilation options on the standard output and exit.  This in‐\nformation is also contained in the version shell variable. (+)\n\nAfter processing of flag arguments, if arguments remain but none of the -c, -i, -s, or -t op‐\ntions  were  given,  the  first  argument  is  taken  as  the  name of a file of commands, or\n``script'', to be executed.  The shell opens this file and saves its name for possible resub‐\nstitution  by  `$0'.   Because  many  systems  use either the standard version 6 or version 7\nshells whose shell scripts are not compatible with this shell, the shell uses such  a  `stan‐\ndard' shell to execute a script whose first character is not a `#', i.e., that does not start\nwith a comment.\n\nRemaining arguments are placed in the argv shell variable.\n",
                    "long": "--version"
                },
                {
                    "name": "Startup and shutdown",
                    "content": "A login shell  begins  by  executing  commands  from  the  system  files  /etc/csh.cshrc  and\n/etc/csh.login.   It  then  executes  commands from files in the user's home directory: first\n~/.tcshrc (+) or, if ~/.tcshrc is not found, ~/.cshrc, then the contents  of  ~/.history  (or\nthe  value of the histfile shell variable) are loaded into memory, then ~/.login, and finally\n~/.cshdirs (or  the  value  of  the  dirsfile  shell  variable)  (+).   The  shell  may  read\n/etc/csh.login  before  instead of after /etc/csh.cshrc, and ~/.login before instead of after\n~/.tcshrc or ~/.cshrc and ~/.history, if so compiled; see the version shell variable. (+)\n\nNon-login shells read only /etc/csh.cshrc and ~/.tcshrc or ~/.cshrc on startup.\n\nFor examples of startup files, please consult http://tcshrc.sourceforge.net.\n\nCommands like stty(1) and tset(1), which need be run only once per login, usually go in one's\n~/.login  file.   Users  who  need to use the same set of files with both csh(1) and tcsh can\nhave only a ~/.cshrc which checks for the existence of the tcsh shell variable (q.v.)  before\nusing  tcsh-specific commands, or can have both a ~/.cshrc and a ~/.tcshrc which sources (see\nthe builtin command) ~/.cshrc.  The rest of this manual uses `~/.tcshrc' to  mean  `~/.tcshrc\nor, if ~/.tcshrc is not found, ~/.cshrc'.\n\nIn the normal case, the shell begins reading commands from the terminal, prompting with `> '.\n(Processing of arguments and the use of the shell to process files containing command scripts\nare  described  later.)   The  shell repeatedly reads a line of command input, breaks it into\nwords, places it on the command history list, parses it and  executes  each  command  in  the\nline.\n\nOne  can  log out by typing `^D' on an empty line, `logout' or `login' or via the shell's au‐\ntologout mechanism (see the autologout shell variable).  When a  login  shell  terminates  it\nsets  the logout shell variable to `normal' or `automatic' as appropriate, then executes com‐\nmands from the files /etc/csh.logout and ~/.logout.  The shell may drop DTR on logout  if  so\ncompiled; see the version shell variable.\n\nThe  names  of the system login and logout files vary from system to system for compatibility\nwith different csh(1) variants; see FILES.\n"
                },
                {
                    "name": "Editing",
                    "content": "We first describe The command-line editor.  The Completion and listing and  Spelling  correc‐‐\ntion  sections describe two sets of functionality that are implemented as editor commands but\nwhich deserve their own treatment.  Finally, Editor commands lists and describes  the  editor\ncommands specific to the shell and their default bindings.\n"
                },
                {
                    "name": "The command-line editor (+)",
                    "content": "Command-line  input  can  be  edited  using key sequences much like those used in emacs(1) or\nvi(1).  The editor is active only when the edit shell variable is set, which it is by default\nin   interactive   shells.   The  bindkey  builtin  can  display  and  change  key  bindings.\nemacs(1)-style key bindings are used by default (unless the shell was compiled otherwise; see\nthe  version shell variable), but bindkey can change the key bindings to vi(1)-style bindings\nen masse.\n\nThe shell always binds the arrow keys (as defined in the TERMCAP environment variable) to\n\ndown    down-history\nup      up-history\nleft    backward-char\nright   forward-char\n\nunless doing so would alter another single-character binding.  One can set the arrow key  es‐\ncape  sequences to the empty string with settc to prevent these bindings.  The ANSI/VT100 se‐\nquences for arrow keys are always bound.\n\nOther key bindings are, for the most part, what emacs(1) and vi(1) users would expect and can\neasily be displayed by bindkey, so there is no need to list them here.  Likewise, bindkey can\nlist the editor commands with a short description of each.  Certain key bindings have differ‐\nent  behavior  depending  if  emacs(1) or vi(1) style bindings are being used; see vimode for\nmore information.\n\nNote that editor commands do not have the same notion of a ``word'' as does the  shell.   The\neditor  delimits  words  with any non-alphanumeric characters not in the shell variable word‐‐\nchars, while the shell recognizes only whitespace and some of  the  characters  with  special\nmeanings to it, listed under Lexical structure.\n"
                },
                {
                    "name": "Completion and listing (+)",
                    "content": "The  shell  is often able to complete words when given a unique abbreviation.  Type part of a\nword (for example `ls /usr/lost') and hit the tab key to run the  complete-word  editor  com‐\nmand.   The shell completes the filename `/usr/lost' to `/usr/lost+found/', replacing the in‐\ncomplete word with the complete word in the input buffer.  (Note the terminal `/'; completion\nadds  a  `/'  to  the  end of completed directories and a space to the end of other completed\nwords, to speed typing and provide a visual indicator of successful completion.  The  addsuf‐‐\nfix  shell  variable  can  be  unset  to  prevent  this.)   If  no  match  is  found (perhaps\n`/usr/lost+found' doesn't exist), the terminal bell rings.  If the word is  already  complete\n(perhaps  there  is  a `/usr/lost' on your system, or perhaps you were thinking too far ahead\nand typed the whole thing) a `/' or space is added to the end if it isn't already there.\n\nCompletion works anywhere in the line, not at just the end; completed text pushes the rest of\nthe  line to the right.  Completion in the middle of a word often results in leftover charac‐\nters to the right of the cursor that need to be deleted.\n\nCommands and variables can be completed in much the same way.  For example, typing  `em[tab]'\nwould  complete  `em' to `emacs' if emacs were the only command on your system beginning with\n`em'.  Completion can find a command in any directory in path or if given  a  full  pathname.\nTyping `echo $ar[tab]' would complete `$ar' to `$argv' if no other variable began with `ar'.\n\nThe  shell  parses the input buffer to determine whether the word you want to complete should\nbe completed as a filename, command or variable.  The first word in the buffer and the  first\nword  following `;', `|', `|&', `&&' or `||' is considered to be a command.  A word beginning\nwith `$' is considered to be a variable.  Anything else is a  filename.   An  empty  line  is\n`completed' as a filename.\n\nYou can list the possible completions of a word at any time by typing `^D' to run the delete-\nchar-or-list-or-eof editor command.  The shell lists the possible completions using the  ls-F\nbuiltin (q.v.)  and reprints the prompt and unfinished command line, for example:\n\n> ls /usr/l[^D]\nlbin/       lib/        local/      lost+found/\n> ls /usr/l\n\nIf  the  autolist shell variable is set, the shell lists the remaining choices (if any) when‐\never completion fails:\n\n> set autolist\n> nm /usr/lib/libt[tab]\nlibtermcap.a@ libtermlib.a@\n> nm /usr/lib/libterm\n\nIf autolist is set to `ambiguous', choices are listed only when completion fails and adds  no\nnew characters to the word being completed.\n\nA filename to be completed can contain variables, your own or others' home directories abbre‐\nviated with `~' (see Filename substitution) and directory stack entries abbreviated with  `='\n(see Directory stack substitution).  For example,\n\n> ls ~k[^D]\nkahn    kas     kellogg\n> ls ~ke[tab]\n> ls ~kellogg/\n\nor\n\n> set local = /usr/local\n> ls $lo[tab]\n> ls $local/[^D]\nbin/ etc/ lib/ man/ src/\n> ls $local/\n\nNote that variables can also be expanded explicitly with the expand-variables editor command.\n\ndelete-char-or-list-or-eof  lists  at  only  the  end of the line; in the middle of a line it\ndeletes the character under the cursor and on an empty line it logs one out or, if  ignoreeof\nis  set,  does  nothing.   `M-^D', bound to the editor command list-choices, lists completion\npossibilities anywhere on a line, and list-choices (or any one of the related editor commands\nthat do or don't delete, list and/or log out, listed under delete-char-or-list-or-eof) can be\nbound to `^D' with the bindkey builtin command if so desired.\n\nThe complete-word-fwd and complete-word-back editor commands (not bound to any  keys  by  de‐\nfault)  can  be used to cycle up and down through the list of possible completions, replacing\nthe current word with the next or previous word in the list.\n\nThe shell variable fignore can be set to a list of suffixes  to  be  ignored  by  completion.\nConsider the following:\n\n> ls\nMakefile        condiments.h~   main.o          side.c\nREADME          main.c          meal            side.o\ncondiments.h    main.c~\n> set fignore = (.o \\~)\n> emacs ma[^D]\nmain.c   main.c~  main.o\n> emacs ma[tab]\n> emacs main.c\n\n`main.c~'  and `main.o' are ignored by completion (but not listing), because they end in suf‐\nfixes in fignore.  Note that a `\\' was needed in front of `~' to prevent it  from  being  ex‐\npanded to home as described under Filename substitution.  fignore is ignored if only one com‐\npletion is possible.\n\nIf the complete shell variable is set to `enhance', completion 1) ignores case and 2) consid‐\ners periods, hyphens and underscores (`.', `-' and `') to be word separators and hyphens and\nunderscores to be equivalent.  If you had the following files\n\ncomp.lang.c      comp.lang.perl   comp.std.c++\ncomp.lang.c++    comp.std.c\n\nand typed `mail -f c.l.c[tab]', it would be completed to `mail -f comp.lang.c', and ^D  would\nlist  `comp.lang.c' and `comp.lang.c++'.  `mail -f c..c++[^D]' would list `comp.lang.c++' and\n`comp.std.c++'.  Typing `rm a--file[^D]' in the following directory\n\nAsillyfile    a-hyphenated-file    anothersillyfile\n\nwould list all three files, because case is ignored and hyphens and underscores  are  equiva‐\nlent.  Periods, however, are not equivalent to hyphens or underscores.\n\nIf  the  complete shell variable is set to `Enhance', completion ignores case and differences\nbetween a hyphen and an underscore word separator only when the user types a lowercase  char‐\nacter  or a hyphen.  Entering an uppercase character or an underscore will not match the cor‐\nresponding lowercase character or hyphen word separator.  Typing `rm a--file[^D]' in the  di‐\nrectory  of  the  previous  example would still list all three files, but typing `rm A--file'\nwould match only `Asillyfile' and typing `rm afile[^D]' would match  just  `Asillyfile'\nand `anothersillyfile' because the user explicitly used an uppercase or an underscore char‐\nacter.\n\nCompletion and listing are affected by several other shell variables: recexact can be set  to\ncomplete  on the shortest possible unique match, even if more typing might result in a longer\nmatch:\n\n> ls\nfodder   foo      food     foonly\n> set recexact\n> rm fo[tab]\n\njust beeps, because `fo' could expand to `fod' or `foo', but if we type another `o',\n\n> rm foo[tab]\n> rm foo\n\nthe completion completes on `foo', even though `food' and `foonly'  also  match.   autoexpand\ncan  be set to run the expand-history editor command before each completion attempt, autocor‐‐\nrect can be set to spelling-correct the word to be completed (see Spelling correction) before\neach  completion  attempt and correct can be set to complete commands automatically after one\nhits `return'.  matchbeep can be set to make completion beep or not beep in a variety of sit‐\nuations, and nobeep can be set to never beep at all.  nostat can be set to a list of directo‐\nries and/or patterns  that  match  directories  to  prevent  the  completion  mechanism  from\nstat(2)ing  those  directories.   listmax  and  listmaxrows can be set to limit the number of\nitems and rows (respectively) that are listed without asking first.   recognizeonlyexecuta‐‐\nbles  can  be  set  to  make the shell list only executables when listing commands, but it is\nquite slow.\n\nFinally, the complete builtin command can be used to tell the shell  how  to  complete  words\nother  than  filenames,  commands and variables.  Completion and listing do not work on glob-\npatterns (see Filename substitution), but the list-glob and expand-glob editor commands  per‐\nform equivalent functions for glob-patterns.\n"
                },
                {
                    "name": "Spelling correction (+)",
                    "content": "The  shell  can  sometimes  correct the spelling of filenames, commands and variable names as\nwell as completing and listing them.\n\nIndividual words can be spelling-corrected with the spell-word editor command (usually  bound\nto M-s and M-S) and the entire input buffer with spell-line (usually bound to M-$).  The cor‐‐\nrect shell variable can be set to `cmd' to correct the command name or `all' to  correct  the\nentire  line  each time return is typed, and autocorrect can be set to correct the word to be\ncompleted before each completion attempt.\n\nWhen spelling correction is invoked in any of these ways and the shell thinks that  any  part\nof the command line is misspelled, it prompts with the corrected line:\n\n> set correct = cmd\n> lz /usr/bin\nCORRECT>ls /usr/bin (y|n|e|a)?\n\nOne  can answer `y' or space to execute the corrected line, `e' to leave the uncorrected com‐\nmand in the input buffer, `a' to abort the command as if `^C' had been hit, and anything else\nto execute the original line unchanged.\n\nSpelling  correction  recognizes user-defined completions (see the complete builtin command).\nIf an input word in a position for which a completion is defined resembles a word in the com‐\npletion  list,  spelling correction registers a misspelling and suggests the latter word as a\ncorrection.  However, if the input word does not match any of the  possible  completions  for\nthat position, spelling correction does not register a misspelling.\n\nLike completion, spelling correction works anywhere in the line, pushing the rest of the line\nto the right and possibly leaving extra characters to the right of the cursor.\n"
                },
                {
                    "name": "Editor commands (+)",
                    "content": "`bindkey' lists key bindings and `bindkey -l' lists and briefly  describes  editor  commands.\nOnly  new  or  especially  interesting  editor commands are described here.  See emacs(1) and\nvi(1) for descriptions of each editor's key bindings.\n\nThe character or characters to which each command is bound by default is given  in  parenthe‐\nses.  `^character' means a control character and `M-character' a meta character, typed as es‐\ncape-character on terminals without a meta key.  Case counts, but commands that are bound  to\nletters by default are bound to both lower- and uppercase letters for convenience.\n\nbackward-char (^B, left)\nMove back a character.  Cursor behavior modified by vimode.\n\nbackward-delete-word (M-^H, M-^?)\nCut  from  beginning  of current word to cursor - saved in cut buffer.  Word boundary\nbehavior modified by vimode.\n\nbackward-word (M-b, M-B)\nMove to beginning of current word.  Word boundary and cursor behavior modified by vi‐‐\nmode.\n\nbeginning-of-line (^A, home)\nMove to beginning of line.  Cursor behavior modified by vimode.\n\ncapitalize-word (M-c, M-C)\nCapitalize the characters from cursor to end of current word.  Word boundary behavior\nmodified by vimode.\n"
                },
                {
                    "name": "complete-word (tab)",
                    "content": "Completes a word as described under Completion and listing.\n\ncomplete-word-back (not bound)\nLike complete-word-fwd, but steps up from the end of the list.\n\ncomplete-word-fwd (not bound)\nReplaces the current word with the first word in the list  of  possible  completions.\nMay be repeated to step down through the list.  At the end of the list, beeps and re‐\nverts to the incomplete word.\n\ncomplete-word-raw (^X-tab)\nLike complete-word, but ignores user-defined completions.\n\ncopy-prev-word (M-^)\nCopies the previous word in the current line into the input buffer.  See also insert-\nlast-word.  Word boundary behavior modified by vimode.\n\ndabbrev-expand (M-/)\nExpands  the current word to the most recent preceding one for which the current is a\nleading substring, wrapping around the history list (once) if  necessary.   Repeating\ndabbrev-expand without any intervening typing changes to the next previous word etc.,\nskipping identical matches much like history-search-backward does.\n\ndelete-char (bound to `Del' if using the standard /etc/csh.cshrc)\nDeletes the character under the cursor.  See also delete-char-or-list-or-eof.  Cursor\nbehavior modified by vimode.\n\ndelete-char-or-eof (not bound)\nDoes  delete-char if there is a character under the cursor or end-of-file on an empty\nline.  See also delete-char-or-list-or-eof.  Cursor behavior modified by vimode.\n\ndelete-char-or-list (not bound)\nDoes delete-char if there is a character under the cursor or list-choices at the  end\nof the line.  See also delete-char-or-list-or-eof.\n\ndelete-char-or-list-or-eof (^D)\nDoes delete-char if there is a character under the cursor, list-choices at the end of\nthe line or end-of-file on an empty line.  See also those  three  commands,  each  of\nwhich  does  only  a  single  action, and delete-char-or-eof, delete-char-or-list and\nlist-or-eof, each of which does a different two out of the three.\n\ndelete-word (M-d, M-D)\nCut from cursor to end of current word - save in cut buffer.  Word boundary  behavior\nmodified by vimode.\n\ndown-history (down-arrow, ^N)\nLike up-history, but steps down, stopping at the original input line.\n\ndowncase-word (M-l, M-L)\nLowercase  the characters from cursor to end of current word.  Word boundary behavior\nmodified by vimode.\n\nend-of-file (not bound)\nSignals an end of file, causing the shell to exit unless the ignoreeof shell variable\n(q.v.) is set to prevent this.  See also delete-char-or-list-or-eof.\n\nend-of-line (^E, end)\nMove cursor to end of line.  Cursor behavior modified by vimode.\n\nexpand-history (M-space)\nExpands  history  substitutions  in the current word.  See History substitution.  See\nalso magic-space, toggle-literal-history and the autoexpand shell variable.\n\nexpand-glob (^X-*)\nExpands the glob-pattern to the left of the cursor.  See Filename substitution.\n\nexpand-line (not bound)\nLike expand-history, but expands history substitutions in each word in the input buf‐\nfer.\n\nexpand-variables (^X-$)\nExpands the variable to the left of the cursor.  See Variable substitution.\n\nforward-char (^F, right)\nMove forward one character.  Cursor behavior modified by vimode.\n\nforward-word (M-f, M-F)\nMove  forward  to end of current word.  Word boundary and cursor behavior modified by\nvimode.\n\nhistory-search-backward (M-p, M-P)\nSearches backwards through the history list for a command beginning with the  current\ncontents  of  the  input buffer up to the cursor and copies it into the input buffer.\nThe search string may be a glob-pattern (see Filename substitution)  containing  `*',\n`?',  `[]'  or  `{}'.   up-history and down-history will proceed from the appropriate\npoint in the history list.  Emacs mode only.  See also history-search-forward and  i-\nsearch-back.\n\nhistory-search-forward (M-n, M-N)\nLike history-search-backward, but searches forward.\n\ni-search-back (not bound)\nSearches backward like history-search-backward, copies the first match into the input\nbuffer with the cursor positioned at the end of the pattern, and prompts with `bck: '\nand  the  first  match.   Additional characters may be typed to extend the search, i-\nsearch-back may be typed to continue searching with the same pattern, wrapping around\nthe history list if necessary, (i-search-back must be bound to a single character for\nthis to work) or one of the following special characters may be typed:\n\n^W      Appends the rest of the word under the cursor to the search pattern.\ndelete (or any character bound to backward-delete-char)\nUndoes the effect of the last character typed  and  deletes  a  character\nfrom the search pattern if appropriate.\n^G      If the previous search was successful, aborts the entire search.  If not,\ngoes back to the last successful search.\nescape  Ends the search, leaving the current line in the input buffer.\n\nAny other character not bound to self-insert-command terminates the  search,  leaving\nthe  current  line  in the input buffer, and is then interpreted as normal input.  In\nparticular, a carriage return causes the current line to be executed.   See  also  i-\nsearch-fwd and history-search-backward.  Word boundary behavior modified by vimode.\n\ni-search-fwd (not bound)\nLike i-search-back, but searches forward.  Word boundary behavior modified by vimode.\n\ninsert-last-word (M-)\nInserts  the  last word of the previous input line (`!$') into the input buffer.  See\nalso copy-prev-word.\n\nlist-choices (M-^D)\nLists completion possibilities as described under Completion and listing.   See  also\ndelete-char-or-list-or-eof and list-choices-raw.\n\nlist-choices-raw (^X-^D)\nLike list-choices, but ignores user-defined completions.\n\nlist-glob (^X-g, ^X-G)\nLists  (via the ls-F builtin) matches to the glob-pattern (see Filename substitution)\nto the left of the cursor.\n\nlist-or-eof (not bound)\nDoes list-choices or end-of-file on an empty line.  See also  delete-char-or-list-or-\neof.\n\nmagic-space (not bound)\nExpands history substitutions in the current line, like expand-history, and inserts a\nspace.  magic-space is designed to be bound to the space bar, but is not bound by de‐\nfault.\n\nnormalize-command (^X-?)\nSearches  for the current word in PATH and, if it is found, replaces it with the full\npath to the executable.  Special characters are quoted.   Aliases  are  expanded  and\nquoted  but  commands  within  aliases are not.  This command is useful with commands\nthat take commands as arguments, e.g., `dbx' and `sh -x'.\n\nnormalize-path (^X-n, ^X-N)\nExpands the current word as described under the  `expand'  setting  of  the  symlinks\nshell variable.\n"
                },
                {
                    "name": "overwrite-mode (unbound)",
                    "content": "Toggles between input and overwrite modes.\n\nrun-fg-editor (M-^Z)\nSaves  the current input line and looks for a stopped job where the file name portion\nof its first word is found in the editors shell variable.  If  editors  is  not  set,\nthen the file name portion of the EDITOR environment variable (`ed' if unset) and the\nVISUAL environment variable (`vi' if unset) will be used.  If such a job is found, it\nis  restarted  as if `fg %job' had been typed.  This is used to toggle back and forth\nbetween an editor and the shell easily.  Some people bind this  command  to  `^Z'  so\nthey can do this even more easily.\n\nrun-help (M-h, M-H)\nSearches  for documentation on the current command, using the same notion of `current\ncommand' as the completion routines, and prints it.  There is no way to use a  pager;\nrun-help  is  designed for short help files.  If the special alias helpcommand is de‐\nfined, it is run with the command name  as  a  sole  argument.   Else,  documentation\nshould  be  in a file named command.help, command.1, command.6, command.8 or command,\nwhich should be in one of the directories listed in the HPATH  environment  variable.\nIf there is more than one help file only the first is printed.\n\nself-insert-command (text characters)\nIn  insert  mode (the default), inserts the typed character into the input line after\nthe character under the cursor.  In overwrite mode, replaces the character under  the\ncursor with the typed character.  The input mode is normally preserved between lines,\nbut the inputmode shell variable can be set to `insert' or `overwrite' to put the ed‐\nitor in that mode at the beginning of each line.  See also overwrite-mode.\n\nsequence-lead-in (arrow prefix, meta prefix, ^X)\nIndicates  that the following characters are part of a multi-key sequence.  Binding a\ncommand to a multi-key sequence really creates two bindings: the first  character  to\nsequence-lead-in and the whole sequence to the command.  All sequences beginning with\na character bound to sequence-lead-in are effectively bound to  undefined-key  unless\nbound to another command.\n\nspell-line (M-$)\nAttempts  to  correct the spelling of each word in the input buffer, like spell-word,\nbut ignores words whose first character is one of `-', `!', `^' or `%', or which con‐\ntain  `\\',  `*'  or `?', to avoid problems with switches, substitutions and the like.\nSee Spelling correction.\n\nspell-word (M-s, M-S)\nAttempts to correct the spelling of the current word as described under Spelling cor‐‐\nrection.  Checks each component of a word which appears to be a pathname.\n\ntoggle-literal-history (M-r, M-R)\nExpands  or  `unexpands' history substitutions in the input buffer.  See also expand-\nhistory and the autoexpand shell variable.\n\nundefined-key (any unbound key)\nBeeps.\n\nup-history (up-arrow, ^P)\nCopies the previous entry in the history list into the input buffer.  If  histlit  is\nset, uses the literal form of the entry.  May be repeated to step up through the his‐\ntory list, stopping at the top.\n\nupcase-word (M-u, M-U)\nUppercase the characters from cursor to end of current word.  Word boundary  behavior\nmodified by vimode.\n\nvi-beginning-of-next-word (not bound)\nVi  goto  the  beginning of next word.  Word boundary and cursor behavior modified by\nvimode.\n\nvi-eword (not bound)\nVi move to the end of the current word.  Word boundary behavior modified by vimode.\n\nvi-search-back (?)\nPrompts with `?' for a search string (which may be a glob-pattern, as  with  history-\nsearch-backward),  searches  for  it  and  copies it into the input buffer.  The bell\nrings if no match is found.  Hitting return ends the search and leaves the last match\nin the input buffer.  Hitting escape ends the search and executes the match.  vi mode\nonly.\n\nvi-search-fwd (/)\nLike vi-search-back, but searches forward.\n\nwhich-command (M-?)\nDoes a which (see the description of the builtin command) on the first  word  of  the\ninput buffer.\n\nyank-pop (M-y)\nWhen  executed  immediately  after  a  yank  or another yank-pop, replaces the yanked\nstring with the next previous string from the killring. This also has the  effect  of\nrotating  the  killring,  such  that this string will be considered the most recently\nkilled by a later yank command. Repeating yank-pop will cycle  through  the  killring\nany number of times.\n"
                },
                {
                    "name": "Lexical structure",
                    "content": "The shell splits input lines into words at blanks and tabs.  The special characters `&', `|',\n`;', `<', `>', `(', and `)' and the doubled characters `&&', `||', `<<' and `>>'  are  always\nseparate words, whether or not they are surrounded by whitespace.\n\nWhen  the  shell's  input  is  not a terminal, the character `#' is taken to begin a comment.\nEach `#' and the rest of the input line on which it appears is discarded before further pars‐\ning.\n\nA special character (including a blank or tab) may be prevented from having its special mean‐\ning, and possibly made part of another word, by preceding it with a backslash  (`\\')  or  en‐\nclosing it in single (`''), double (`\"') or backward (``') quotes.  When not otherwise quoted\na newline preceded by a `\\' is equivalent to a blank, but inside quotes this sequence results\nin a newline.\n\nFurthermore,  all  Substitutions  (see below) except History substitution can be prevented by\nenclosing the strings (or parts of strings) in which they appear with  single  quotes  or  by\nquoting  the crucial character(s) (e.g., `$' or ``' for Variable substitution or Command sub‐‐\nstitution respectively) with `\\'.  (Alias substitution is no exception: quoting  in  any  way\nany  character  of  a  word  for which an alias has been defined prevents substitution of the\nalias.  The usual way of quoting an alias is to precede it with a backslash.) History substi‐‐\ntution  is  prevented by backslashes but not by single quotes.  Strings quoted with double or\nbackward quotes undergo Variable substitution and Command substitution, but  other  substitu‐\ntions are prevented.\n\nText  inside  single or double quotes becomes a single word (or part of one).  Metacharacters\nin these strings, including blanks and tabs, do not form separate words.  Only in one special\ncase (see Command substitution below) can a double-quoted string yield parts of more than one\nword; single-quoted strings never do.  Backward quotes are special: they signal Command  sub‐‐\nstitution (q.v.), which may result in more than one word.\n\nQuoting  complex  strings,  particularly strings which themselves contain quoting characters,\ncan be confusing.  Remember that quotes need not be used as they are in  human  writing!   It\nmay  be  easier  to quote not an entire string, but only those parts of the string which need\nquoting, using different types of quoting to do so if appropriate.\n\nThe backslashquote shell variable (q.v.) can be set to make backslashes  always  quote  `\\',\n`'', and `\"'.  (+) This may make complex quoting tasks easier, but it can cause syntax errors\nin csh(1) scripts.\n"
                },
                {
                    "name": "Substitutions",
                    "content": "We now describe the various transformations the shell performs on the input in the  order  in\nwhich they occur.  We note in passing the data structures involved and the commands and vari‐\nables which affect them.  Remember that substitutions can be  prevented  by  quoting  as  de‐\nscribed under Lexical structure.\n"
                },
                {
                    "name": "History substitution",
                    "content": "Each command, or ``event'', input from the terminal is saved in the history list.  The previ‐\nous command is always saved, and the history shell variable can be set to a  number  to  save\nthat  many  commands.   The histdup shell variable can be set to not save duplicate events or\nconsecutive duplicate events.\n\nSaved commands are numbered sequentially from 1 and stamped with the time.  It is not usually\nnecessary  to  use event numbers, but the current event number can be made part of the prompt\nby placing an `!' in the prompt shell variable.\n\nThe shell actually saves history in expanded and literal (unexpanded) forms.  If the  histlit\nshell variable is set, commands that display and store history use the literal form.\n\nThe history builtin command can print, store in a file, restore and clear the history list at\nany time, and the savehist and histfile shell variables can be set to store the history  list\nautomatically on logout and restore it on login.\n\nHistory  substitutions introduce words from the history list into the input stream, making it\neasy to repeat commands, repeat arguments of a previous command in the  current  command,  or\nfix  spelling mistakes in the previous command with little typing and a high degree of confi‐\ndence.\n\nHistory substitutions begin with the character `!'.  They may begin  anywhere  in  the  input\nstream,  but they do not nest.  The `!' may be preceded by a `\\' to prevent its special mean‐\ning; for convenience, a `!' is passed unchanged when it is followed by a blank, tab, newline,\n`='  or `('.  History substitutions also occur when an input line begins with `^'.  This spe‐\ncial abbreviation will be described later.  The characters used to signal  history  substitu‐\ntion  (`!'  and  `^') can be changed by setting the histchars shell variable.  Any input line\nwhich contains a history substitution is printed before it is executed.\n\nA history substitution may have an ``event specification'', which indicates  the  event  from\nwhich  words  are to be taken, a ``word designator'', which selects particular words from the\nchosen event, and/or a ``modifier'', which manipulates the selected words.\n\nAn event specification can be\n\nn       A number, referring to a particular event\n-n      An offset, referring to the event n before the current event\n#       The current event.  This should be used carefully in csh(1), where  there  is  no\ncheck for recursion.  tcsh allows 10 levels of recursion.  (+)\n!       The previous event (equivalent to `-1')\ns       The most recent event whose first word begins with the string s\n?s?     The most recent event which contains the string s.  The second `?' can be omitted\nif it is immediately followed by a newline.\n\nFor example, consider this bit of someone's history list:\n\n9  8:30    nroff -man wumpus.man\n10  8:31    cp wumpus.man wumpus.man.old\n11  8:36    vi wumpus.man\n12  8:37    diff wumpus.man.old wumpus.man\n\nThe commands are shown with their event numbers and time stamps.  The current event, which we\nhaven't  typed  in  yet, is event 13.  `!11' and `!-2' refer to event 11.  `!!' refers to the\nprevious event, 12.  `!!' can be abbreviated `!' if it is followed by `:' (`:'  is  described\nbelow).   `!n'  refers  to event 9, which begins with `n'.  `!?old?' also refers to event 12,\nwhich contains `old'.  Without word designators or modifiers history references simply expand\nto  the  entire  event,  so  we might type `!cp' to redo the copy command or `!!|more' if the\n`diff' output scrolled off the top of the screen.\n\nHistory references may be insulated from the surrounding text with braces if necessary.   For\nexample,  `!vdoc'  would  look for a command beginning with `vdoc', and, in this example, not\nfind one, but `!{v}doc' would expand unambiguously to `vi wumpus.mandoc'.   Even  in  braces,\nhistory substitutions do not nest.\n\n(+)  While  csh(1) expands, for example, `!3d' to event 3 with the letter `d' appended to it,\ntcsh expands it to the last event beginning with `3d'; only completely numeric arguments  are\ntreated  as  event  numbers.  This makes it possible to recall events beginning with numbers.\nTo expand `!3d' as in csh(1) say `!{3}d'.\n\nTo select words from an event we can follow the event specification by a `:' and a designator\nfor  the  desired  words.  The words of an input line are numbered from 0, the first (usually\ncommand) word being 0, the second word (first argument) being 1, etc.  The basic word  desig‐\nnators are:\n\n0       The first (command) word\nn       The nth argument\n^       The first argument, equivalent to `1'\n$       The last argument\n%       The word matched by an ?s? search\nx-y     A range of words\n-y      Equivalent to `0-y'\n*       Equivalent to `^-$', but returns nothing if the event contains only 1 word\nx*      Equivalent to `x-$'\nx-      Equivalent to `x*', but omitting the last word (`$')\n\nSelected  words  are inserted into the command line separated by single blanks.  For example,\nthe `diff' command in the previous example might have been typed as `diff !!:1.old !!:1' (us‐\ning  `:1'  to select the first argument from the previous event) or `diff !-2:2 !-2:1' to se‐\nlect and swap the arguments from the `cp' command.  If we didn't care about the order of  the\n`diff' we might have said `diff !-2:1-2' or simply `diff !-2:*'.  The `cp' command might have\nbeen written `cp wumpus.man !#:1.old', using `#'  to  refer  to  the  current  event.   `!n:-\nhurkle.man'  would  reuse  the  first  two  words from the `nroff' command to say `nroff -man\nhurkle.man'.\n\nThe `:' separating the event specification from the word designator can be omitted if the ar‐\ngument  selector  begins  with  a `^', `$', `*', `%' or `-'.  For example, our `diff' command\nmight have been `diff !!^.old !!^' or, equivalently, `diff !!$.old !!$'.  However, if `!!' is\nabbreviated  `!',  an  argument  selector  beginning with `-' will be interpreted as an event\nspecification.\n\nA history reference may have a word designator but no event specification.   It  then  refer‐\nences  the  previous command.  Continuing our `diff' example, we could have said simply `diff\n!^.old !^' or, to get the arguments in the opposite order, just `diff !*'.\n\nThe word or words in a history reference can be edited, or ``modified'', by following it with\none or more modifiers, each preceded by a `:':\n\nh       Remove a trailing pathname component, leaving the head.\nt       Remove all leading pathname components, leaving the tail.\nr       Remove a filename extension `.xxx', leaving the root name.\ne       Remove all but the extension.\nu       Uppercase the first lowercase letter.\nl       Lowercase the first uppercase letter.\ns/l/r/  Substitute  l for r.  l is simply a string like r, not a regular expression as in\nthe eponymous ed(1) command.  Any character may be used as the delimiter in place\nof  `/';  a `\\' can be used to quote the delimiter inside l and r.  The character\n`&' in the r is replaced by l; `\\' also quotes `&'.  If l is empty (``''), the  l\nfrom  a  previous substitution or the s from a previous search or event number in\nevent specification is used.  The trailing delimiter may be omitted if it is  im‐\nmediately followed by a newline.\n&       Repeat the previous substitution.\ng       Apply the following modifier once to each word.\na (+)   Apply the following modifier as many times as possible to a single word.  `a' and\n`g' can be used together to apply a modifier globally.  With  the  `s'  modifier,\nonly  the  patterns  contained in the original word are substituted, not patterns\nthat contain any substitution result.\np       Print the new command line but do not execute it.\nq       Quote the substituted words, preventing further substitutions.\nx       Like q, but break into words at blanks, tabs and newlines.\n\nModifiers are applied to only the first modifiable word (unless `g' is used).  It is an error\nfor no word to be modifiable.\n\nFor example, the `diff' command might have been written as `diff wumpus.man.old !#^:r', using\n`:r' to remove `.old' from the first argument on the same line (`!#^').  We could  say  `echo\nhello out there', then `echo !*:u' to capitalize `hello', `echo !*:au' to say it out loud, or\n`echo !*:agu' to really shout.  We might follow `mail -s \"I forgot  my  password\"  rot'  with\n`!:s/rot/root' to correct the spelling of `root' (but see Spelling correction for a different\napproach).\n\nThere is a special abbreviation for substitutions.  `^', when it is the first character on an\ninput  line, is equivalent to `!:s^'.  Thus we might have said `^rot^root' to make the spell‐\ning correction in the previous example.  This is the only history substitution which does not\nexplicitly begin with `!'.\n\n(+)  In  csh as such, only one modifier may be applied to each history or variable expansion.\nIn tcsh, more than one may be used, for example\n\n% mv wumpus.man /usr/man/man1/wumpus.1\n% man !$:t:r\nman wumpus\n\nIn csh, the result would be `wumpus.1:r'.  A substitution followed by a colon may need to  be\ninsulated from it with braces:\n\n> mv a.out /usr/games/wumpus\n> setenv PATH !$:h:$PATH\nBad ! modifier: $.\n> setenv PATH !{-2$:h}:$PATH\nsetenv PATH /usr/games:/bin:/usr/bin:.\n\nThe  first attempt would succeed in csh but fails in tcsh, because tcsh expects another modi‐\nfier after the second colon rather than `$'.\n\nFinally, history can be accessed through the editor as well as through the substitutions just\ndescribed.  The up- and down-history, history-search-backward and -forward, i-search-back and\n-fwd, vi-search-back and -fwd, copy-prev-word and insert-last-word editor commands search for\nevents  in  the history list and copy them into the input buffer.  The toggle-literal-history\neditor command switches between the expanded and literal forms of history lines in the  input\nbuffer.   expand-history and expand-line expand history substitutions in the current word and\nin the entire input buffer respectively.\n"
                },
                {
                    "name": "Alias substitution",
                    "content": "The shell maintains a list of aliases which can be set, unset and printed by  the  alias  and\nunalias  commands.   After  a  command line is parsed into simple commands (see Commands) the\nfirst word of each command, left-to-right, is checked to see if it has an alias.  If so,  the\nfirst word is replaced by the alias.  If the alias contains a history reference, it undergoes\nHistory substitution (q.v.) as though the original command were the previous input line.   If\nthe alias does not contain a history reference, the argument list is left untouched.\n\nThus  if the alias for `ls' were `ls -l' the command `ls /usr' would become `ls -l /usr', the\nargument list here being undisturbed.  If the alias for `lookup' were `grep  !^  /etc/passwd'\nthen  `lookup  bill'  would become `grep bill /etc/passwd'.  Aliases can be used to introduce\nparser metasyntax.  For example, `alias print 'pr \\!* | lpr'' defines a ``command'' (`print')\nwhich pr(1)s its arguments to the line printer.\n\nAlias substitution is repeated until the first word of the command has no alias.  If an alias\nsubstitution does not change the first word (as in the previous example)  it  is  flagged  to\nprevent a loop.  Other loops are detected and cause an error.\n\nSome aliases are referred to by the shell; see Special aliases.\n"
                },
                {
                    "name": "Variable substitution",
                    "content": "The  shell  maintains  a list of variables, each of which has as value a list of zero or more\nwords.  The values of shell variables can be displayed and changed with  the  set  and  unset\ncommands.  The system maintains its own list of ``environment'' variables.  These can be dis‐\nplayed and changed with printenv, setenv and unsetenv.\n\n(+) Variables may be made read-only with `set -r' (q.v.).  Read-only  variables  may  not  be\nmodified  or unset; attempting to do so will cause an error.  Once made read-only, a variable\ncannot be made writable, so `set -r' should be used with caution.  Environment variables can‐\nnot be made read-only.\n\nSome variables are set by the shell or referred to by it.  For instance, the argv variable is\nan image of the shell's argument list, and words of this variable's value are referred to  in\nspecial ways.  Some of the variables referred to by the shell are toggles; the shell does not\ncare what their value is, only whether they are set or not.  For instance, the verbose  vari‐\nable  is  a  toggle which causes command input to be echoed.  The -v command line option sets\nthis variable.  Special shell variables lists all variables which  are  referred  to  by  the\nshell.\n\nOther  operations  treat variables numerically.  The `@' command permits numeric calculations\nto be performed and the result assigned to a variable.  Variable values are, however,  always\nrepresented  as  (zero  or  more)  strings.  For the purposes of numeric operations, the null\nstring is considered to be zero, and the second and subsequent words of multi-word values are\nignored.\n\nAfter  the  input  line  is aliased and parsed, and before each command is executed, variable\nsubstitution is performed keyed by `$' characters.  This expansion can be prevented  by  pre‐\nceding the `$' with a `\\' except within `\"'s where it always occurs, and within `''s where it\nnever occurs.  Strings quoted by ``' are interpreted later (see Command  substitution  below)\nso  `$'  substitution does not occur there until later, if at all.  A `$' is passed unchanged\nif followed by a blank, tab, or end-of-line.\n\nInput/output redirections are recognized before variable expansion, and are variable expanded\nseparately.   Otherwise, the command name and entire argument list are expanded together.  It\nis thus possible for the first (command) word (to this point) to generate more than one word,\nthe first of which becomes the command name, and the rest of which become arguments.\n\nUnless  enclosed  in  `\"' or given the `:q' modifier the results of variable substitution may\neventually be command and filename substituted.  Within `\"', a variable whose value  consists\nof  multiple  words expands to a (portion of a) single word, with the words of the variable's\nvalue separated by blanks.  When the `:q' modifier is applied to a substitution the  variable\nwill expand to multiple words with each word separated by a blank and quoted to prevent later\ncommand or filename substitution.\n\nThe following metasequences are provided for introducing variable values into the  shell  in‐\nput.  Except as noted, it is an error to reference a variable which is not set.\n\n$name\n${name} Substitutes  the  words  of  the  value  of variable name, each separated by a blank.\nBraces insulate name from following characters which would otherwise be part  of  it.\nShell  variables  have names consisting of letters and digits starting with a letter.\nThe underscore character is considered a letter.  If name is not  a  shell  variable,\nbut  is  set  in  the environment, then that value is returned (but some of the other\nforms given below are not available in this case).\n$name[selector]\n${name[selector]}\nSubstitutes only the selected words from the value of name.   The  selector  is  sub‐\njected  to  `$'  substitution and may consist of a single number or two numbers sepa‐\nrated by a `-'.  The first word of a variable's value is numbered `1'.  If the  first\nnumber  of  a  range is omitted it defaults to `1'.  If the last member of a range is\nomitted it defaults to `$#name'.  The selector `*' selects all words.  It is  not  an\nerror for a range to be empty if the second argument is omitted or in range.\n$0      Substitutes  the  name  of the file from which command input is being read.  An error\noccurs if the name is not known.\n$number\n${number}\nEquivalent to `$argv[number]'.\n$*      Equivalent to `$argv', which is equivalent to `$argv[*]'.\n\nThe `:' modifiers described under History substitution, except for `:p', can  be  applied  to\nthe  substitutions above.  More than one may be used.  (+) Braces may be needed to insulate a\nvariable substitution from a literal colon just as with History substitution (q.v.); any mod‐\nifiers must appear within the braces.\n\nThe following substitutions can not be modified with `:' modifiers.\n\n$?name\n${?name}\nSubstitutes the string `1' if name is set, `0' if it is not.\n$?0     Substitutes `1' if the current input filename is known, `0' if it is not.  Always `0'\nin interactive shells.\n$#name\n${#name}\nSubstitutes the number of words in name.\n$#      Equivalent to `$#argv'.  (+)\n$%name\n${%name}\nSubstitutes the number of characters in name.  (+)\n$%number\n${%number}\nSubstitutes the number of characters in $argv[number].  (+)\n$?      Equivalent to `$status'.  (+)\n$$      Substitutes the (decimal) process number of the (parent) shell.\n$!      Substitutes the (decimal) process number of the last background  process  started  by\nthis shell.  (+)\n$      Substitutes the command line of the last command executed.  (+)\n$<      Substitutes  a  line  from  the standard input, with no further interpretation there‐\nafter.  It can be used to read from the keyboard in a shell script.   (+)  While  csh\nalways  quotes  $<,  as if it were equivalent to `$<:q', tcsh does not.  Furthermore,\nwhen tcsh is waiting for a line to be typed the user may type an interrupt to  inter‐\nrupt  the  sequence  into which the line is to be substituted, but csh does not allow\nthis.\n\nThe editor command expand-variables, normally bound to `^X-$', can be used  to  interactively\nexpand individual variables.\n"
                },
                {
                    "name": "Command, filename and directory stack substitution",
                    "content": "The  remaining  substitutions  are  applied selectively to the arguments of builtin commands.\nThis means that portions of expressions which are not evaluated are not  subjected  to  these\nexpansions.   For  commands  which are not internal to the shell, the command name is substi‐\ntuted separately from the argument list.  This occurs very late, after input-output redirect‐\nion is performed, and in a child of the main shell.\n"
                },
                {
                    "name": "Command substitution",
                    "content": "Command  substitution is indicated by a command enclosed in ``'.  The output from such a com‐\nmand is broken into separate words at blanks, tabs and newlines,  and  null  words  are  dis‐\ncarded.   The  output  is  variable  and command substituted and put in place of the original\nstring.\n\nCommand substitutions inside double quotes (`\"') retain blanks and tabs; only newlines  force\nnew  words.  The single final newline does not force a new word in any case.  It is thus pos‐\nsible for a command substitution to yield only part of a word, even if the command outputs  a\ncomplete line.\n\nBy  default, the shell since version 6.12 replaces all newline and carriage return characters\nin the command by spaces.  If this is switched off by unsetting csubstnonl, newlines separate\ncommands as usual.\n"
                },
                {
                    "name": "Filename substitution",
                    "content": "If  a  word  contains any of the characters `*', `?', `[' or `{' or begins with the character\n`~' it is a candidate for filename substitution, also known as ``globbing''.   This  word  is\nthen  regarded  as  a  pattern (``glob-pattern''), and replaced with an alphabetically sorted\nlist of file names which match the pattern.\n\nIn matching filenames, the character `.' at the beginning of a filename or  immediately  fol‐\nlowing  a `/', as well as the character `/' must be matched explicitly (unless either globdot\nor globstar or both are set(+)).  The character `*' matches any string of characters, includ‐\ning  the  null string.  The character `?' matches any single character.  The sequence `[...]'\nmatches any one of the characters enclosed.  Within `[...]', a pair of  characters  separated\nby `-' matches any character lexically between the two.\n\n(+) Some glob-patterns can be negated: The sequence `[^...]' matches any single character not\nspecified by the characters and/or ranges of characters in the braces.\n\nAn entire glob-pattern can also be negated with `^':\n\n> echo *\nbang crash crunch ouch\n> echo ^cr*\nbang ouch\n\nGlob-patterns which do not use `?', `*', or `[]' or which use `{}' or  `~'  (below)  are  not\nnegated correctly.\n\nThe  metanotation  `a{b,c,d}e' is a shorthand for `abe ace ade'.  Left-to-right order is pre‐\nserved:      `/usr/source/s1/{oldls,ls}.c'      expands      to       `/usr/source/s1/oldls.c\n/usr/source/s1/ls.c'.   The  results  of matches are sorted separately at a low level to pre‐\nserve this order: `../{memo,*box}' might expand to  `../memo  ../box  ../mbox'.   (Note  that\n`memo'  was  not  sorted  with the results of matching `*box'.)  It is not an error when this\nconstruct expands to files which do not exist, but it is possible to get an error from a com‐\nmand  to which the expanded list is passed.  This construct may be nested.  As a special case\nthe words `{', `}' and `{}' are passed undisturbed.\n\nThe character `~' at the beginning of a filename refers to home directories.  Standing alone,\ni.e.,  `~',  it expands to the invoker's home directory as reflected in the value of the home\nshell variable.  When followed by a name consisting of letters, digits and `-' characters the\nshell  searches  for  a user with that name and substitutes their home directory; thus `~ken'\nmight expand to `/usr/ken' and `~ken/chmach' to `/usr/ken/chmach'.  If the character  `~'  is\nfollowed by a character other than a letter or `/' or appears elsewhere than at the beginning\nof a word, it  is  left  undisturbed.   A  command  like  `setenv  MANPATH  /usr/man:/usr/lo‐\ncal/man:~/lib/man' does not, therefore, do home directory substitution as one might hope.\n\nIt  is  an error for a glob-pattern containing `*', `?', `[' or `~', with or without `^', not\nto match any files.  However, only one pattern in a list of glob-patterns must match  a  file\n(so that, e.g., `rm *.a *.c *.o' would fail only if there were no files in the current direc‐\ntory ending in `.a', `.c', or `.o'), and if the nonomatch shell variable is set a pattern (or\nlist of patterns) which matches nothing is left unchanged rather than causing an error.\n\nThe  globstar  shell  variable  can be set to allow `' or `*' as a file glob pattern that\nmatches any string of characters including `/', recursively traversing any  existing  sub-di‐\nrectories.   For example, `ls .c' will list all the .c files in the current directory tree.\nIf  used  by  itself,  it  will  match  zero  or  more  sub-directories  (e.g.  `ls  /usr/in‐\nclude//time.h'  will  list  any file named `time.h' in the /usr/include directory tree; `ls\n/usr/include/time.h' will match any file in  the  /usr/include  directory  tree  ending  in\n`time.h';  and  `ls  /usr/include/time.h'  will match any .h file with `time' either in a\nsubdirectory name or in the filename itself).  To prevent problems with recursion,  the  `'\nglob-pattern will not descend into a symbolic link containing a directory.  To override this,\nuse `*' (+)\n\nThe noglob shell variable can be set to prevent filename substitution,  and  the  expand-glob\neditor  command,  normally  bound  to  `^X-*', can be used to interactively expand individual\nfilename substitutions.\n"
                },
                {
                    "name": "Directory stack substitution (+)",
                    "content": "The directory stack is a list of directories, numbered from zero, used by the pushd, popd and\ndirs  builtin commands (q.v.).  dirs can print, store in a file, restore and clear the direc‐\ntory stack at any time, and the savedirs and dirsfile shell variables can be set to store the\ndirectory stack automatically on logout and restore it on login.  The dirstack shell variable\ncan be examined to see the directory stack and set to put arbitrary directories into the  di‐\nrectory stack.\n\nThe  character `=' followed by one or more digits expands to an entry in the directory stack.\nThe special case `=-' expands to the last directory in the stack.  For example,\n\n> dirs -v\n0       /usr/bin\n1       /usr/spool/uucp\n2       /usr/accts/sys\n> echo =1\n/usr/spool/uucp\n> echo =0/calendar\n/usr/bin/calendar\n> echo =-\n/usr/accts/sys\n\nThe noglob and nonomatch shell variables and the expand-glob editor command apply  to  direc‐\ntory stack as well as filename substitutions.\n"
                },
                {
                    "name": "Other substitutions (+)",
                    "content": "There are several more transformations involving filenames, not strictly related to the above\nbut mentioned here for completeness.  Any filename may be expanded to a full  path  when  the\nsymlinks  variable  (q.v.) is set to `expand'.  Quoting prevents this expansion, and the nor‐\nmalize-path editor command does it on demand.  The normalize-command editor  command  expands\ncommands  in  PATH into full paths on demand.  Finally, cd and pushd interpret `-' as the old\nworking directory (equivalent to the shell variable owd).  This is not a substitution at all,\nbut  an abbreviation recognized by only those commands.  Nonetheless, it too can be prevented\nby quoting.\n"
                },
                {
                    "name": "Commands",
                    "content": "The next three sections describe how the shell executes commands and deals with  their  input\nand output.\n"
                },
                {
                    "name": "Simple commands, pipelines and sequences",
                    "content": "A  simple command is a sequence of words, the first of which specifies the command to be exe‐\ncuted.  A series of simple commands joined by `|' characters forms a pipeline.  The output of\neach command in a pipeline is connected to the input of the next.\n\nSimple commands and pipelines may be joined into sequences with `;', and will be executed se‐\nquentially.  Commands and pipelines can also be joined into sequences with `||' or `&&',  in‐\ndicating,  as in the C language, that the second is to be executed only if the first fails or\nsucceeds respectively.\n\nA simple command, pipeline or sequence may be placed in parentheses, `()', to form  a  simple\ncommand,  which may in turn be a component of a pipeline or sequence.  A command, pipeline or\nsequence can be executed without waiting for it to terminate by following it with an `&'.\n"
                },
                {
                    "name": "Builtin and non-builtin command execution",
                    "content": "Builtin commands are executed within the shell.  If any component of a  pipeline  except  the\nlast is a builtin command, the pipeline is executed in a subshell.\n\nParenthesized commands are always executed in a subshell.\n\n(cd; pwd); pwd\n\nthus  prints the home directory, leaving you where you were (printing this after the home di‐\nrectory), while\n\ncd; pwd\n\nleaves you in the home directory.  Parenthesized commands are most often used to  prevent  cd\nfrom affecting the current shell.\n\nWhen a command to be executed is found not to be a builtin command the shell attempts to exe‐\ncute the command via execve(2).  Each word in the variable path names a  directory  in  which\nthe shell will look for the command.  If the shell is not given a -f option, the shell hashes\nthe names in these directories into an internal table so that it will  try  an  execve(2)  in\nonly  a  directory where there is a possibility that the command resides there.  This greatly\nspeeds command location when a large number of directories are present in  the  search  path.\nThis hashing mechanism is not used:\n\n1.  If hashing is turned explicitly off via unhash.\n\n2.  If the shell was given a -f argument.\n\n3.  For each directory component of path which does not begin with a `/'.\n\n4.  If the command contains a `/'.\n\nIn  the  above  four  cases the shell concatenates each component of the path vector with the\ngiven command name to form a path name of a file which it then attempts to execute it. If ex‐\necution is successful, the search stops.\n\nIf  the file has execute permissions but is not an executable to the system (i.e., it is nei‐\nther an executable binary nor a script that specifies its interpreter), then it is assumed to\nbe a file containing shell commands and a new shell is spawned to read it.  The shell special\nalias may be set to specify an interpreter other than the shell itself.\n\nOn systems which do not understand the `#!' script interpreter convention the  shell  may  be\ncompiled  to  emulate  it; see the version shell variable.  If so, the shell checks the first\nline of the file to see if it is of the form `#!interpreter arg ...'.  If it  is,  the  shell\nstarts interpreter with the given args and feeds the file to it on standard input.\n"
                },
                {
                    "name": "Input/output",
                    "content": "The standard input and standard output of a command may be redirected with the following syn‐\ntax:\n\n< name  Open file name (which is first variable, command and filename expanded) as the  stan‐\ndard input.\n<< word Read  the shell input up to a line which is identical to word.  word is not subjected\nto variable, filename or command substitution, and each input  line  is  compared  to\nword  before  any  substitutions  are done on this input line.  Unless a quoting `\\',\n`\"', `' or ``' appears in word variable and command substitution is performed on  the\nintervening  lines,  allowing `\\' to quote `$', `\\' and ``'.  Commands which are sub‐\nstituted have all blanks, tabs, and newlines preserved, except for the final  newline\nwhich  is dropped.  The resultant text is placed in an anonymous temporary file which\nis given to the command as standard input.\n> name\n>! name\n>& name\n>&! name\nThe file name is used as standard output.  If the file does not exist then it is cre‐\nated; if the file exists, it is truncated, its previous contents being lost.\n\nIf  the shell variable noclobber is set, then the file must not exist or be a charac‐\nter special file (e.g., a terminal or `/dev/null') or an error results.   This  helps\nprevent  accidental  destruction of files.  In this case the `!' forms can be used to\nsuppress this check.  If notempty is given in noclobber,  `>'  is  allowed  on  empty\nfiles; if ask is set, an interacive confirmation is presented, rather than an error.\n\nThe  forms  involving `&' route the diagnostic output into the specified file as well\nas the standard output.  name is expanded in the same way as `<' input filenames are.\n>> name\n>>& name\n>>! name\n>>&! name\nLike `>', but appends output to the end of name.  If the shell variable noclobber  is\nset,  then  it  is an error for the file not to exist, unless one of the `!' forms is\ngiven.\n\nA command receives the environment in which the shell was invoked as modified by  the  input-\noutput  parameters and the presence of the command in a pipeline.  Thus, unlike some previous\nshells, commands run from a file of shell commands have no access to the text of the commands\nby default; rather they receive the original standard input of the shell.  The `<<' mechanism\nshould be used to present inline data.  This permits shell command  scripts  to  function  as\ncomponents  of pipelines and allows the shell to block read its input.  Note that the default\nstandard input for a command run detached is not the empty file /dev/null, but  the  original\nstandard  input of the shell.  If this is a terminal and if the process attempts to read from\nthe terminal, then the process will block and the user will be notified (see Jobs).\n\nDiagnostic output may be directed through a pipe with the standard output.   Simply  use  the\nform `|&' rather than just `|'.\n\nThe  shell cannot presently redirect diagnostic output without also redirecting standard out‐\nput, but `(command > output-file) >& error-file' is often an acceptable  workaround.   Either\noutput-file or error-file may be `/dev/tty' to send output to the terminal.\n"
                },
                {
                    "name": "Features",
                    "content": "Having  described  how the shell accepts, parses and executes command lines, we now turn to a\nvariety of its useful features.\n"
                },
                {
                    "name": "Control flow",
                    "content": "The shell contains a number of commands which can be used to regulate the flow of control  in\ncommand  files  (shell  scripts) and (in limited but useful ways) from terminal input.  These\ncommands all operate by forcing the shell to reread or skip in its input and, due to the  im‐\nplementation, restrict the placement of some of the commands.\n\nThe  foreach, switch, and while statements, as well as the if-then-else form of the if state‐\nment, require that the major keywords appear in a single simple command on an input  line  as\nshown below.\n\nIf  the  shell's  input  is not seekable, the shell buffers up input whenever a loop is being\nread and performs seeks in this internal buffer to accomplish the rereading  implied  by  the\nloop.  (To the extent that this allows, backward gotos will succeed on non-seekable inputs.)\n"
                },
                {
                    "name": "Expressions",
                    "content": "The  if,  while  and exit builtin commands use expressions with a common syntax.  The expres‐\nsions can include any of the operators described in the next three sections.  Note that the @\nbuiltin command (q.v.) has its own separate syntax.\n"
                },
                {
                    "name": "Logical, arithmetical and comparison operators",
                    "content": "These operators are similar to those of C and have the same precedence.  They include\n\n||  &&  |  ^  &  ==  !=  =~  !~  <=  >=\n<  > <<  >>  +  -  *  /  %  !  ~  (  )\n\nHere  the  precedence increases to the right, `==' `!=' `=~' and `!~', `<=' `>=' `<' and `>',\n`<<' and `>>', `+' and `-', `*' `/' and `%' being, in groups, at the same  level.   The  `=='\n`!='  `=~'  and `!~' operators compare their arguments as strings; all others operate on num‐\nbers.  The operators `=~' and `!~' are like `!=' and `==' except that the right hand side  is\na  glob-pattern  (see  Filename substitution) against which the left hand operand is matched.\nThis reduces the need for use of the switch builtin command in shell scripts when all that is\nreally needed is pattern matching.\n\nNull  or  missing  arguments are considered `0'.  The results of all expressions are strings,\nwhich represent decimal numbers.  It is important to note that no two components  of  an  ex‐\npression can appear in the same word; except when adjacent to components of expressions which\nare syntactically significant to the parser (`&' `|' `<' `>' `(' `)')  they  should  be  sur‐\nrounded by spaces.\n"
                },
                {
                    "name": "Command exit status",
                    "content": "Commands  can  be executed in expressions and their exit status returned by enclosing them in\nbraces (`{}').  Remember that the braces should be separated from the words of the command by\nspaces.   Command  executions  succeed,  returning true, i.e., `1', if the command exits with\nstatus 0, otherwise they fail, returning false, i.e., `0'.  If more detailed status  informa‐\ntion  is required then the command should be executed outside of an expression and the status\nshell variable examined.\n"
                },
                {
                    "name": "File inquiry operators",
                    "content": "Some of these operators perform true/false tests on files and related objects.  They  are  of\nthe form -op file, where op is one of\n\nr   Read access\nw   Write access\nx   Execute access\nX   Executable  in  the  path or shell builtin, e.g., `-X ls' and `-X ls-F' are generally\ntrue, but `-X /bin/ls' is not (+)\ne   Existence\no   Ownership\nz   Zero size\ns   Non-zero size (+)\nf   Plain file\nd   Directory\nl   Symbolic link (+) *\nb   Block special file (+)\nc   Character special file (+)\np   Named pipe (fifo) (+) *\nS   Socket special file (+) *\nu   Set-user-ID bit is set (+)\ng   Set-group-ID bit is set (+)\nk   Sticky bit is set (+)\nt   file (which must be a digit) is an open file descriptor for a terminal device (+)\nR   Has been migrated (Convex only) (+)\nL   Applies subsequent operators in a multiple-operator test to a  symbolic  link  rather\nthan to the file to which the link points (+) *\n\nfile  is  command  and filename expanded and then tested to see if it has the specified rela‐\ntionship to the real user.  If file does not exist or is inaccessible or, for  the  operators\nindicated  by  `*', if the specified file type does not exist on the current system, then all\ninquiries return false, i.e., `0'.\n\nThese operators may be combined for conciseness: `-xy file' is equivalent to `-x file  &&  -y\nfile'.   (+) For example, `-fx' is true (returns `1') for plain executable files, but not for\ndirectories.\n\nL may be used in a multiple-operator test to apply subsequent operators to  a  symbolic  link\nrather  than  to  the  file  to which the link points.  For example, `-lLo' is true for links\nowned by the invoking user.  Lr, Lw and Lx are always true for links and false for non-links.\nL  has  a different meaning when it is the last operator in a multiple-operator test; see be‐\nlow.\n\nIt is possible but not useful, and sometimes misleading, to combine  operators  which  expect\nfile  to  be a file with operators which do not (e.g., X and t).  Following L with a non-file\noperator can lead to particularly strange results.\n\nOther operators return other information, i.e., not just `0' or `1'.  (+) They have the  same\nformat as before; op may be one of\n\nA       Last file access time, as the number of seconds since the epoch\nA:      Like A, but in timestamp format, e.g., `Fri May 14 16:36:10 1993'\nM       Last file modification time\nM:      Like M, but in timestamp format\nC       Last inode modification time\nC:      Like C, but in timestamp format\nD       Device number\nI       Inode number\nF       Composite file identifier, in the form device:inode\nL       The name of the file pointed to by a symbolic link\nN       Number of (hard) links\nP       Permissions, in octal, without leading zero\nP:      Like P, with leading zero\nPmode   Equivalent  to  `-P  file  &  mode',  e.g.,  `-P22  file' returns `22' if file is\nwritable by group and other, `20' if by group only, and `0' if by neither\nPmode:  Like Pmode, with leading zero\nU       Numeric userid\nU:      Username, or the numeric userid if the username is unknown\nG       Numeric groupid\nG:      Groupname, or the numeric groupid if the groupname is unknown\nZ       Size, in bytes\n\nOnly one of these operators may appear in a multiple-operator test, and it must be the  last.\nNote  that L has a different meaning at the end of and elsewhere in a multiple-operator test.\nBecause `0' is a valid return value for many of these operators, they do not return `0'  when\nthey fail: most return `-1', and F returns `:'.\n\nIf the shell is compiled with POSIX defined (see the version shell variable), the result of a\nfile inquiry is based on the permission bits of the file and not on the  result  of  the  ac‐\ncess(2)  system call.  For example, if one tests a file with -w whose permissions would ordi‐\nnarily allow writing but which is on a file system mounted read-only, the test  will  succeed\nin a POSIX shell but fail in a non-POSIX shell.\n\nFile inquiry operators can also be evaluated with the filetest builtin command (q.v.) (+).\n"
                },
                {
                    "name": "Jobs",
                    "content": "The  shell associates a job with each pipeline.  It keeps a table of current jobs, printed by\nthe jobs command, and assigns them small integer  numbers.   When  a  job  is  started  asyn‐\nchronously with `&', the shell prints a line which looks like\n\n[1] 1234\n\nindicating  that  the job which was started asynchronously was job number 1 and had one (top-\nlevel) process, whose process id was 1234.\n\nIf you are running a job and wish to do something else you may hit the suspend  key  (usually\n`^Z'),  which  sends a STOP signal to the current job.  The shell will then normally indicate\nthat the job has been `Suspended' and print another prompt.  If the listjobs  shell  variable\nis  set,  all  jobs  will be listed like the jobs builtin command; if it is set to `long' the\nlisting will be in long format, like `jobs -l'.  You can then manipulate  the  state  of  the\nsuspended  job.   You  can put it in the ``background'' with the bg command or run some other\ncommands and eventually bring the job back into the ``foreground'' with fg.   (See  also  the\nrun-fg-editor  editor  command.)  A `^Z' takes effect immediately and is like an interrupt in\nthat pending output and unread input are discarded when it is typed.  The wait  builtin  com‐\nmand causes the shell to wait for all background jobs to complete.\n\nThe  `^]'  key  sends a delayed suspend signal, which does not generate a STOP signal until a\nprogram attempts to read(2) it, to the current job.  This can usefully be  typed  ahead  when\nyou have prepared some commands for a job which you wish to stop after it has read them.  The\n`^Y' key performs this function in csh(1); in tcsh, `^Y' is an editing command.  (+)\n\nA job being run in the background stops if it tries to read from  the  terminal.   Background\njobs  are  normally allowed to produce output, but this can be disabled by giving the command\n`stty tostop'.  If you set this tty option, then background jobs will stop when they  try  to\nproduce output like they do when they try to read input.\n\nThere  are  several  ways  to refer to jobs in the shell.  The character `%' introduces a job\nname.  If you wish to refer to job number 1, you can name it as  `%1'.   Just  naming  a  job\nbrings it to the foreground; thus `%1' is a synonym for `fg %1', bringing job 1 back into the\nforeground.  Similarly, saying `%1 &' resumes job 1 in the background, just like `bg %1'.   A\njob  can  also  be  named  by an unambiguous prefix of the string typed in to start it: `%ex'\nwould normally restart a suspended ex(1) job, if there were only one suspended job whose name\nbegan  with  the  string  `ex'.  It is also possible to say `%?string' to specify a job whose\ntext contains string, if there is only one such job.\n\nThe shell maintains a notion of the current and previous jobs.  In output pertaining to jobs,\nthe  current  job  is  marked  with a `+' and the previous job with a `-'.  The abbreviations\n`%+', `%', and (by analogy with the syntax of the history mechanism) `%%' all  refer  to  the\ncurrent job, and `%-' refers to the previous job.\n\nThe  job control mechanism requires that the stty(1) option `new' be set on some systems.  It\nis an artifact from a `new' implementation of the tty driver which allows generation  of  in‐\nterrupt characters from the keyboard to tell jobs to stop.  See stty(1) and the setty builtin\ncommand for details on setting options in the new tty driver.\n"
                },
                {
                    "name": "Status reporting",
                    "content": "The shell learns immediately whenever a process changes state.  It normally informs you when‐\never  a job becomes blocked so that no further progress is possible, but only right before it\nprints a prompt.  This is done so that it does not otherwise disturb your work.  If, however,\nyou set the shell variable notify, the shell will notify you immediately of changes of status\nin background jobs.  There is also a shell command notify which marks  a  single  process  so\nthat  its  status  changes will be immediately reported.  By default notify marks the current\nprocess; simply say `notify' after starting a background job to mark it.\n\nWhen you try to leave the shell while jobs are stopped, you will be warned  that  `There  are\nsuspended  jobs.' You may use the jobs command to see what they are.  If you do this or imme‐\ndiately try to exit again, the shell will not warn you a second time, and the suspended  jobs\nwill be terminated.\n"
                },
                {
                    "name": "Automatic, periodic and timed events (+)",
                    "content": "There  are various ways to run commands and take other actions automatically at various times\nin the ``life cycle'' of the shell.  They are summarized here, and described in detail  under\nthe appropriate Builtin commands, Special shell variables and Special aliases.\n\nThe  sched  builtin  command  puts  commands in a scheduled-event list, to be executed by the\nshell at a given time.\n\nThe beepcmd, cwdcmd, periodic, precmd, postcmd, and jobcmd Special aliases can  be  set,  re‐\nspectively,  to  execute commands when the shell wants to ring the bell, when the working di‐\nrectory changes, every tperiod minutes, before each prompt, before  each  command  gets  exe‐\ncuted,  after  each  command  gets executed, and when a job is started or is brought into the\nforeground.\n\nThe autologout shell variable can be set to log out or lock the shell after a given number of\nminutes of inactivity.\n\nThe mail shell variable can be set to check for new mail periodically.\n\nThe  printexitvalue shell variable can be set to print the exit status of commands which exit\nwith a status other than zero.\n\nThe rmstar shell variable can be set to ask the user, when `rm *' is typed, if that is really\nwhat was meant.\n\nThe  time  shell variable can be set to execute the time builtin command after the completion\nof any process that takes more than a given number of CPU seconds.\n\nThe watch and who shell variables can be set to report when selected users log in or out, and\nthe log builtin command reports on those users at any time.\n"
                },
                {
                    "name": "Native Language System support (+)",
                    "content": "The  shell  is eight bit clean (if so compiled; see the version shell variable) and thus sup‐\nports character sets needing this capability.  NLS support differs depending  on  whether  or\nnot  the  shell  was  compiled to use the system's NLS (again, see version).  In either case,\n7-bit ASCII is the default character code (e.g., the classification of which  characters  are\nprintable)  and  sorting,  and  changing  the LANG or LCCTYPE environment variables causes a\ncheck for possible changes in these respects.\n\nWhen using the system's NLS, the setlocale(3) function is  called  to  determine  appropriate\ncharacter  code/classification  and  sorting  (e.g., a 'enCA.UTF-8' would yield \"UTF-8\" as a\ncharacter code).  This function typically examines the LANG and  LCCTYPE  environment  vari‐\nables;  refer  to  the system documentation for further details.  When not using the system's\nNLS, the shell simulates it by assuming that the ISO 8859-1 character set  is  used  whenever\neither  of  the  LANG and LCCTYPE variables are set, regardless of their values.  Sorting is\nnot affected for the simulated NLS.\n\nIn addition, with both real  and  simulated  NLS,  all  printable  characters  in  the  range\n\\200-\\377,  i.e.,  those that have M-char bindings, are automatically rebound to self-insert-\ncommand.  The corresponding binding for the escape-char sequence,  if  any,  is  left  alone.\nThese  characters  are  not rebound if the NOREBIND environment variable is set.  This may be\nuseful for the simulated NLS or a primitive real NLS which assumes full ISO  8859-1.   Other‐\nwise,  all M-char bindings in the range \\240-\\377 are effectively undone.  Explicitly rebind‐\ning the relevant keys with bindkey is of course still possible.\n\nUnknown characters (i.e., those that  are  neither  printable  nor  control  characters)  are\nprinted  in  the  format  \\nnn.   If the tty is not in 8 bit mode, other 8 bit characters are\nprinted by converting them to ASCII and using standout mode.  The shell never changes the 7/8\nbit  mode  of  the tty and tracks user-initiated changes of 7/8 bit mode.  NLS users (or, for\nthat matter, those who want to use a meta key) may need to explicitly set the tty  in  8  bit\nmode through the appropriate stty(1) command in, e.g., the ~/.login file.\n"
                },
                {
                    "name": "OS variant support (+)",
                    "content": "A  number  of  new  builtin commands are provided to support features in particular operating\nsystems.  All are described in detail in the Builtin commands section.\n\nOn systems that support TCF (aix-ibm370, aix-ps2), getspath and setspath get and set the sys‐\ntem execution path, getxvers and setxvers get and set the experimental version prefix and mi‐\ngrate migrates processes between sites.  The jobs builtin prints the site on which  each  job\nis executing.\n\nUnder BS2000, bs2cmd executes commands of the underlying BS2000/OSD operating system.\n\nUnder Domain/OS, inlib adds shared libraries to the current environment, rootnode changes the\nrootnode and ver changes the systype.\n\nUnder Mach, setpath is equivalent to Mach's setpath(1).\n\nUnder Masscomp/RTU and Harris CX/UX, universe sets the universe.\n\nUnder Harris CX/UX, ucb or att runs a command under the specified universe.\n\nUnder Convex/OS, warp prints or sets the universe.\n\nThe VENDOR, OSTYPE and MACHTYPE environment variables indicate respectively the vendor, oper‐\nating  system and machine type (microprocessor class or machine model) of the system on which\nthe shell thinks it is running.  These are particularly useful when sharing one's home direc‐\ntory between several types of machines; one can, for example,\n\nset path = (~/bin.$MACHTYPE /usr/ucb /bin /usr/bin .)\n\nin one's ~/.login and put executables compiled for each machine in the appropriate directory.\n\nThe version shell variable indicates what options were chosen when the shell was compiled.\n\nNote  also  the newgrp builtin, the afsuser and echostyle shell variables and the system-de‐\npendent locations of the shell's input files (see FILES).\n"
                },
                {
                    "name": "Signal handling",
                    "content": "Login shells ignore interrupts when reading the file ~/.logout.  The shell ignores quit  sig‐\nnals  unless  started with -q.  Login shells catch the terminate signal, but non-login shells\ninherit the terminate behavior from their parents.  Other signals have the values  which  the\nshell inherited from its parent.\n\nIn  shell  scripts, the shell's handling of interrupt and terminate signals can be controlled\nwith onintr, and its handling of hangups can be controlled with hup and nohup.\n\nThe shell exits on a hangup (see also the logout shell variable).  By  default,  the  shell's\nchildren  do  too, but the shell does not send them a hangup when it exits.  hup arranges for\nthe shell to send a hangup to a child when it  exits,  and  nohup  sets  a  child  to  ignore\nhangups.\n"
                },
                {
                    "name": "Terminal management (+)",
                    "content": "The  shell  uses three different sets of terminal (``tty'') modes: `edit', used when editing,\n`quote', used when quoting literal characters, and `execute', used when  executing  commands.\nThe  shell  holds  some  settings in each mode constant, so commands which leave the tty in a\nconfused state do not interfere with the shell.  The shell also matches changes in the  speed\nand  padding  of  the  tty.  The list of tty modes that are kept constant can be examined and\nmodified with the setty builtin.  Note that although the editor  uses  CBREAK  mode  (or  its\nequivalent), it takes typed-ahead characters anyway.\n\nThe  echotc, settc and telltc commands can be used to manipulate and debug terminal capabili‐\nties from the command line.\n\nOn systems that support SIGWINCH or SIGWINDOW, the shell adapts to window resizing  automati‐\ncally  and  adjusts  the  environment variables LINES and COLUMNS if set.  If the environment\nvariable TERMCAP contains li# and co# fields, the shell adjusts them to reflect the new  win‐\ndow size.\n"
                }
            ]
        },
        "REFERENCE": {
            "content": "The  next  sections  of  this  manual describe all of the available Builtin commands, Special\naliases and Special shell variables.\n",
            "subsections": [
                {
                    "name": "Builtin commands",
                    "content": "%job    A synonym for the fg builtin command.\n\n%job &  A synonym for the bg builtin command.\n\n:       Does nothing, successfully.\n\n@\n@ name = expr\n@ name[index] = expr\n@ name++|--\n@ name[index]++|--\nThe first form prints the values of all shell variables.\n\nThe second form assigns the value of expr to name.  The third form assigns the  value\nof  expr to the index'th component of name; both name and its index'th component must\nalready exist.\n\nexpr may contain the operators `*', `+', etc., as in C.  If expr contains  `<',  `>',\n`&'  or `' then at least that part of expr must be placed within `()'.  Note that the\nsyntax of expr has nothing to do with that described under Expressions.\n\nThe fourth and fifth forms increment (`++') or decrement (`--') name or its  index'th\ncomponent.\n\nThe  space between `@' and name is required.  The spaces between name and `=' and be‐\ntween `=' and expr are optional.  Components of expr must be separated by spaces.\n\nalias [name [wordlist]]\nWithout arguments, prints all aliases.  With name, prints the alias for  name.   With\nname  and  wordlist,  assigns wordlist as the alias of name.  wordlist is command and\nfilename substituted.  name may not be `alias' or `unalias'.  See  also  the  unalias\nbuiltin command.\n\nalloc   Shows  the  amount of dynamic memory acquired, broken down into used and free memory.\nWith an argument shows the number of free and used blocks in each size category.  The\ncategories  start  at size 8 and double at each step.  This command's output may vary\nacross system types, because systems other than the VAX may use  a  different  memory\nallocator.\n\nbg [%job ...]\nPuts the specified jobs (or, without arguments, the current job) into the background,\ncontinuing each if it is stopped.  job may be a number, a string, `', `%', `+' or `-'\nas described under Jobs.\n\nbindkey [-l|-d|-e|-v|-u] (+)\nbindkey [-a] [-b] [-k] [-r] [--] key (+)\nbindkey [-a] [-b] [-k] [-c|-s] [--] key command (+)\nWithout  options, the first form lists all bound keys and the editor command to which\neach is bound, the second form lists the editor command to which key is bound and the\nthird form binds the editor command command to key.  Options include:\n\n-l  Lists all editor commands and a short description of each.\n-d  Binds  all keys to the standard bindings for the default editor, as per -e and -v\nbelow.\n-e  Binds all keys to emacs(1)-style bindings.  Unsets vimode.\n-v  Binds all keys to vi(1)-style bindings.  Sets vimode.\n-a  Lists or changes key-bindings in the alternative key map.  This is  the  key  map\nused in vimode command mode.\n-b  key  is  interpreted as a control character written ^character (e.g., `^A') or C-\ncharacter (e.g., `C-A'), a meta character written M-character  (e.g.,  `M-A'),  a\nfunction key written F-string (e.g., `F-string'), or an extended prefix key writ‐\nten X-character (e.g., `X-A').\n-k  key is interpreted as a symbolic arrow key name, which  may  be  one  of  `down',\n`up', `left' or `right'.\n-r  Removes  key's  binding.   Be careful: `bindkey -r' does not bind key to self-in‐\nsert-command (q.v.), it unbinds key completely.\n-c  command is interpreted as a builtin or external command instead of an editor com‐\nmand.\n-s  command  is  taken  as a literal string and treated as terminal input when key is\ntyped.  Bound keys in command are themselves reinterpreted,  and  this  continues\nfor ten levels of interpretation.\n--  Forces  a  break from option processing, so the next word is taken as key even if\nit begins with '-'.\n-u (or any invalid option)\nPrints a usage message.\n\nkey may be a single character or a string.  If a command is bound to  a  string,  the\nfirst  character  of the string is bound to sequence-lead-in and the entire string is\nbound to the command.\n\nControl characters in key can be literal (they can be typed by  preceding  them  with\nthe  editor command quoted-insert, normally bound to `^V') or written caret-character\nstyle, e.g., `^A'.  Delete is written `^?'  (caret-question mark).  key  and  command\ncan  contain  backslashed escape sequences (in the style of System V echo(1)) as fol‐\nlows:\n\n\\a      Bell\n\\b      Backspace\n\\e      Escape\n\\f      Form feed\n\\n      Newline\n\\r      Carriage return\n\\t      Horizontal tab\n\\v      Vertical tab\n\\nnn    The ASCII character corresponding to the octal number nnn\n\n`\\' nullifies the special meaning of the following character, if it has any,  notably\n`\\' and `^'.\n\nbs2cmd bs2000-command (+)\nPasses  bs2000-command  to the BS2000 command interpreter for execution. Only non-in‐\nteractive commands can be executed, and it is not possible  to  execute  any  command\nthat  would  overlay  the image of the current process, like /EXECUTE or /CALL-PROCE‐\nDURE. (BS2000 only)\n\nbreak   Causes execution to resume after the end of the nearest enclosing foreach  or  while.\nThe remaining commands on the current line are executed.  Multi-level breaks are thus\npossible by writing them all on one line.\n\nbreaksw Causes a break from a switch, resuming after the endsw.\n\nbuiltins (+)\nPrints the names of all builtin commands.\n\nbye (+) A synonym for the logout builtin command.  Available only if the shell  was  so  com‐\npiled; see the version shell variable.\n\ncase label:\nA label in a switch statement as discussed below.\n\ncd [-p] [-l] [-n|-v] [I--] [name]\nIf a directory name is given, changes the shell's working directory to name.  If not,\nchanges to home, unless the cdtohome variable is not set, in which case a name is re‐\nquired.   If  name  is  `-'  it is interpreted as the previous working directory (see\nOther substitutions).  (+) If name is not a subdirectory  of  the  current  directory\n(and  does  not begin with `/', `./' or `../'), each component of the variable cdpath\nis checked to see if it has a subdirectory name.  Finally, if all else fails but name\nis  a shell variable whose value begins with `/' or '.', then this is tried to see if\nit is a directory, and the -p option is implied.\n\nWith -p, prints the final directory stack, just like dirs.  The -l, -n and  -v  flags\nhave  the  same  effect  on  cd as on dirs, and they imply -p.  (+) Using -- forces a\nbreak from option processing so the next word is taken as the directory name even  if\nit begins with '-'. (+)\n\nSee also the implicitcd and cdtohome shell variables.\n\nchdir   A synonym for the cd builtin command.\n\ncomplete [command [word/pattern/list[:select]/[[suffix]/] ...]] (+)\nWithout  arguments,  lists all completions.  With command, lists completions for com‐\nmand.  With command and word etc., defines completions.\n\ncommand may be a full command name or a glob-pattern (see Filename substitution).  It\ncan  begin  with  `-' to indicate that completion should be used only when command is\nambiguous.\n\nword specifies which word relative to the current word is to be completed, and may be\none of the following:\n\nc   Current-word  completion.  pattern is a glob-pattern which must match the be‐\nginning of the current word on the command line.   pattern  is  ignored  when\ncompleting the current word.\nC   Like c, but includes pattern when completing the current word.\nn   Next-word  completion.  pattern is a glob-pattern which must match the begin‐\nning of the previous word on the command line.\nN   Like n, but must match the beginning of the word two before the current word.\np   Position-dependent completion.  pattern is a numeric  range,  with  the  same\nsyntax used to index shell variables, which must include the current word.\n\nlist, the list of possible completions, may be one of the following:\n\na       Aliases\nb       Bindings (editor commands)\nc       Commands (builtin or external commands)\nC       External commands which begin with the supplied path prefix\nd       Directories\nD       Directories which begin with the supplied path prefix\ne       Environment variables\nf       Filenames\nF       Filenames which begin with the supplied path prefix\ng       Groupnames\nj       Jobs\nl       Limits\nn       Nothing\ns       Shell variables\nS       Signals\nt       Plain (``text'') files\nT       Plain (``text'') files which begin with the supplied path prefix\nv       Any variables\nu       Usernames\nx       Like n, but prints select when list-choices is used.\nX       Completions\n$var    Words from the variable var\n(...)   Words from the given list\n`...`   Words from the output of command\n\nselect is an optional glob-pattern.  If given, words from only list that match select\nare considered and the fignore shell variable is ignored.  The last  three  types  of\ncompletion may not have a select pattern, and x uses select as an explanatory message\nwhen the list-choices editor command is used.\n\nsuffix is a single character to be appended to a successful completion.  If null,  no\ncharacter  is  appended.   If omitted (in which case the fourth delimiter can also be\nomitted), a slash is appended to directories and a space to other words.\n\ncommand invoked from `...` version has additional environment variable set, the vari‐\nable  name  is COMMANDLINE and contains (as its name indicates) contents of the cur‐\nrent (already typed in) command line.  One  can  examine  and  use  contents  of  the\nCOMMANDLINE  variable  in  her custom script to build more sophisticated completions\n(see completion for svn(1) included in this package).\n\nNow for some examples.  Some commands take only directories as arguments, so  there's\nno point completing plain files.\n\n> complete cd 'p/1/d/'\n\ncompletes  only  the first word following `cd' (`p/1') with a directory.  p-type com‐\npletion can also be used to narrow down command completion:\n\n> co[^D]\ncomplete compress\n> complete -co* 'p/0/(compress)/'\n> co[^D]\n> compress\n\nThis completion completes commands (words in position 0, `p/0') which begin with `co'\n(thus matching `co*') to `compress' (the only word in the list).  The leading `-' in‐\ndicates that this completion is to be used with only ambiguous commands.\n\n> complete find 'n/-user/u/'\n\nis an example of n-type completion.  Any word following `find' and  immediately  fol‐\nlowing `-user' is completed from the list of users.\n\n> complete cc 'c/-I/d/'\n\ndemonstrates  c-type  completion.  Any word following `cc' and beginning with `-I' is\ncompleted as a directory.  `-I' is not taken as part of the directory because we used\nlowercase c.\n\nDifferent lists are useful with different commands.\n\n> complete alias 'p/1/a/'\n> complete man 'p/*/c/'\n> complete set 'p/1/s/'\n> complete true 'p/1/x:Truth has no options./'\n\nThese  complete  words following `alias' with aliases, `man' with commands, and `set'\nwith shell variables.  `true' doesn't have any options, so x does nothing  when  com‐\npletion  is  attempted and prints `Truth has no options.' when completion choices are\nlisted.\n\nNote that the man example, and several other examples below, could just as well  have\nused 'c/*' or 'n/*' as 'p/*'.\n\nWords can be completed from a variable evaluated at completion time,\n\n> complete ftp 'p/1/$hostnames/'\n> set hostnames = (rtfm.mit.edu tesla.ee.cornell.edu)\n> ftp [^D]\nrtfm.mit.edu tesla.ee.cornell.edu\n> ftp [^C]\n> set hostnames = (rtfm.mit.edu tesla.ee.cornell.edu uunet.uu.net)\n> ftp [^D]\nrtfm.mit.edu tesla.ee.cornell.edu uunet.uu.net\n\nor from a command run at completion time:\n\n> complete kill 'p/*/`ps | awk \\{print\\ \\$1\\}`/'\n> kill -9 [^D]\n23113 23377 23380 23406 23429 23529 23530 PID\n\nNote  that  the  complete command does not itself quote its arguments, so the braces,\nspace and `$' in `{print $1}' must be quoted explicitly.\n\nOne command can have multiple completions:\n\n> complete dbx 'p/2/(core)/' 'p/*/c/'\n\ncompletes the second argument to `dbx' with the word `core' and all  other  arguments\nwith commands.  Note that the positional completion is specified before the next-word\ncompletion.  Because completions are evaluated from left to right, if  the  next-word\ncompletion  were  specified first it would always match and the positional completion\nwould never be executed.  This is a common mistake when defining a completion.\n\nThe select pattern is useful when a command takes files with only particular forms as\narguments.  For example,\n\n> complete cc 'p/*/f:*.[cao]/'\n\ncompletes  `cc'  arguments  to  files ending in only `.c', `.a', or `.o'.  select can\nalso exclude files, using negation of a glob-pattern as described under Filename sub‐‐\nstitution.  One might use\n\n> complete rm 'p/*/f:^*.{c,h,cc,C,tex,1,man,l,y}/'\n\nto  exclude  precious  source  code from `rm' completion.  Of course, one could still\ntype excluded names manually or override the completion mechanism using the complete-\nword-raw or list-choices-raw editor commands (q.v.).\n\nThe `C', `D', `F' and `T' lists are like `c', `d', `f' and `t' respectively, but they\nuse the select argument in a different way: to restrict completion to files beginning\nwith  a particular path prefix.  For example, the Elm mail program uses `=' as an ab‐\nbreviation for one's mail directory.  One might use\n\n> complete elm c@=@F:$HOME/Mail/@\n\nto complete `elm -f =' as if it were `elm -f ~/Mail/'.  Note that we used `@' instead\nof  `/'  to  avoid confusion with the select argument, and we used `$HOME' instead of\n`~' because home directory substitution works at only the beginning of a word.\n\nsuffix is used to add a nonstandard suffix (not space or `/' for directories) to com‐\npleted words.\n\n> complete finger 'c/*@/$hostnames/' 'p/1/u/@'\n\ncompletes arguments to `finger' from the list of users, appends an `@', and then com‐\npletes after the `@' from the `hostnames' variable.  Note again the  order  in  which\nthe completions are specified.\n\nFinally, here's a complex example for inspiration:\n\n> complete find \\\n'n/-name/f/' 'n/-newer/f/' 'n/-{,n}cpio/f/' \\\n´n/-exec/c/' 'n/-ok/c/' 'n/-user/u/' \\\n'n/-group/g/' 'n/-fstype/(nfs 4.2)/' \\\n'n/-type/(b c d f l p s)/' \\\n´c/-/(name newer cpio ncpio exec ok user \\\ngroup fstype type atime ctime depth inum \\\nls mtime nogroup nouser perm print prune \\\nsize xdev)/' \\\n'p/*/d/'\n\nThis  completes  words following `-name', `-newer', `-cpio' or `ncpio' (note the pat‐\ntern which matches both) to files, words following  `-exec'  or  `-ok'  to  commands,\nwords following `user' and `group' to users and groups respectively and words follow‐\ning `-fstype' or `-type' to members of  the  given  lists.   It  also  completes  the\nswitches  themselves from the given list (note the use of c-type completion) and com‐\npletes anything not otherwise completed to a directory.  Whew.\n\nRemember that programmed completions are ignored if the word  being  completed  is  a\ntilde substitution (beginning with `~') or a variable (beginning with `$').  See also\nthe uncomplete builtin command.\n"
                },
                {
                    "name": "continue",
                    "content": "Continues execution of the nearest enclosing while or foreach.  The rest of the  com‐\nmands on the current line are executed.\n"
                },
                {
                    "name": "default:",
                    "content": "Labels the default case in a switch statement.  It should come after all case labels.\n\ndirs [-l] [-n|-v]\ndirs -S|-L [filename] (+)\ndirs -c (+)\nThe  first  form prints the directory stack.  The top of the stack is at the left and\nthe first directory in the stack is the current directory.  With -l, `~'  or  `~name'\nin  the  output  is expanded explicitly to home or the pathname of the home directory\nfor user name.  (+) With -n, entries are wrapped before they reach the  edge  of  the\nscreen.  (+) With -v, entries are printed one per line, preceded by their stack posi‐\ntions.  (+) If more than one of -n or -v is given, -v takes precedence.   -p  is  ac‐\ncepted but does nothing.\n\nWith  -S, the second form saves the directory stack to filename as a series of cd and\npushd commands.  With -L, the shell sources filename, which is presumably a directory\nstack  file  saved by the -S option or the savedirs mechanism.  In either case, dirs‐‐\nfile is used if filename is not given and ~/.cshdirs is used if dirsfile is unset.\n\nNote that login shells do the equivalent of `dirs -L' on startup and, if savedirs  is\nset,  `dirs  -S'  before  exiting.  Because only ~/.tcshrc is normally sourced before\n~/.cshdirs, dirsfile should be set in ~/.tcshrc rather than ~/.login.\n\nThe last form clears the directory stack.\n\necho [-n] word ...\nWrites each word to the shell's standard output, separated by spaces  and  terminated\nwith  a  newline.   The  echostyle shell variable may be set to emulate (or not) the\nflags and escape sequences of the BSD and/or System V versions of echo; see echo(1).\n\nechotc [-sv] arg ... (+)\nExercises the terminal capabilities (see termcap(5)) in args.  For  example,  'echotc\nhome'  sends  the  cursor to the home position, 'echotc cm 3 10' sends it to column 3\nand row 10, and 'echotc ts 0; echo \"This is a test.\"; echotc fs' prints  \"This  is  a\ntest.\"  in the status line.\n\nIf  arg  is 'baud', 'cols', 'lines', 'meta' or 'tabs', prints the value of that capa‐\nbility (\"yes\" or \"no\" indicating that the terminal does or does not have  that  capa‐\nbility).   One  might use this to make the output from a shell script less verbose on\nslow terminals, or limit command output to the number of lines on the screen:\n\n> set history=`echotc lines`\n> @ history--\n\nTermcap strings may contain wildcards which will not echo correctly.  One should  use\ndouble  quotes  when  setting a shell variable to a terminal capability string, as in\nthe following example that places the date in the status line:\n\n> set tosl=\"`echotc ts 0`\"\n> set frsl=\"`echotc fs`\"\n> echo -n \"$tosl\";date; echo -n \"$frsl\"\n\nWith -s, nonexistent capabilities return the empty string rather than causing an  er‐\nror.  With -v, messages are verbose.\n"
                },
                {
                    "name": "else",
                    "content": ""
                },
                {
                    "name": "end",
                    "content": ""
                },
                {
                    "name": "endif",
                    "content": "endsw   See the description of the foreach, if, switch, and while statements below.\n\neval arg ...\nTreats  the  arguments as input to the shell and executes the resulting command(s) in\nthe context of the current shell.  This is usually used to execute commands generated\nas  the  result  of  command  or variable substitution, because parsing occurs before\nthese substitutions.  See tset(1) for a sample use of eval.\n\nexec command\nExecutes the specified command in place of the current shell.\n\nexit [expr]\nThe shell exits either with the value of the specified expr (an  expression,  as  de‐\nscribed under Expressions) or, without expr, with the value 0.\n\nfg [%job ...]\nBrings  the  specified  jobs  (or, without arguments, the current job) into the fore‐\nground, continuing each if it is stopped.  job may be a number, a  string,  `',  `%',\n`+' or `-' as described under Jobs.  See also the run-fg-editor editor command.\n\nfiletest -op file ... (+)\nApplies  op  (which is a file inquiry operator as described under File inquiry opera‐‐\ntors) to each file and returns the results as a space-separated list.\n\nforeach name (wordlist)\n...\nend     Successively sets the variable name to each member of wordlist and executes  the  se‐\nquence  of commands between this command and the matching end.  (Both foreach and end\nmust appear alone on separate lines.)  The builtin command continue may  be  used  to\ncontinue  the  loop  prematurely and the builtin command break to terminate it prema‐\nturely.  When this command is read from the terminal, the loop is read once prompting\nwith `foreach? ' (or prompt2) before any statements in the loop are executed.  If you\nmake a mistake typing in a loop at the terminal you can rub it out.\n\ngetspath (+)\nPrints the system execution path.  (TCF only)\n\ngetxvers (+)\nPrints the experimental version prefix.  (TCF only)\n\nglob wordlist\nLike echo, but the `-n' parameter is not recognized and words are delimited  by  null\ncharacters  in  the output.  Useful for programs which wish to use the shell to file‐\nname expand a list of words.\n\ngoto word\nword is filename and command-substituted to yield a string of the form `label'.   The\nshell  rewinds  its  input  as much as possible, searches for a line of the form `la‐\nbel:', possibly preceded by blanks or tabs, and continues execution after that line.\n"
                },
                {
                    "name": "hashstat",
                    "content": "Prints a statistics line indicating how effective the internal hash table has been at\nlocating  commands (and avoiding exec's).  An exec is attempted for each component of\nthe path where the hash function indicates a possible  hit,  and  in  each  component\nwhich does not begin with a `/'.\n\nOn machines without vfork(2), prints only the number and size of hash buckets.\n\nhistory [-hTr] [n]\nhistory -S|-L|-M [filename] (+)\nhistory -c (+)\nThe  first  form prints the history event list.  If n is given only the n most recent\nevents are printed or saved.  With -h, the history list is  printed  without  leading\nnumbers.  If -T is specified, timestamps are printed also in comment form.  (This can\nbe used to produce files suitable for loading with  'history  -L'  or  'source  -h'.)\nWith -r, the order of printing is most recent first rather than oldest first.\n\nWith  -S,  the  second form saves the history list to filename.  If the first word of\nthe savehist shell variable is set to a number, at most that many  lines  are  saved.\nIf the second word of savehist is set to `merge', the history list is merged with the\nexisting history file instead of replacing it (if there is one) and  sorted  by  time\nstamp.  (+) Merging is intended for an environment like the X Window System with sev‐\neral shells in simultaneous use.  If the second word of savehist is `merge'  and  the\nthird  word  is  set to `lock', the history file update will be serialized with other\nshell sessions that would possibly like to merge history at exactly the same time.\n\nWith -L, the shell appends filename, which is presumably a history list saved by  the\n-S  option  or  the  savehist mechanism, to the history list.  -M is like -L, but the\ncontents of filename are merged into the history list and sorted  by  timestamp.   In\neither  case,  histfile  is  used  if filename is not given and ~/.history is used if\nhistfile is unset.  `history -L' is exactly like 'source -h' except that it does  not\nrequire a filename.\n\nNote  that login shells do the equivalent of `history -L' on startup and, if savehist\nis set, `history -S' before exiting.  Because only ~/.tcshrc is normally sourced  be‐\nfore ~/.history, histfile should be set in ~/.tcshrc rather than ~/.login.\n\nIf histlit is set, the first and second forms print and save the literal (unexpanded)\nform of the history list.\n\nThe last form clears the history list.\n\nhup [command] (+)\nWith command, runs command such that it will exit on a hangup signal and arranges for\nthe  shell  to  send it a hangup signal when the shell exits.  Note that commands may\nset their own response to hangups, overriding hup.  Without an argument,  causes  the\nnon-interactive  shell only to exit on a hangup for the remainder of the script.  See\nalso Signal handling and the nohup builtin command.\n\nif (expr) command\nIf expr (an expression, as described under Expressions) evaluates true, then  command\nis  executed.   Variable  substitution  on command happens early, at the same time it\ndoes for the rest of the if command.  command must be a simple command, not an alias,\na  pipeline,  a  command  list or a parenthesized command list, but it may have argu‐\nments.  Input/output redirection occurs even if expr is false and command is thus not\nexecuted; this is a bug.\n\nif (expr) then\n...\nelse if (expr2) then\n..."
                },
                {
                    "name": "else",
                    "content": "...\nendif   If  the specified expr is true then the commands to the first else are executed; oth‐\nerwise if expr2 is true then the commands to the second else are executed, etc.   Any\nnumber  of  else-if  pairs  are possible; only one endif is needed.  The else part is\nlikewise optional.  (The words else and endif must appear at the beginning  of  input\nlines; the if must appear alone on its input line or after an else.)\n\ninlib shared-library ... (+)\nAdds  each  shared-library  to  the current environment.  There is no way to remove a\nshared library.  (Domain/OS only)\n\njobs [-l]\nLists the active jobs.  With -l, lists process IDs in addition to the normal informa‐\ntion.  On TCF systems, prints the site on which each job is executing.\n\nkill [-s signal] %job|pid ...\nkill -l The first and second forms sends the specified signal (or, if none is given, the TERM\n(terminate) signal) to the specified jobs or processes.   job  may  be  a  number,  a\nstring,  `',  `%',  `+'  or `-' as described under Jobs.  Signals are either given by\nnumber or by name (as given in /usr/include/signal.h, stripped of the prefix  `SIG').\nThere  is  no  default  job; saying just `kill' does not send a signal to the current\njob.  If the signal being sent is TERM (terminate) or HUP (hangup), then the  job  or\nprocess  is  sent  a CONT (continue) signal as well.  The third form lists the signal\nnames.\n\nlimit [-h] [resource [maximum-use]]\nLimits the consumption by the current process and each process it creates to not  in‐\ndividually exceed maximum-use on the specified resource.  If no maximum-use is given,\nthen the current limit is printed; if no resource is given, then all limitations  are\ngiven.  If the -h flag is given, the hard limits are used instead of the current lim‐\nits.  The hard limits impose a ceiling on the values of the current limits.  Only the\nsuper-user  may raise the hard limits, but a user may lower or raise the current lim‐\nits within the legal range.\n\nControllable resources currently include (if supported by the OS):\n\ncputime\nthe maximum number of cpu-seconds to be used by each process\n\nfilesize\nthe largest single file which can be created\n\ndatasize\nthe maximum growth of the data+stack region via sbrk(2) beyond the end of  the\nprogram text\n\nstacksize\nthe maximum size of the automatically-extended stack region\n\ncoredumpsize\nthe size of the largest core dump that will be created\n\nmemoryuse\nthe  maximum amount of physical memory a process may have allocated to it at a\ngiven time\n\nvmemoryuse\nthe maximum amount of virtual memory a process may have allocated to it  at  a\ngiven time (address space)\n\nvmemoryuse\nthe  maximum  amount of virtual memory a process may have allocated to it at a\ngiven time\n\nheapsize\nthe maximum amount of memory a process may allocate per brk() system call\n\ndescriptors or openfiles\nthe maximum number of open files for this process\n\npseudoterminals\nthe maximum number of pseudo-terminals for this user\n\nkqueues\nthe maximum number of kqueues allocated for this process\n\nconcurrency\nthe maximum number of threads for this process\n\nmemorylocked\nthe maximum size which a process may lock into memory using mlock(2)\n\nmaxproc\nthe maximum number of simultaneous processes for this user id\n\nmaxthread\nthe maximum number of simultaneous threads (lightweight  processes)  for  this\nuser id\n\nthreads\nthe maximum number of threads for this process\n\nsbsize the maximum size of socket buffer usage for this user\n\nswapsize\nthe maximum amount of swap space reserved or used for this user\n\nmaxlocks\nthe maximum number of locks for this user\n\nposixlocks\nthe maximum number of POSIX advisory locks for this user\n\nmaxsignal\nthe maximum number of pending signals for this user\n\nmaxmessage\nthe maximum number of bytes in POSIX mqueues for this user\n\nmaxnice\nthe  maximum nice priority the user is allowed to raise mapped from [19...-20]\nto [0...39] for this user\n\nmaxrtprio\nthe maximum realtime priority for this user maxrttime the timeout for RT tasks\nin microseconds for this user.\n\nmaximum-use  may be given as a (floating point or integer) number followed by a scale\nfactor.  For all limits other than cputime the default scale is  `k'  or  `kilobytes'\n(1024  bytes); a scale factor of `m' or `megabytes' or `g' or `gigabytes' may also be\nused.  For cputime the default scaling is `seconds', while `m' for minutes or `h' for\nhours, or a time of the form `mm:ss' giving minutes and seconds may be used.\n\nIf  maximum-use  is `unlimited', then the limitation on the specified resource is re‐\nmoved (this is equivalent to the unlimit builtin command).\n\nFor both resource names and scale factors, unambiguous prefixes of the names suffice.\n\nlog (+) Prints the watch shell variable and reports on each user indicated in  watch  who  is\nlogged in, regardless of when they last logged in.  See also watchlog.\n\nlogin   Terminates  a  login  shell, replacing it with an instance of /bin/login. This is one\nway to log off, included for compatibility with sh(1).\n\nlogout  Terminates a login shell.  Especially useful if ignoreeof is set.\n\nls-F [-switch ...] [file ...] (+)\nLists files like `ls -F', but much faster.  It identifies each type of  special  file\nin the listing with a special character:\n\n/   Directory\n*   Executable\n#   Block device\n%   Character device\n|   Named pipe (systems with named pipes only)\n=   Socket (systems with sockets only)\n@   Symbolic link (systems with symbolic links only)\n+   Hidden directory (AIX only) or context dependent (HP/UX only)\n:   Network special (HP/UX only)\n\nIf  the listlinks shell variable is set, symbolic links are identified in more detail\n(on only systems that have them, of course):\n\n@   Symbolic link to a non-directory\n>   Symbolic link to a directory\n&   Symbolic link to nowhere\n\nlistlinks also slows down ls-F and causes partitions holding files pointed to by sym‐\nbolic links to be mounted.\n\nIf the listflags shell variable is set to `x', `a' or `A', or any combination thereof\n(e.g., `xA'), they are used as flags to ls-F, making it act like `ls -xF', `ls  -Fa',\n`ls  -FA'  or  a combination (e.g., `ls -FxA').  On machines where `ls -C' is not the\ndefault, ls-F acts like `ls -CF', unless listflags contains an `x', in which case  it\nacts  like `ls -xF'.  ls-F passes its arguments to ls(1) if it is given any switches,\nso `alias ls ls-F' generally does the right thing.\n\nThe ls-F builtin can list files using different colors depending on the  filetype  or\nextension.  See the color shell variable and the LSCOLORS environment variable.\n\nmigrate [-site] pid|%jobid ... (+)\nmigrate -site (+)\nThe  first form migrates the process or job to the site specified or the default site\ndetermined by the system path.  The second form is equivalent to `migrate -site  $$':\nit  migrates  the  current process to the specified site.  Migrating the shell itself\ncan cause unexpected behavior, because the shell does not like to lose its tty.  (TCF\nonly)\n\nnewgrp [-] [group] (+)\nEquivalent  to `exec newgrp'; see newgrp(1).  Available only if the shell was so com‐\npiled; see the version shell variable.\n\nnice [+number] [command]\nSets the scheduling priority for the shell to number, or, without number, to 4.  With\ncommand,  runs command at the appropriate priority.  The greater the number, the less\ncpu the process gets.  The super-user may specify negative priority  by  using  `nice\n-number ...'.  Command is always executed in a sub-shell, and the restrictions placed\non commands in simple if statements apply.\n\nnohup [command]\nWith command, runs command such that it will ignore hangup signals.  Note  that  com‐\nmands  may set their own response to hangups, overriding nohup.  Without an argument,\ncauses the non-interactive shell only to ignore hangups  for  the  remainder  of  the\nscript.  See also Signal handling and the hup builtin command.\n\nnotify [%job ...]\nCauses  the  shell  to  notify  the user asynchronously when the status of any of the\nspecified jobs (or, without %job, the current job) changes, instead of waiting  until\nthe  next  prompt as is usual.  job may be a number, a string, `', `%', `+' or `-' as\ndescribed under Jobs.  See also the notify shell variable.\n\nonintr [-|label]\nControls the action of the shell on interrupts.  Without arguments, restores the  de‐\nfault  action  of  the shell on interrupts, which is to terminate shell scripts or to\nreturn to the terminal command input level.  With `-', causes all  interrupts  to  be\nignored.  With label, causes the shell to execute a `goto label' when an interrupt is\nreceived or a child process terminates because it was interrupted.\n\nonintr is ignored if the shell is running detached and in system startup  files  (see\nFILES), where interrupts are disabled anyway.\n\npopd [-p] [-l] [-n|-v] [+n]\nWithout  arguments,  pops  the  directory stack and returns to the new top directory.\nWith a number `+n', discards the n'th entry in the stack.\n\nFinally, all forms of popd print the final directory  stack,  just  like  dirs.   The\npushdsilent shell variable can be set to prevent this and the -p flag can be given to\noverride pushdsilent.  The -l, -n and -v flags have the same effect  on  popd  as  on\ndirs.  (+)\n\nprintenv [name] (+)\nPrints  the names and values of all environment variables or, with name, the value of\nthe environment variable name.\n\npushd [-p] [-l] [-n|-v] [name|+n]\nWithout arguments, exchanges the top two elements of the directory stack.  If  pushd‐‐\ntohome  is  set,  pushd  without  arguments  does `pushd ~', like cd.  (+) With name,\npushes the current working directory onto the directory stack and  changes  to  name.\nIf name is `-' it is interpreted as the previous working directory (see Filename sub‐‐\nstitution).  (+) If dunique is set, pushd removes any  instances  of  name  from  the\nstack before pushing it onto the stack.  (+) With a number `+n', rotates the nth ele‐\nment of the directory stack around to be the top element and changes to it.  If  dex‐‐\ntract  is set, however, `pushd +n' extracts the nth directory, pushes it onto the top\nof the stack and changes to it.  (+)\n\nFinally, all forms of pushd print the final directory stack,  just  like  dirs.   The\npushdsilent shell variable can be set to prevent this and the -p flag can be given to\noverride pushdsilent.  The -l, -n and -v flags have the same effect on  pushd  as  on\ndirs.  (+)\n\nrehash  Causes  the  internal hash table of the contents of the directories in the path vari‐\nable to be recomputed.  This is needed if the autorehash shell variable  is  not  set\nand  new commands are added to directories in path while you are logged in.  With au‐‐\ntorehash, a new command will be found automatically, except in the special case where\nanother  command  of  the same name which is located in a different directory already\nexists in the hash table.  Also flushes the cache of home directories built by  tilde\nexpansion.\n\nrepeat count command\nThe  specified  command,  which is subject to the same restrictions as the command in\nthe one line if statement above, is executed count times.  I/O redirections occur ex‐\nactly once, even if count is 0.\n\nrootnode //nodename (+)\nChanges  the rootnode to //nodename, so that `/' will be interpreted as `//nodename'.\n(Domain/OS only)\n\nsched (+)\nsched [+]hh:mm command (+)\nsched -n (+)\nThe first form prints the scheduled-event list.  The sched shell variable may be  set\nto  define  the format in which the scheduled-event list is printed.  The second form\nadds command to the scheduled-event list.  For example,\n\n> sched 11:00 echo It\\'s eleven o\\'clock.\n\ncauses the shell to echo `It's eleven o'clock.' at 11 AM.  The time may be in 12-hour\nAM/PM format\n\n> sched 5pm set prompt='[%h] It\\'s after 5; go home: >'\n\nor may be relative to the current time:\n\n> sched +2:15 /usr/lib/uucp/uucico -r1 -sother\n\nA  relative time specification may not use AM/PM format.  The third form removes item\nn from the event list:\n\n> sched\n1  Wed Apr  4 15:42  /usr/lib/uucp/uucico -r1 -sother\n2  Wed Apr  4 17:00  set prompt=[%h] It's after 5; go home: >\n> sched -2\n> sched\n1  Wed Apr  4 15:42  /usr/lib/uucp/uucico -r1 -sother\n\nA command in the scheduled-event list is executed just before  the  first  prompt  is\nprinted after the time when the command is scheduled.  It is possible to miss the ex‐\nact time when the command is to be run, but an overdue command will  execute  at  the\nnext  prompt.  A command which comes due while the shell is waiting for user input is\nexecuted immediately.  However, normal operation of an already-running  command  will\nnot be interrupted so that a scheduled-event list element may be run.\n\nThis  mechanism  is  similar  to, but not the same as, the at(1) command on some Unix\nsystems.  Its major disadvantage is that it may not run  a  command  at  exactly  the\nspecified  time.   Its  major  advantage is that because sched runs directly from the\nshell, it has access to shell variables and other structures.  This provides a mecha‐\nnism for changing one's working environment based on the time of day.\n"
                },
                {
                    "name": "set",
                    "content": "set name ...\nset name=word ...\nset [-r] [-f|-l] name=(wordlist) ... (+)\nset name[index]=word ...\nset -r (+)\nset -r name ... (+)\nset -r name=word ... (+)\nThe  first  form  of  the command prints the value of all shell variables.  Variables\nwhich contain more than a single word print as a parenthesized word list.  The second\nform sets name to the null string.  The third form sets name to the single word.  The\nfourth form sets name to the list of words in wordlist.  In all cases  the  value  is\ncommand  and  filename expanded.  If -r is specified, the value is set read-only.  If\n-f or -l are specified, set only unique words keeping their order.   -f  prefers  the\nfirst occurrence of a word, and -l the last.  The fifth form sets the index'th compo‐\nnent of name to word; this component must already exist.  The sixth form  lists  only\nthe  names  of  all  shell variables that are read-only.  The seventh form makes name\nread-only, whether or not it has a value.  The eighth form is the same as  the  third\nform, but make name read-only at the same time.\n\nThese  arguments can be repeated to set and/or make read-only multiple variables in a\nsingle set command.  Note, however, that variable expansion happens for all arguments\nbefore  any setting occurs.  Note also that `=' can be adjacent to both name and word\nor separated from both by whitespace, but cannot be  adjacent  to  only  one  or  the\nother.  See also the unset builtin command.\n\nsetenv [name [value]]\nWithout  arguments,  prints the names and values of all environment variables.  Given\nname, sets the environment variable name to value or,  without  value,  to  the  null\nstring.\n\nsetpath path (+)\nEquivalent to setpath(1).  (Mach only)\n\nsetspath LOCAL|site|cpu ... (+)\nSets the system execution path.  (TCF only)\n\nsettc cap value (+)\nTells  the  shell  to  believe  that the terminal capability cap (as defined in term‐\ncap(5)) has the value value.  No sanity checking is done.  Concept terminal users may\nhave to `settc xn no' to get proper wrapping at the rightmost column.\n\nsetty [-d|-q|-x] [-a] [[+|-]mode] (+)\nControls  which  tty  modes  (see  Terminal  management)  the shell does not allow to\nchange.  -d, -q or -x tells setty to act on the `edit', `quote' or `execute'  set  of\ntty modes respectively; without -d, -q or -x, `execute' is used.\n\nWithout  other  arguments, setty lists the modes in the chosen set which are fixed on\n(`+mode') or off (`-mode').  The available modes, and thus  the  display,  vary  from\nsystem to system.  With -a, lists all tty modes in the chosen set whether or not they\nare fixed.  With +mode, -mode or mode, fixes mode on or off or removes  control  from\nmode  in the chosen set.  For example, `setty +echok echoe' fixes `echok' mode on and\nallows commands to turn `echoe' mode on or off, both when the shell is executing com‐\nmands.\n\nsetxvers [string] (+)\nSet  the  experimental  version prefix to string, or removes it if string is omitted.\n(TCF only)\n\nshift [variable]\nWithout arguments, discards argv[1] and shifts the members of argv to the  left.   It\nis  an  error  for  argv  not to be set or to have less than one word as value.  With\nvariable, performs the same function on variable.\n\nsource [-h] name [args ...]\nThe shell reads and executes commands from name.  The commands are not placed on  the\nhistory  list.   If any args are given, they are placed in argv.  (+) source commands\nmay be nested; if they are nested too deeply the shell may run out of  file  descrip‐\ntors.  An error in a source at any level terminates all nested source commands.  With\n-h, commands are placed on the history list instead  of  being  executed,  much  like\n`history -L'.\n\nstop %job|pid ...\nStops the specified jobs or processes which are executing in the background.  job may\nbe a number, a string, `', `%', `+' or `-' as described under Jobs.  There is no  de‐\nfault job; saying just `stop' does not stop the current job.\n\nsuspend Causes  the  shell  to  stop in its tracks, much as if it had been sent a stop signal\nwith ^Z.  This is most often used to stop shells started by su(1).\n\nswitch (string)\ncase str1:\n...\nbreaksw\n..."
                },
                {
                    "name": "default:",
                    "content": "...\nbreaksw\nendsw   Each case label is successively matched, against the specified string which is  first\ncommand  and filename expanded.  The file metacharacters `*', `?' and `[...]'  may be\nused in the case labels, which are variable expanded.  If none of  the  labels  match\nbefore a `default' label is found, then the execution begins after the default label.\nEach case label and the default label must appear at the beginning of  a  line.   The\ncommand  breaksw causes execution to continue after the endsw.  Otherwise control may\nfall through case labels and default labels as in C.  If no label matches  and  there\nis no default, execution continues after the endsw.\n\ntelltc (+)\nLists the values of all terminal capabilities (see termcap(5)).\n\ntermname [terminal type] (+)\nTests  if  terminal  type (or the current value of TERM if no terminal type is given)\nhas an entry in the hosts termcap(5) or terminfo(5)  database.  Prints  the  terminal\ntype to stdout and returns 0 if an entry is present otherwise returns 1.\n\ntime [command]\nExecutes command (which must be a simple command, not an alias, a pipeline, a command\nlist or a parenthesized command list) and prints a time summary  as  described  under\nthe time variable.  If necessary, an extra shell is created to print the time statis‐\ntic when the command completes.  Without command, prints a time summary for the  cur‐\nrent shell and its children.\n\numask [value]\nSets the file creation mask to value, which is given in octal.  Common values for the\nmask are 002, giving all access to the group and read and execute access  to  others,\nand  022,  giving  read  and  execute access to the group and others.  Without value,\nprints the current file creation mask.\n\nunalias pattern\nRemoves all aliases whose names match pattern.  `unalias *' thus removes all aliases.\nIt is not an error for nothing to be unaliased.\n\nuncomplete pattern (+)\nRemoves  all  completions whose names match pattern.  `uncomplete *' thus removes all\ncompletions.  It is not an error for nothing to be uncompleted.\n\nunhash  Disables use of the internal hash table to speed location of executed programs.\n\nuniverse universe (+)\nSets the universe to universe.  (Masscomp/RTU only)\n\nunlimit [-hf] [resource]\nRemoves the limitation on resource or, if no resource is specified, all resource lim‐\nitations.   With  -h, the corresponding hard limits are removed.  Only the super-user\nmay do this.  Note that unlimit may not exit successful, since most  systems  do  not\nallow descriptors to be unlimited.  With -f errors are ignored.\n\nunset pattern\nRemoves  all  variables whose names match pattern, unless they are read-only.  `unset\n*' thus removes all variables unless they are read-only; this is a bad idea.   It  is\nnot an error for nothing to be unset.\n\nunsetenv pattern\nRemoves  all  environment variables whose names match pattern.  `unsetenv *' thus re‐\nmoves all environment variables; this is a bad idea.  It is not an error for  nothing\nto be unsetenved.\n\nver [systype [command]] (+)\nWithout  arguments,  prints  SYSTYPE.   With  systype, sets SYSTYPE to systype.  With\nsystype and command, executes command under systype.   systype  may  be  `bsd4.3'  or\n`sys5.3'.  (Domain/OS only)\n\nwait    The  shell  waits for all background jobs.  If the shell is interactive, an interrupt\nwill disrupt the wait and cause the shell to print the names and job numbers  of  all\noutstanding jobs.\n\nwarp universe (+)\nSets the universe to universe.  (Convex/OS only)\n\nwatchlog (+)\nAn  alternate  name  for the log builtin command (q.v.).  Available only if the shell\nwas so compiled; see the version shell variable.\n\nwhere command (+)\nReports all known instances of command, including aliases, builtins  and  executables\nin path.\n\nwhich command (+)\nDisplays  the  command  that  will be executed by the shell after substitutions, path\nsearching, etc.  The builtin command is just like which(1), but it correctly  reports\ntcsh  aliases and builtins and is 10 to 100 times faster.  See also the which-command\neditor command.\n\nwhile (expr)\n...\nend     Executes the commands between the while and the matching end while expr  (an  expres‐\nsion,  as described under Expressions) evaluates non-zero.  while and end must appear\nalone on their input lines.  break and continue may be used to terminate or  continue\nthe  loop  prematurely.   If  the input is a terminal, the user is prompted the first\ntime through the loop as with foreach.\n"
                },
                {
                    "name": "Special aliases (+)",
                    "content": "If set, each of these aliases executes automatically at the indicated  time.   They  are  all\ninitially undefined.\n\nbeepcmd Runs when the shell wants to ring the terminal bell.\n\ncwdcmd  Runs after every change of working directory.  For example, if the user is working on\nan X window system using xterm(1) and a re-parenting window manager that supports ti‐\ntle bars such as twm(1) and does\n\n> alias cwdcmd  'echo -n \"^[]2;${HOST}:$cwd ^G\"'\n\nthen  the  shell  will change the title of the running xterm(1) to be the name of the\nhost, a colon, and the full current working directory.  A fancier way to do that is\n\n> alias cwdcmd 'echo -n \"^[]2;${HOST}:$cwd^G^[]1;${HOST}^G\"'\n\nThis will put the hostname and working directory on the title bar but only the  host‐\nname in the icon manager menu.\n\nNote  that  putting  a cd, pushd or popd in cwdcmd may cause an infinite loop.  It is\nthe author's opinion that anyone doing so will get what they deserve.\n\njobcmd  Runs before each command gets executed, or when the command changes state.   This  is\nsimilar to postcmd, but it does not print builtins.\n\n> alias jobcmd  'echo -n \"^[]2\\;\\!#:q^G\"'\n\nthen executing vi foo.c will put the command string in the xterm title bar.\n"
                },
                {
                    "name": "helpcommand",
                    "content": "Invoked by the run-help editor command.  The command name for which help is sought is\npassed as sole argument.  For example, if one does\n\n> alias helpcommand '\\!:1 --help'\n\nthen the help display of the command itself will be invoked, using the GNU help call‐\ning  convention.   Currently there is no easy way to account for various calling con‐\nventions (e.g., the customary Unix `-h'), except by using a table of many commands.\n"
                },
                {
                    "name": "periodic",
                    "content": "Runs every tperiod minutes.  This provides a convenient means for checking on  common\nbut infrequent changes such as new mail.  For example, if one does\n\n> set tperiod = 30\n> alias periodic checknews\n\nthen  the checknews(1) program runs every 30 minutes.  If periodic is set but tperiod\nis unset or set to 0, periodic behaves like precmd.\n\nprecmd  Runs just before each prompt is printed.  For example, if one does\n\n> alias precmd date\n\nthen date(1) runs just before the shell prompts for each command.  There are no  lim‐\nits on what precmd can be set to do, but discretion should be used.\n\npostcmd Runs before each command gets executed.\n\n> alias postcmd  'echo -n \"^[]2\\;\\!#:q^G\"'\n\nthen executing vi foo.c will put the command string in the xterm title bar.\n\nshell   Specifies  the  interpreter for executable scripts which do not themselves specify an\ninterpreter.  The first word should be a full path name to  the  desired  interpreter\n(e.g., `/bin/csh' or `/usr/local/bin/tcsh').\n"
                },
                {
                    "name": "Special shell variables",
                    "content": "The variables described in this section have special meaning to the shell.\n\nThe  shell  sets  addsuffix,  argv,  autologout,  csubstnonl, command, echostyle, edit, gid,\ngroup, home, loginsh, oid, path, prompt, prompt2, prompt3, shell,  shlvl,  tcsh,  term,  tty,\nuid,  user  and version at startup; they do not change thereafter unless changed by the user.\nThe shell updates cwd, dirstack, owd and status when necessary, and sets logout on logout.\n\nThe shell synchronizes group, home, path, shlvl, term and user with the environment variables\nof  the  same  names:  whenever the environment variable changes the shell changes the corre‐\nsponding shell variable to match (unless the shell variable is  read-only)  and  vice  versa.\nNote  that  although  cwd  and PWD have identical meanings, they are not synchronized in this\nmanner, and that the shell automatically converts between the different formats of  path  and\nPATH.\n\naddsuffix (+)\nIf set, filename completion adds `/' to the end of directories and a space to the end\nof normal files when they are matched exactly.  Set by default.\n\nafsuser (+)\nIf set, autologout's autolock feature uses its value instead of  the  local  username\nfor kerberos authentication.\n\nampm (+)\nIf set, all times are shown in 12-hour AM/PM format.\n\nanyerror (+)\nThis  variable  selects  what  is propagated to the value of the status variable. For\nmore information see the description of the status variable below.\n\nargv    The arguments to the shell.  Positional parameters are taken from argv, i.e., `$1' is\nreplaced  by  `$argv[1]',  etc.   Set  by  default,  but usually empty in interactive\nshells.\n\nautocorrect (+)\nIf set, the spell-word editor command is invoked automatically before each completion\nattempt.\n\nautoexpand (+)\nIf  set,  the expand-history editor command is invoked automatically before each com‐\npletion attempt. If this is set to onlyhistory, then only history  will  be  expanded\nand a second completion will expand filenames.\n\nautolist (+)\nIf  set,  possibilities are listed after an ambiguous completion.  If set to `ambigu‐\nous', possibilities are listed only when no new characters are added by completion.\n\nautologout (+)\nThe first word is the number of minutes of inactivity before automatic  logout.   The\noptional second word is the number of minutes of inactivity before automatic locking.\nWhen the shell automatically logs out, it prints `auto-logout', sets the variable lo‐‐\ngout  to  `automatic' and exits.  When the shell automatically locks, the user is re‐\nquired to enter his password to continue working.  Five incorrect attempts result  in\nautomatic logout.  Set to `60' (automatic logout after 60 minutes, and no locking) by\ndefault in login and superuser shells, but not if the shell thinks it is running  un‐\nder  a  window  system  (i.e., the DISPLAY environment variable is set), the tty is a\npseudo-tty (pty) or the shell was not so compiled (see the version  shell  variable).\nSee also the afsuser and logout shell variables.\n\nautorehash (+)\nIf  set, the internal hash table of the contents of the directories in the path vari‐\nable will be recomputed if a command is not found in the hash  table.   In  addition,\nthe  list of available commands will be rebuilt for each command completion or spell‐\ning correction attempt if set to `complete' or `correct' respectively; if set to `al‐\nways', this will be done for both cases.\n\nbackslashquote (+)\nIf  set,  backslashes  (`\\')  always  quote `\\', `'', and `\"'.  This may make complex\nquoting tasks easier, but it can cause syntax errors in csh(1) scripts.\n\ncatalog The file name of the message catalog.  If set, tcsh use `tcsh.${catalog}' as  a  mes‐\nsage catalog instead of default `tcsh'.\n\ncdpath  A  list  of  directories  in which cd should search for subdirectories if they aren't\nfound in the current directory.\n\ncdtohome (+)\nIf not set, cd requires a directory name, and will not go to the  home  directory  if\nit's omitted.  This is set by default.\n\ncolor   If  set,  it enables color display for the builtin ls-F and it passes --color=auto to\nls.  Alternatively, it can be set to only ls-F or only ls to enable color to only one\ncommand.  Setting it to nothing is equivalent to setting it to (ls-F ls).\n"
                },
                {
                    "name": "colorcat",
                    "content": "If set, it enables color escape sequence for NLS message files.  And display colorful\nNLS messages.\n\ncommand (+)\nIf set, the command which was passed to the shell with the -c flag (q.v.).\n\ncompatexpr (+)\nIf set, the shell will evaluate expressions right to left, like the original csh.\n\ncomplete (+)\nIf set to `igncase', the completion becomes case insensitive.  If set  to  `enhance',\ncompletion  ignores  case  and considers hyphens and underscores to be equivalent; it\nwill also treat periods, hyphens and underscores (`.', `-' and `') as  word  separa‐\ntors.   If  set  to `Enhance', completion matches uppercase and underscore characters\nexplicitly and matches lowercase and hyphens in a case-insensitive  manner;  it  will\ntreat periods, hyphens and underscores as word separators.\n\ncontinue (+)\nIf set to a list of commands, the shell will continue the listed commands, instead of\nstarting a new one.\n\ncontinueargs (+)\nSame as continue, but the shell will execute:\n\necho `pwd` $argv > ~/.<cmd>pause; %<cmd>\n\ncorrect (+)\nIf set to `cmd', commands are automatically  spelling-corrected.   If  set  to  `com‐\nplete',  commands  are  automatically completed.  If set to `all', the entire command\nline is corrected.\n\ncsubstnonl (+)\nIf set, newlines and carriage returns in command substitution are replaced by spaces.\nSet by default.\n\ncwd     The  full  pathname  of  the  current directory.  See also the dirstack and owd shell\nvariables.\n\ndextract (+)\nIf set, `pushd +n' extracts the nth directory from the directory  stack  rather  than\nrotating it to the top.\n\ndirsfile (+)\nThe  default  location  in which `dirs -S' and `dirs -L' look for a history file.  If\nunset, ~/.cshdirs is  used.   Because  only  ~/.tcshrc  is  normally  sourced  before\n~/.cshdirs, dirsfile should be set in ~/.tcshrc rather than ~/.login.\n\ndirstack (+)\nAn  array  of all the directories on the directory stack.  `$dirstack[1]' is the cur‐\nrent working directory, `$dirstack[2]' the first directory on the stack,  etc.   Note\nthat the current working directory is `$dirstack[1]' but `=0' in directory stack sub‐\nstitutions, etc.  One can change the stack arbitrarily by setting dirstack,  but  the\nfirst  element  (the  current working directory) is always correct.  See also the cwd\nand owd shell variables.\n\ndspmbyte (+)\nHas an effect iff 'dspm' is listed as part of the version shell variable.  If set  to\n`euc', it enables display and editing EUC-kanji(Japanese) code.  If set to `sjis', it\nenables display and editing Shift-JIS(Japanese) code.  If set to `big5',  it  enables\ndisplay  and  editing  Big5(Chinese)  code.  If set to `utf8', it enables display and\nediting Utf8(Unicode) code.  If set to the following format, it enables  display  and\nediting of original multi-byte code format:\n\n> set dspmbyte = 0000....(256 bytes)....0000\n\nThe  table  requires  just  256  bytes.  Each character of 256 characters corresponds\n(from left to right) to the ASCII codes 0x00, 0x01, ... 0xff.  Each character is  set\nto number 0,1,2 and 3.  Each number has the following meaning:\n0 ... not used for multi-byte characters.\n1 ... used for the first byte of a multi-byte character.\n2 ... used for the second byte of a multi-byte character.\n3 ... used for both the first byte and second byte of a multi-byte character.\n\nExample:\nIf  set  to  `001322',  the first character (means 0x00 of the ASCII code) and second\ncharacter (means 0x01 of ASCII code) are set to `0'.  Then, it is not used for multi-\nbyte  characters.  The 3rd character (0x02) is set to '1', indicating that it is used\nfor the first byte of a multi-byte character.  The 4th character(0x03)  is  set  '3'.\nIt  is  used  for  both the first byte and the second byte of a multi-byte character.\nThe 5th and 6th characters (0x04,0x05) are set to '2', indicating that they are  used\nfor the second byte of a multi-byte character.\n\nThe  GNU fileutils version of ls cannot display multi-byte filenames without the -N (\n--literal ) option.   If you are using this version, set the second word of  dspmbyte\nto \"ls\".  If not, for example, \"ls-F -l\" cannot display multi-byte filenames.\n\nNote:\nThis  variable  can  only  be  used if KANJI and DSPMBYTE has been defined at compile\ntime.\n\ndunique (+)\nIf set, pushd removes any instances of name from the stack before pushing it onto the\nstack.\n\necho    If  set,  each  command with its arguments is echoed just before it is executed.  For\nnon-builtin commands all expansions  occur  before  echoing.   Builtin  commands  are\nechoed before command and filename substitution, because these substitutions are then\ndone selectively.  Set by the -x command line option.\n\nechostyle (+)\nThe style of the echo builtin.  May be set to\n\nbsd     Don't echo a newline if the first argument is `-n'; the default for csh.\nsysv    Recognize backslashed escape sequences in echo strings.\nboth    Recognize both the `-n' flag and backslashed escape  sequences;  the  default\nfor tcsh.\nnone    Recognize neither.\n\nSet  by  default  to  the local system default.  The BSD and System V options are de‐\nscribed in the echo(1) man pages on the appropriate systems.\n\nedit (+)\nIf set, the command-line editor is used.  Set by default in interactive shells.\n\neditors (+)\nA list of command names for the run-fg-editor editor command to match.  If  not  set,\nthe  EDITOR  (`ed' if unset) and VISUAL (`vi' if unset) environment variables will be\nused instead.\n\nellipsis (+)\nIf set, the `%c'/`%.' and `%C' prompt sequences (see the prompt shell variable) indi‐\ncate skipped directories with an ellipsis (`...')  instead of `/<skipped>'.\n\neuid (+)\nThe user's effective user ID.\n\neuser (+)\nThe first matching passwd entry name corresponding to the effective user ID.\n\nfignore (+)\nLists file name suffixes to be ignored by completion.\n\nfilec   In  tcsh,  completion is always used and this variable is ignored by default. If edit\nis unset, then the traditional csh completion is used.  If set in csh, filename  com‐\npletion is used.\n\ngid (+) The user's real group ID.\n\nglobdot (+)\nIf  set,  wild-card glob patterns will match files and directories beginning with `.'\nexcept for `.' and `..'\n\nglobstar (+)\nIf set, the `' and `*' file glob patterns will match any string of characters in‐\ncluding  `/' traversing any existing sub-directories.  (e.g.  `ls .c' will list all\nthe .c files in the current directory tree).  If used by itself, it will  match  zero\nor  more  sub-directories  (e.g. `ls /usr/include//time.h' will list any file named\n`time.h' in the /usr/include directory tree; whereas `ls /usr/include/time.h'  will\nmatch  any  file  in the /usr/include directory tree ending in `time.h').  To prevent\nproblems with recursion, the `' glob-pattern will not descend into a symbolic  link\ncontaining a directory.  To override this, use `*'\n\ngroup (+)\nThe user's group name.\n"
                },
                {
                    "name": "highlight",
                    "content": "If  set, the incremental search match (in i-search-back and i-search-fwd) and the re‐\ngion between the mark and the cursor are highlighted in reverse video.\n\nHighlighting requires more frequent terminal writes, which introduces extra overhead.\nIf you care about terminal performance, you may want to leave this unset.\n"
                },
                {
                    "name": "histchars",
                    "content": "A  string  value determining the characters used in History substitution (q.v.).  The\nfirst character of its value is used as the history substitution character, replacing\nthe  default character `!'.  The second character of its value replaces the character\n`^' in quick substitutions.\n\nhistdup (+)\nControls handling of duplicate entries in the history list.  If  set  to  `all'  only\nunique history events are entered in the history list.  If set to `prev' and the last\nhistory event is the same as the current command, then the current command is not en‐\ntered  in  the history.  If set to `erase' and the same event is found in the history\nlist, that old event gets erased and the current one gets inserted.   Note  that  the\n`prev' and `all' options renumber history events so there are no gaps.\n\nhistfile (+)\nThe  default location in which `history -S' and `history -L' look for a history file.\nIf unset, ~/.history is used.  histfile is useful when sharing the same  home  direc‐\ntory  between different machines, or when saving separate histories on different ter‐\nminals.  Because only ~/.tcshrc  is  normally  sourced  before  ~/.history,  histfile\nshould be set in ~/.tcshrc rather than ~/.login.\n\nhistlit (+)\nIf set, builtin and editor commands and the savehist mechanism use the literal (unex‐\npanded) form of lines in the history list.  See also the toggle-literal-history  edi‐\ntor command.\n\nhistory The  first  word indicates the number of history events to save.  The optional second\nword  (+)  indicates  the  format  in  which  history  is  printed;  if  not   given,\n`%h\\t%T\\t%R\\n'  is used.  The format sequences are described below under prompt; note\nthe variable meaning of `%R'.  Set to `100' by default.\n\nhome    Initialized to the home directory of the invoker.   The  filename  expansion  of  `~'\nrefers to this variable.\n"
                },
                {
                    "name": "ignoreeof",
                    "content": "If set to the empty string or `0' and the input device is a terminal, the end-of-file\ncommand (usually generated by the user by typing `^D' on an empty  line)  causes  the\nshell  to  print  `Use  \"exit\" to leave tcsh.' instead of exiting.  This prevents the\nshell from accidentally being killed.  Historically this setting exited after 26 suc‐\ncessive EOF's to avoid infinite loops.  If set to a number n, the shell ignores n - 1\nconsecutive end-of-files and exits on the nth.  (+) If unset, `1' is used, i.e.,  the\nshell exits on a single `^D'.\n\nimplicitcd (+)\nIf  set, the shell treats a directory name typed as a command as though it were a re‐\nquest to change to that directory.  If set to verbose, the  change  of  directory  is\nechoed  to  the standard output.  This behavior is inhibited in non-interactive shell\nscripts, or for command strings with more than one word.   Changing  directory  takes\nprecedence  over executing a like-named command, but it is done after alias substitu‐\ntions.  Tilde and variable expansions work as expected.\n\ninputmode (+)\nIf set to `insert' or `overwrite', puts the editor into that input mode at the begin‐\nning of each line.\n\nkilldup (+)\nControls handling of duplicate entries in the kill ring.  If set to `all' only unique\nstrings are entered in the kill ring.  If set to `prev' and the last killed string is\nthe  same as the current killed string, then the current string is not entered in the\nring.  If set to `erase' and the same string is found  in  the  kill  ring,  the  old\nstring is erased and the current one is inserted.\n\nkillring (+)\nIndicates  the  number  of killed strings to keep in memory.  Set to `30' by default.\nIf unset or set to less than `2', the shell will only keep the most  recently  killed\nstring.   Strings  are  put in the killring by the editor commands that delete (kill)\nstrings of text, e.g. backward-delete-word, kill-line, etc, as well as  the  copy-re‐\ngion-as-kill  command.   The  yank  editor command will yank the most recently killed\nstring into the command-line, while yank-pop (see Editor commands)  can  be  used  to\nyank earlier killed strings.\n\nlistflags (+)\nIf  set to `x', `a' or `A', or any combination thereof (e.g., `xA'), they are used as\nflags to ls-F, making it act like `ls -xF', `ls  -Fa',  `ls  -FA'  or  a  combination\n(e.g., `ls -FxA'): `a' shows all files (even if they start with a `.'), `A' shows all\nfiles but `.' and `..', and `x' sorts across instead of down.  If the second word  of\nlistflags is set, it is used as the path to `ls(1)'.\n\nlistjobs (+)\nIf  set,  all jobs are listed when a job is suspended.  If set to `long', the listing\nis in long format.\n\nlistlinks (+)\nIf set, the ls-F builtin command shows the type of file to which each  symbolic  link\npoints.\n\nlistmax (+)\nThe  maximum  number of items which the list-choices editor command will list without\nasking first.\n\nlistmaxrows (+)\nThe maximum number of rows of items which the list-choices editor command  will  list\nwithout asking first.\n\nloginsh (+)\nSet  by the shell if it is a login shell.  Setting or unsetting it within a shell has\nno effect.  See also shlvl.\n\nlogout (+)\nSet by the shell to `normal' before a normal logout, `automatic' before an  automatic\nlogout,  and  `hangup'  if  the  shell was killed by a hangup signal (see Signal han‐‐\ndling).  See also the autologout shell variable.\n\nmail    A list of files and directories to check for incoming mail, optionally preceded by  a\nnumeric  word.   Before  each prompt, if 10 minutes have passed since the last check,\nthe shell checks each file and says `You have new mail.' (or, if mail contains multi‐\nple files, `You have new mail in name.') if the filesize is greater than zero in size\nand has a modification time greater than its access time.\n\nIf you are in a login shell, then no mail file is reported unless it has  been  modi‐\nfied  after  the  time  the shell has started up, to prevent redundant notifications.\nMost login programs will tell you whether or not you have mail when you log in.\n\nIf a file specified in mail is a directory, the shell will  count  each  file  within\nthat  directory  as  a  separate message, and will report `You have n mails.' or `You\nhave n mails in name.' as appropriate.  This functionality is provided primarily  for\nthose systems which store mail in this manner, such as the Andrew Mail System.\n\nIf  the first word of mail is numeric it is taken as a different mail checking inter‐\nval, in seconds.\n\nUnder very rare circumstances, the shell may report `You have mail.' instead of  `You\nhave new mail.'\n\nmatchbeep (+)\nIf  set  to `never', completion never beeps.  If set to `nomatch', it beeps only when\nthere is no match.  If set to `ambiguous', it beeps when there are multiple  matches.\nIf set to `notunique', it beeps when there is one exact and other longer matches.  If\nunset, `ambiguous' is used.\n\nnobeep (+)\nIf set, beeping is completely disabled.  See also visiblebell.\n"
                },
                {
                    "name": "noclobber",
                    "content": "If set, restrictions are placed on output redirection to insure that  files  are  not\naccidentally  destroyed  and  that  `>>' redirections refer to existing files, as de‐\nscribed in the Input/output section.\n\nnoding  If set, disable the printing of `DING!' in the prompt time specifiers at  the  change\nof hour.\n\nnoglob  If  set, Filename substitution and Directory stack substitution (q.v.) are inhibited.\nThis is most useful in shell scripts which do not deal with  filenames,  or  after  a\nlist of filenames has been obtained and further expansions are not desirable.\n\nnokanji (+)\nIf  set and the shell supports Kanji (see the version shell variable), it is disabled\nso that the meta key can be used.\n"
                },
                {
                    "name": "nonomatch",
                    "content": "If set, a Filename substitution or Directory stack substitution (q.v.) which does not\nmatch any existing files is left untouched rather than causing an error.  It is still\nan error for the substitution to be malformed, e.g., `echo [' still gives an error.\n\nnostat (+)\nA list of directories (or glob-patterns which match directories; see Filename substi‐‐\ntution)  that should not be stat(2)ed during a completion operation.  This is usually\nused to exclude directories which take too much time to stat(2), for example /afs.\n\nnotify  If set, the shell announces  job  completions  asynchronously.   The  default  is  to\npresent job completions just before printing a prompt.\n\noid (+) The user's real organization ID.  (Domain/OS only)\n\nowd (+) The  old working directory, equivalent to the `-' used by cd and pushd.  See also the\ncwd and dirstack shell variables.\n\npadhour If set, enable the printing of padding '0' for hours, in  24  and  12  hour  formats.\nE.G.: 07:45:42 vs. 7:45:42.\n"
                },
                {
                    "name": "parseoctal",
                    "content": "To  retain  compatibily with older versions numeric variables starting with 0 are not\ninterpreted as octal. Setting this variable enables proper octal parsing.\n\npath    A list of directories in which to look for executable commands.  A null  word  speci‐\nfies  the  current directory.  If there is no path variable then only full path names\nwill execute.  path is set by the shell at startup from the PATH environment variable\nor,  if  PATH does not exist, to a system-dependent default something like `(/usr/lo‐\ncal/bin /usr/bsd /bin /usr/bin .)'.  The shell may put `.' first or last in  path  or\nomit it entirely depending on how it was compiled; see the version shell variable.  A\nshell which is given neither the -c nor the -t option hashes the contents of the  di‐\nrectories in path after reading ~/.tcshrc and each time path is reset.  If one adds a\nnew command to a directory in path while the shell is active, one may need  to  do  a\nrehash for the shell to find it.\n\nprintexitvalue (+)\nIf  set  and  an  interactive  program exits with a non-zero status, the shell prints\n`Exit status'.\n\nprompt  The string which is printed before reading each command from  the  terminal.   prompt\nmay  include any of the following formatting sequences (+), which are replaced by the\ngiven information:\n\n%/  The current working directory.\n%~  The current working directory, but with one's home directory represented  by  `~'\nand  other users' home directories represented by `~user' as per Filename substi‐‐\ntution.  `~user' substitution happens only if the shell has already used  `~user'\nin a pathname in the current session.\n%c[[0]n], %.[[0]n]\nThe trailing component of the current working directory, or n trailing components\nif a digit n is given.  If n begins with `0', the number  of  skipped  components\nprecede the trailing component(s) in the format `/<skipped>trailing'.  If the el‐‐\nlipsis shell variable is set, skipped components are represented by  an  ellipsis\nso  the  whole becomes `...trailing'.  `~' substitution is done as in `%~' above,\nbut the `~' component is ignored when counting trailing components.\n%C  Like %c, but without `~' substitution.\n%h, %!, !\nThe current history event number.\n%M  The full hostname.\n%m  The hostname up to the first `.'.\n%S (%s)\nStart (stop) standout mode.\n%B (%b)\nStart (stop) boldfacing mode.\n%U (%u)\nStart (stop) underline mode.\n%t, %@\nThe time of day in 12-hour AM/PM format.\n%T  Like `%t', but in 24-hour format (but see the ampm shell variable).\n%p  The `precise' time of day in 12-hour AM/PM format, with seconds.\n%P  Like `%p', but in 24-hour format (but see the ampm shell variable).\n\\c  c is parsed as in bindkey.\n^c  c is parsed as in bindkey.\n%%  A single `%'.\n%n  The user name.\n%N  The effective user name.\n%j  The number of jobs.\n%d  The weekday in `Day' format.\n%D  The day in `dd' format.\n%w  The month in `Mon' format.\n%W  The month in `mm' format.\n%y  The year in `yy' format.\n%Y  The year in `yyyy' format.\n%l  The shell's tty.\n%L  Clears from the end of the prompt to end of the display or the end of the line.\n%$  Expands the shell or environment variable name immediately after the `$'.\n%#  `>' (or the first character of the promptchars shell variable) for normal  users,\n`#' (or the second character of promptchars) for the superuser.\n%{string%}\nIncludes  string  as a literal escape sequence.  It should be used only to change\nterminal attributes and should not move the cursor location.  This cannot be  the\nlast sequence in prompt.\n%?  The return code of the command executed just before the prompt.\n%R  In prompt2, the status of the parser.  In prompt3, the corrected string.  In his‐‐\ntory, the history string.\n\n`%B', `%S', `%U' and `%{string%}' are available in only eight-bit-clean  shells;  see\nthe version shell variable.\n\nThe  bold, standout and underline sequences are often used to distinguish a superuser\nshell.  For example,\n\n> set prompt = \"%m [%h] %B[%@]%b [%/] you rang? \"\ntut [37] [2:54pm] [/usr/accts/sys] you rang?\n\nIf `%t', `%@', `%T', `%p', or `%P' is used, and noding is not set, then print `DING!'\non the change of hour (i.e, `:00' minutes) instead of the actual time.\n\nSet by default to `%# ' in interactive shells.\n\nprompt2 (+)\nThe  string with which to prompt in while and foreach loops and after lines ending in\n`\\'.  The same format sequences may be used as in prompt (q.v.);  note  the  variable\nmeaning of `%R'.  Set by default to `%R? ' in interactive shells.\n\nprompt3 (+)\nThe  string  with which to prompt when confirming automatic spelling correction.  The\nsame format sequences may be used as in prompt (q.v.); note the variable  meaning  of\n`%R'.  Set by default to `CORRECT>%R (y|n|e|a)? ' in interactive shells.\n\npromptchars (+)\nIf  set (to a two-character string), the `%#' formatting sequence in the prompt shell\nvariable is replaced with the first character for normal users and the second charac‐\nter for the superuser.\n\npushdtohome (+)\nIf set, pushd without arguments does `pushd ~', like cd.\n\npushdsilent (+)\nIf set, pushd and popd do not print the directory stack.\n\nrecexact (+)\nIf set, completion completes on an exact match even if a longer match is possible.\n\nrecognizeonlyexecutables (+)\nIf set, command listing displays only files in the path that are executable.  Slow.\n\nrmstar (+)\nIf set, the user is prompted before `rm *' is executed.\n\nrprompt (+)\nThe  string  to  print on the right-hand side of the screen (after the command input)\nwhen the prompt is being displayed on the left.  It recognizes  the  same  formatting\ncharacters  as prompt.  It will automatically disappear and reappear as necessary, to\nensure that command input isn't obscured, and will appear only if the prompt, command\ninput,  and  itself  will  fit  together  on the first line.  If edit isn't set, then\nrprompt will be printed after the prompt and before the command input.\n\nsavedirs (+)\nIf set, the shell does `dirs -S' before exiting.  If the first word is set to a  num‐\nber, at most that many directory stack entries are saved.\n"
                },
                {
                    "name": "savehist",
                    "content": "If  set,  the  shell does `history -S' before exiting.  If the first word is set to a\nnumber, at most that many lines are saved.  (The number should be less than or  equal\nto  the  number  history  entries; if it is set to greater than the number of history\nsettings, only history entries will be saved) If the second word is set  to  `merge',\nthe history list is merged with the existing history file instead of replacing it (if\nthere is one) and sorted by time stamp and the most recent events are  retained.   If\nthe  second word of savehist is `merge' and the third word is set to `lock', the his‐\ntory file update will be serialized with other shell  sessions  that  would  possibly\nlike to merge history at exactly the same time. (+)\n\nsched (+)\nThe  format in which the sched builtin command prints scheduled events; if not given,\n`%h\\t%T\\t%R\\n' is used.  The format sequences are described above under prompt;  note\nthe variable meaning of `%R'.\n\nshell   The  file  in  which  the shell resides.  This is used in forking shells to interpret\nfiles which have execute bits set, but which are not executable by the system.   (See\nthe  description  of  Builtin and non-builtin command execution.)  Initialized to the\n(system-dependent) home of the shell.\n\nshlvl (+)\nThe number of nested shells.  Reset to 1 in login shells.  See also loginsh.\n\nstatus  The exit status from the last command or backquote expansion, or  any  command  in  a\npipeline is propagated to status.  (This is also the default csh behavior.)  This de‐\nfault does not match what POSIX mandates (to return the status of  the  last  command\nonly). To match the POSIX behavior, you need to unset anyerror.\n\nIf  the  anyerror variable is unset, the exit status of a pipeline is determined only\nfrom the last command in the pipeline, and the exit status of a  backquote  expansion\nis not propagated to status.\n\nIf  a  command terminated abnormally, then 0200 is added to the status.  Builtin com‐\nmands which fail return exit status `1', all other  builtin  commands  return  status\n`0'.\n\nsymlinks (+)\nCan  be  set to several different values to control symbolic link (`symlink') resolu‐\ntion:\n\nIf set to `chase', whenever the current directory changes to a directory containing a\nsymbolic  link,  it  is  expanded to the real name of the directory to which the link\npoints.  This does not work for the user's home directory; this is a bug.\n\nIf set to `ignore', the shell tries to construct a current directory relative to  the\ncurrent  directory before the link was crossed.  This means that cding through a sym‐\nbolic link and then `cd ..'ing returns one to the original directory.   This  affects\nonly builtin commands and filename completion.\n\nIf set to `expand', the shell tries to fix symbolic links by actually expanding argu‐\nments which look like path names.  This affects any command, not just builtins.   Un‐\nfortunately, this does not work for hard-to-recognize filenames, such as those embed‐\nded in command options.  Expansion may be prevented by quoting.  While  this  setting\nis  usually  the  most convenient, it is sometimes misleading and sometimes confusing\nwhen it fails to recognize an argument which should be expanded.  A compromise is  to\nuse  `ignore'  and  use  the editor command normalize-path (bound by default to ^X-n)\nwhen necessary.\n\nSome examples are in order.  First, let's set up some play directories:\n\n> cd /tmp\n> mkdir from from/src to\n> ln -s from/src to/dst\n\nHere's the behavior with symlinks unset,\n\n> cd /tmp/to/dst; echo $cwd\n/tmp/to/dst\n> cd ..; echo $cwd\n/tmp/from\n\nhere's the behavior with symlinks set to `chase',\n\n> cd /tmp/to/dst; echo $cwd\n/tmp/from/src\n> cd ..; echo $cwd\n/tmp/from\n\nhere's the behavior with symlinks set to `ignore',\n\n> cd /tmp/to/dst; echo $cwd\n/tmp/to/dst\n> cd ..; echo $cwd\n/tmp/to\n\nand here's the behavior with symlinks set to `expand'.\n\n> cd /tmp/to/dst; echo $cwd\n/tmp/to/dst\n> cd ..; echo $cwd\n/tmp/to\n> cd /tmp/to/dst; echo $cwd\n/tmp/to/dst\n> cd \"..\"; echo $cwd\n/tmp/from\n> /bin/echo ..\n/tmp/to\n> /bin/echo \"..\"\n..\n\nNote that `expand' expansion 1) works just like `ignore' for builtins like cd, 2)  is\nprevented  by quoting, and 3) happens before filenames are passed to non-builtin com‐\nmands.\n\ntcsh (+)\nThe version number of the shell in the format `R.VV.PP', where `R' is the  major  re‐\nlease number, `VV' the current version and `PP' the patchlevel.\n\nterm    The terminal type.  Usually set in ~/.login as described under Startup and shutdown.\n\ntime    If  set  to  a number, then the time builtin (q.v.) executes automatically after each\ncommand which takes more than that many CPU seconds.  If there is a second  word,  it\nis used as a format string for the output of the time builtin.  (u) The following se‐\nquences may be used in the format string:\n\n%U  The time the process spent in user mode in cpu seconds.\n%S  The time the process spent in kernel mode in cpu seconds.\n%E  The elapsed (wall clock) time in seconds.\n%P  The CPU percentage computed as (%U + %S) / %E.\n%W  Number of times the process was swapped.\n%X  The average amount in (shared) text space used in Kbytes.\n%D  The average amount in (unshared) data/stack space used in Kbytes.\n%K  The total space used (%X + %D) in Kbytes.\n%M  The maximum memory the process had in use at any time in Kbytes.\n%F  The number of major page faults (page needed to be brought from disk).\n%R  The number of minor page faults.\n%I  The number of input operations.\n%O  The number of output operations.\n%r  The number of socket messages received.\n%s  The number of socket messages sent.\n%k  The number of signals received.\n%w  The number of voluntary context switches (waits).\n%c  The number of involuntary context switches.\n\nOnly the first four sequences are supported on systems  without  BSD  resource  limit\nfunctions.   The  default  time format is `%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww' for\nsystems that support resource usage reporting and `%Uu %Ss %E %P' for systems that do\nnot.\n\nUnder Sequent's DYNIX/ptx, %X, %D, %K, %r and %s are not available, but the following\nadditional sequences are:\n\n%Y  The number of system calls performed.\n%Z  The number of pages which are zero-filled on demand.\n%i  The number of times a process's resident set size was increased by the kernel.\n%d  The number of times a process's resident set size was decreased by the kernel.\n%l  The number of read system calls performed.\n%m  The number of write system calls performed.\n%p  The number of reads from raw disk devices.\n%q  The number of writes to raw disk devices.\n\nand the default time format is `%Uu %Ss %E %P %I+%Oio %Fpf+%Ww'.  Note that  the  CPU\npercentage can be higher than 100% on multi-processors.\n\ntperiod (+)\nThe period, in minutes, between executions of the periodic special alias.\n\ntty (+) The name of the tty, or empty if not attached to one.\n\nuid (+) The user's real user ID.\n\nuser    The user's login name.\n\nverbose If  set,  causes  the words of each command to be printed, after history substitution\n(if any).  Set by the -v command line option.\n\nversion (+)\nThe version ID stamp.  It contains the shell's version number (see tcsh), origin, re‐\nlease  date,  vendor,  operating system and machine (see VENDOR, OSTYPE and MACHTYPE)\nand a comma-separated list of options which were set at compile time.  Options  which\nare set by default in the distribution are noted.\n\n8b    The shell is eight bit clean; default\n7b    The shell is not eight bit clean\nwide  The shell is multibyte encoding clean (like UTF-8)\nnls   The system's NLS is used; default for systems with NLS\nlf    Login  shells execute /etc/csh.login before instead of after /etc/csh.cshrc and\n~/.login before instead of after ~/.tcshrc and ~/.history.\ndl    `.' is put last in path for security; default\nnd    `.' is omitted from path for security\nvi    vi(1)-style editing is the default rather than emacs(1)-style\ndtr   Login shells drop DTR when exiting\nbye   bye is a synonym for logout and log is an alternate name for watchlog\nal    autologout is enabled; default\nkan   Kanji is used if appropriate according to locale settings, unless  the  nokanji\nshell variable is set\nsm    The system's malloc(3) is used\nhb    The `#!<program> <args>' convention is emulated when executing shell scripts\nng    The newgrp builtin is available\nrh    The shell attempts to set the REMOTEHOST environment variable\nafs   The  shell verifies your password with the kerberos server if local authentica‐\ntion fails.  The afsuser shell variable or  the  AFSUSER  environment  variable\noverride your local username if set.\n\nAn  administrator  may  enter additional strings to indicate differences in the local\nversion.\n\nvimode (+)\nIf unset, various key bindings change behavior to be more emacs(1)-style: word bound‐\naries are determined by wordchars versus other characters.\n\nIf  set, various key bindings change behavior to be more vi(1)-style: word boundaries\nare determined by wordchars versus whitespace versus other characters; cursor  behav‐\nior depends upon current vi mode (command, delete, insert, replace).\n\nThis variable is unset by bindkey -e and set by bindkey -v.  vimode may be explicitly\nset or unset by the user after those bindkey operations if required.\n\nvisiblebell (+)\nIf set, a screen flash is used rather than the audible bell.  See also nobeep.\n\nwatch (+)\nA list of user/terminal pairs to watch for logins and logouts.  If either the user is\n`any'  all terminals are watched for the given user and vice versa.  Setting watch to\n`(any any)' watches all users and terminals.  For example,\n\nset watch = (george ttyd1 any console $user any)\n\nreports activity of the user `george' on ttyd1, any user on the console, and  oneself\n(or a trespasser) on any terminal.\n\nLogins  and  logouts  are  checked every 10 minutes by default, but the first word of\nwatch can be set to a number to check every so many minutes.  For example,\n\nset watch = (1 any any)\n\nreports any login/logout once every minute.  For the impatient, the log builtin  com‐\nmand  triggers  a watch report at any time.  All current logins are reported (as with\nthe log builtin) when watch is first set.\n\nThe who shell variable controls the format of watch reports.\n\nwho (+) The format string for watch messages.  The following sequences are  replaced  by  the\ngiven information:\n\n%n  The name of the user who logged in/out.\n%a  The observed action, i.e., `logged on', `logged off' or `replaced olduser on'.\n%l  The terminal (tty) on which the user logged in/out.\n%M  The full hostname of the remote host, or `local' if the login/logout was from the\nlocal host.\n%m  The hostname of the remote host up to the first `.'.  The full name is printed if\nit is an IP address or an X Window System display.\n\n%M  and %m are available on only systems that store the remote hostname in /etc/utmp.\nIf unset, `%n has %a %l from %m.' is used, or `%n has %a %l.' on systems which  don't\nstore the remote hostname.\n\nwordchars (+)\nA list of non-alphanumeric characters to be considered part of a word by the forward-\nword, backward-word etc., editor commands.  If unset, the default value is determined\nbased on the state of vimode: if vimode is unset, `*?-.[]~=' is used as the default;\nif vimode is set, `' is used as the default.\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "AFSUSER (+)\nEquivalent to the afsuser shell variable.\n\nCOLUMNS The number of columns in the terminal.  See Terminal management.\n\nDISPLAY Used by X Window System (see X(1)).  If  set,  the  shell  does  not  set  autologout\n(q.v.).\n\nEDITOR  The  pathname  to  a default editor.  Used by the run-fg-editor editor command if the\nthe editors shell variable is unset.  See also the VISUAL environment variable.\n\nGROUP (+)\nEquivalent to the group shell variable.\n\nHOME    Equivalent to the home shell variable.\n\nHOST (+)\nInitialized to the name of the machine on which the shell is running,  as  determined\nby the gethostname(2) system call.\n\nHOSTTYPE (+)\nInitialized  to  the  type of machine on which the shell is running, as determined at\ncompile time.  This variable is obsolete and will be removed in a future version.\n\nHPATH (+)\nA colon-separated list of directories in which the run-help editor command looks  for\ncommand documentation.\n\nLANG    Gives the preferred character environment.  See Native Language System support.\n\nLCCTYPE\nIf  set,  only  ctype character handling is changed.  See Native Language System sup‐‐\nport.\n\nLINES   The number of lines in the terminal.  See Terminal management.\n\nLSCOLORS\nThe format of this variable is reminiscent of the termcap(5) file  format;  a  colon-\nseparated  list of expressions of the form \"xx=string\", where \"xx\" is a two-character\nvariable name.  The variables with their associated defaults are:\n\nno   0      Normal (non-filename) text\nfi   0      Regular file\ndi   01;34  Directory\nln   01;36  Symbolic link\npi   33     Named pipe (FIFO)\nso   01;35  Socket\ndo   01;35  Door\nbd   01;33  Block device\ncd   01;32  Character device\nex   01;32  Executable file\nmi   (none) Missing file (defaults to fi)\nor   (none) Orphaned symbolic link (defaults to ln)\nlc   ^[[    Left code\nrc   m      Right code\nec   (none) End code (replaces lc+no+rc)\n\nYou need to include only the variables you want to change from the default.\n\nFile names can also be colorized based on filename extension.  This is  specified  in\nthe  LSCOLORS  variable using the syntax \"*ext=string\".  For example, using ISO 6429\ncodes, to color all C-language source files blue you would  specify  \"*.c=34\".   This\nwould color all files ending in .c in blue (34) color.\n\nControl characters can be written either in C-style-escaped notation, or in stty-like\n^-notation.  The C-style notation adds ^[ for Escape,  for a normal space character,\nand  ?  for Delete.  In addition, the ^[ escape character can be used to override the\ndefault interpretation of ^[, ^, : and =.\n\nEach file will be written as <lc> <color-code> <rc> <filename>  <ec>.   If  the  <ec>\ncode  is undefined, the sequence <lc> <no> <rc> will be used instead.  This is gener‐\nally more convenient to use, but less general.  The left, right  and  end  codes  are\nprovided  so  you  don't have to type common parts over and over again and to support\nweird terminals; you will generally not need to change them at all unless your termi‐\nnal does not use ISO 6429 color sequences but a different system.\n\nIf your terminal does use ISO 6429 color codes, you can compose the type codes (i.e.,\nall except the lc, rc, and ec codes) from numerical commands separated by semicolons.\nThe most common commands are:\n\n0   to restore default color\n1   for brighter colors\n4   for underlined text\n5   for flashing text\n30  for black foreground\n31  for red foreground\n32  for green foreground\n33  for yellow (or brown) foreground\n34  for blue foreground\n35  for purple foreground\n36  for cyan foreground\n37  for white (or gray) foreground\n40  for black background\n41  for red background\n42  for green background\n43  for yellow (or brown) background\n44  for blue background\n45  for purple background\n46  for cyan background\n47  for white (or gray) background\n\nNot all commands will work on all systems or display devices.\n\nA  few terminal programs do not recognize the default end code properly.  If all text\ngets colorized after you do a directory listing, try changing the  no  and  fi  codes\nfrom 0 to the numerical codes for your standard fore- and background colors.\n\nMACHTYPE (+)\nThe  machine  type  (microprocessor class or machine model), as determined at compile\ntime.\n\nNOREBIND (+)\nIf set, printable characters are not rebound to self-insert-command.  See Native Lan‐‐\nguage System support.\n\nOSTYPE (+)\nThe operating system, as determined at compile time.\n\nPATH    A  colon-separated  list of directories in which to look for executables.  Equivalent\nto the path shell variable, but in a different format.\n\nPWD (+) Equivalent to the cwd shell variable, but not synchronized to it; updated only  after\nan actual directory change.\n\nREMOTEHOST (+)\nThe  host  from  which  the  user has logged in remotely, if this is the case and the\nshell is able to determine it.  Set only if the shell was so compiled; see  the  ver‐‐\nsion shell variable.\n\nSHLVL (+)\nEquivalent to the shlvl shell variable.\n\nSYSTYPE (+)\nThe current system type.  (Domain/OS only)\n\nTERM    Equivalent to the term shell variable.\n\nTERMCAP The terminal capability string.  See Terminal management.\n\nUSER    Equivalent to the user shell variable.\n\nVENDOR (+)\nThe vendor, as determined at compile time.\n\nVISUAL  The  pathname to a default full-screen editor.  Used by the run-fg-editor editor com‐\nmand if the the editors shell variable is unset.  See  also  the  EDITOR  environment\nvariable.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/csh.cshrc  Read  first  by  every shell.  ConvexOS, Stellix and Intel use /etc/cshrc and\nNeXTs use /etc/cshrc.std.  A/UX, AMIX, Cray and IRIX have  no  equivalent  in\ncsh(1),  but read this file in tcsh anyway.  Solaris 2.x does not have it ei‐\nther, but tcsh reads /etc/.cshrc.  (+)\n/etc/csh.login  Read by login shells after /etc/csh.cshrc.  ConvexOS, Stellix and  Intel  use\n/etc/login,  NeXTs use /etc/login.std, Solaris 2.x uses /etc/.login and A/UX,\nAMIX, Cray and IRIX use /etc/cshrc.\n~/.tcshrc (+)   Read by every shell after /etc/csh.cshrc or its equivalent.\n~/.cshrc        Read by every shell, if ~/.tcshrc doesn't exist, after /etc/csh.cshrc or  its\nequivalent.  This manual uses `~/.tcshrc' to mean `~/.tcshrc or, if ~/.tcshrc\nis not found, ~/.cshrc'.\n~/.history      Read by login shells after ~/.tcshrc if savehist is set, but see  also  hist‐‐\nfile.\n~/.login        Read  by  login  shells after ~/.tcshrc or ~/.history.  The shell may be com‐\npiled to read ~/.login before instead of after ~/.tcshrc and ~/.history;  see\nthe version shell variable.\n~/.cshdirs (+)  Read  by  login  shells after ~/.login if savedirs is set, but see also dirs‐‐\nfile.\n/etc/csh.logout Read by login shells at logout.  ConvexOS, Stellix and Intel use  /etc/logout\nand  NeXTs use /etc/logout.std.  A/UX, AMIX, Cray and IRIX have no equivalent\nin csh(1), but read this file in tcsh anyway.  Solaris 2.x does not  have  it\neither, but tcsh reads /etc/.logout.  (+)\n~/.logout       Read by login shells at logout after /etc/csh.logout or its equivalent.\n/bin/sh         Used to interpret shell scripts not starting with a `#'.\n/tmp/sh*        Temporary file for `<<'.\n/etc/passwd     Source of home directories for `~name' substitutions.\n\nThe  order  in  which  startup  files  are  read may differ if the shell was so compiled; see\nStartup and shutdown and the version shell variable.\n",
            "subsections": [
                {
                    "name": "NEW FEATURES (+)",
                    "content": "This manual describes tcsh as a single entity, but experienced csh(1) users will want to  pay\nspecial attention to tcsh's new features.\n\nA  command-line  editor,  which supports emacs(1)-style or vi(1)-style key bindings.  See The\ncommand-line editor and Editor commands.\n\nProgrammable, interactive word completion and listing.  See Completion and  listing  and  the\ncomplete and uncomplete builtin commands.\n\nSpelling correction (q.v.) of filenames, commands and variables.\n\nEditor  commands (q.v.) which perform other useful functions in the middle of typed commands,\nincluding documentation lookup (run-help), quick editor restarting (run-fg-editor)  and  com‐\nmand resolution (which-command).\n\nAn  enhanced  history  mechanism.  Events in the history list are time-stamped.  See also the\nhistory command and its associated shell variables, the  previously  undocumented  `#'  event\nspecifier  and  new modifiers under History substitution, the *-history, history-search-*, i-\nsearch-*, vi-search-* and toggle-literal-history editor commands and the histlit shell  vari‐\nable.\n\nEnhanced  directory  parsing  and directory stack handling.  See the cd, pushd, popd and dirs\ncommands and their associated shell variables, the description of Directory  stack  substitu‐‐\ntion, the dirstack, owd and symlinks shell variables and the normalize-command and normalize-\npath editor commands.\n\nNegation in glob-patterns.  See Filename substitution.\n\nNew File inquiry operators (q.v.) and a filetest builtin which uses them.\n\nA variety of Automatic, periodic and timed events (q.v.) including scheduled events,  special\naliases,  automatic  logout  and terminal locking, command timing and watching for logins and\nlogouts.\n\nSupport for the Native Language System (see Native Language System support), OS variant  fea‐\ntures  (see  OS  variant support and the echostyle shell variable) and system-dependent file\nlocations (see FILES).\n\nExtensive terminal-management capabilities.  See Terminal management.\n\nNew builtin commands including builtins, hup, ls-F, newgrp, printenv, which and where (q.v.).\n\nNew variables that make useful information easily available to the shell.  See the  gid,  lo‐‐\nginsh,  oid, shlvl, tcsh, tty, uid and version shell variables and the HOST, REMOTEHOST, VEN‐‐\nDOR, OSTYPE and MACHTYPE environment variables.\n\nA new syntax for including useful information in the prompt string (see prompt), and  special\nprompts for loops and spelling correction (see prompt2 and prompt3).\n\nRead-only variables.  See Variable substitution.\n"
                }
            ]
        },
        "BUGS": {
            "content": "When  a  suspended command is restarted, the shell prints the directory it started in if this\nis different from the current directory.  This can be misleading (i.e., wrong) as the job may\nhave changed directories internally.\n\nShell  builtin functions are not stoppable/restartable.  Command sequences of the form `a ; b\n; c' are also not handled gracefully when stopping is attempted.  If  you  suspend  `b',  the\nshell will then immediately execute `c'.  This is especially noticeable if this expansion re‐\nsults from an alias.  It suffices to place the sequence of commands in ()'s to force it to  a\nsubshell, i.e., `( a ; b ; c )'.\n\nControl  over  tty output after processes are started is primitive; perhaps this will inspire\nsomeone to work on a good virtual terminal interface.  In a virtual terminal  interface  much\nmore interesting things could be done with output control.\n\nAlias substitution is most often used to clumsily simulate shell procedures; shell procedures\nshould be provided rather than aliases.\n\nControl structures should be parsed rather than being recognized as built-in commands.   This\nwould  allow  control commands to be placed anywhere, to be combined with `|', and to be used\nwith `&' and `;' metasyntax.\n\nforeach doesn't ignore here documents when looking for its end.\n\nIt should be possible to use the `:' modifiers on the output of command substitutions.\n\nThe screen update for lines longer than the screen width is very poor if the terminal  cannot\nmove the cursor up (i.e., terminal type `dumb').\n\nHPATH and NOREBIND don't need to be environment variables.\n\nGlob-patterns which do not use `?', `*' or `[]' or which use `{}' or `~' are not negated cor‐\nrectly.\n\nThe single-command form of if does output redirection even if the expression is false and the\ncommand is not executed.\n\nls-F  includes file identification characters when sorting filenames and does not handle con‐\ntrol characters in filenames well.  It cannot be interrupted.\n\nCommand substitution supports multiple commands and conditions, but not  cycles  or  backward\ngotos.\n\nReport bugs at https://bugs.astron.com/, preferably with fixes.  If you want to help maintain\nand test tcsh, add yourself to the mailing list in https://mailman.astron.com/.\n",
            "subsections": []
        },
        "THE T IN TCSH": {
            "content": "In 1964, DEC produced the PDP-6.  The PDP-10 was a later re-implementation.  It was re-chris‐\ntened the DECsystem-10 in 1970 or so when DEC brought out the second model, the KI10.\n\nTENEX  was  created at Bolt, Beranek & Newman (a Cambridge, Massachusetts think tank) in 1972\nas an experiment in demand-paged virtual memory operating systems.  They built  a  new  pager\nfor  the  DEC  PDP-10  and  created  the  OS  to  go with it.  It was extremely successful in\nacademia.\n\nIn 1975, DEC brought out a new model of the PDP-10, the KL10; they intended to  have  only  a\nversion  of TENEX, which they had licensed from BBN, for the new box.  They called their ver‐\nsion TOPS-20 (their capitalization is trademarked).  A lot of TOPS-10 users  (`The  OPerating\nSystem  for  PDP-10') objected; thus DEC found themselves supporting two incompatible systems\non the same hardware--but then there were 6 on the PDP-11!\n\nTENEX, and TOPS-20 to version 3, had command completion via a user-code-level subroutine  li‐\nbrary called ULTCMD.  With version 3, DEC moved all that capability and more into the monitor\n(`kernel' for you Unix types), accessed by the COMND% JSYS (`Jump to SYStem' instruction, the\nsupervisor call mechanism [are my IBM roots also showing?]).\n\nThe  creator  of  tcsh was impressed by this feature and several others of TENEX and TOPS-20,\nand created a version of csh which mimicked them.\n",
            "subsections": []
        },
        "LIMITATIONS": {
            "content": "The system limits argument lists to ARGMAX characters.\n\nThe number of arguments to a command which involves filename expansion is  limited  to  1/6th\nthe number of characters allowed in an argument list.\n\nCommand substitutions may substitute no more characters than are allowed in an argument list.\n\nTo  detect looping, the shell restricts the number of alias substitutions on a single line to\n20.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "csh(1), emacs(1), ls(1), newgrp(1), sh(1), setpath(1), stty(1), su(1), tset(1), vi(1),  x(1),\naccess(2),   execve(2),   fork(2),  killpg(2),  pipe(2),  setrlimit(2),  sigvec(2),  stat(2),\numask(2), vfork(2), wait(2), malloc(3), setlocale(3),  tty(4),  a.out(5),  termcap(5),  envi‐\nron(7), termio(7), Introduction to the C Shell\n",
            "subsections": []
        },
        "VERSION": {
            "content": "This manual documents tcsh 6.21.00 (Astron) 2019-05-08.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "William Joy\nOriginal author of csh(1)\nJ.E. Kulp, IIASA, Laxenburg, Austria\nJob control and directory stack features\nKen Greer, HP Labs, 1981\nFile name completion\nMike Ellis, Fairchild, 1983\nCommand name recognition/completion\nPaul Placeway, Ohio State CIS Dept., 1983-1993\nCommand line editor, prompt routines, new glob syntax and numerous fixes and speedups\nKarl Kleinpaste, CCI 1983-4\nSpecial  aliases,  directory  stack extraction stuff, login/logout watch, scheduled events,\nand the idea of the new prompt format\nRayan Zachariassen, University of Toronto, 1984\nls-F and which builtins and numerous bug fixes, modifications and speedups\nChris Kingsley, Caltech\nFast storage allocator routines\nChris Grevstad, TRW, 1987\nIncorporated 4.3BSD csh into tcsh\nChristos S. Zoulas, Cornell U. EE Dept., 1987-94\nPorts to HPUX, SVR2 and SVR3, a SysV version of getwd.c, SHORTSTRINGS support  and  a  new\nversion of sh.glob.c\nJames J Dempsey, BBN, and Paul Placeway, OSU, 1988\nA/UX port\nDaniel Long, NNSC, 1988\nwordchars\nPatrick Wolfe, Kuck and Associates, Inc., 1988\nvi mode cleanup\nDavid C Lawrence, Rensselaer Polytechnic Institute, 1989\nautolist and ambiguous completion listing\nAlec Wolman, DEC, 1989\nNewlines in the prompt\nMatt Landau, BBN, 1989\n~/.tcshrc\nRay Moody, Purdue Physics, 1989\nMagic space bar history expansion\nMordechai ????, Intel, 1989\nprintprompt() fixes and additions\nKazuhiro Honda, Dept. of Computer Science, Keio University, 1989\nAutomatic spelling correction and prompt3\nPer Hedeland, Ellemtel, Sweden, 1990-\nVarious bugfixes, improvements and manual updates\nHans J. Albertsson (Sun Sweden)\nampm, settc and telltc\nMichael Bloom\nInterrupt handling fixes\nMichael Fine, Digital Equipment Corp\nExtended key support\nEric Schnoebelen, Convex, 1990\nConvex support, lots of csh bug fixes, save and restore of directory stack\nRon Flax, Apple, 1990\nA/UX 2.0 (re)port\nDan Oscarsson, LTH Sweden, 1990\nNLS support and simulated NLS support for non NLS sites, fixes\nJohan Widen, SICS Sweden, 1990\nshlvl, Mach support, correct-line, 8-bit printing\nMatt Day, Sanyo Icon, 1990\nPOSIX termio support, SysV limit fixes\nJaap Vermeulen, Sequent, 1990-91\nVi mode fixes, expand-line, window change fixes, Symmetry port\nMartin Boyer, Institut de recherche d'Hydro-Quebec, 1991\nautolist  beeping  options, modified the history search to search for the whole string from\nthe beginning of the line to the cursor.\nScott Krotz, Motorola, 1991\nMinix port\nDavid Dawes, Sydney U. Australia, Physics Dept., 1991\nSVR4 job control fixes\nJose Sousa, Interactive Systems Corp., 1991\nExtended vi fixes and vi delete command\nMarc Horowitz, MIT, 1991\nANSIfication fixes, new exec hashing code, imake fixes, where\nBruce Sterling Woodcock, sterling@netcom.com, 1991-1995\nETA and Pyramid port, Makefile and lint fixes,  ignoreeof=n  addition,  and  various  other\nportability changes and bug fixes\nJeff Fink, 1992\ncomplete-word-fwd and complete-word-back\nHarry C. Pulley, 1992\nCoherent port\nAndy Phillips, Mullard Space Science Lab U.K., 1992\nVMS-POSIX port\nBeto Appleton, IBM Corp., 1992\nWalking process group fixes, csh bug fixes, POSIX file tests, POSIX SIGHUP\nScott Bolte, Cray Computer Corp., 1992\nCSOS port\nKaveh R. Ghazi, Rutgers University, 1992\nTek, m88k, Titan and Masscomp ports and fixes.  Added autoconf support.\nMark Linderman, Cornell University, 1992\nOS/2 port\nMika Liljeberg, liljeber@kruuna.Helsinki.FI, 1992\nLinux port\nTim P. Starrin, NASA Langley Research Center Operations, 1993\nRead-only variables\nDave Schweisguth, Yale University, 1993-4\nNew man page and tcsh.man2html\nLarry Schwimmer, Stanford University, 1993\nAFS and HESIOD patches\nLuke Mewburn, RMIT University, 1994-6\nEnhanced directory printing in prompt, added ellipsis and rprompt.\nEdward Hutchins, Silicon Graphics Inc., 1996\nAdded implicit cd.\nMartin Kraemer, 1997\nPorted to Siemens Nixdorf EBCDIC machine\nAmol Deshpande, Microsoft, 1997\nPorted to WIN32 (Windows/95 and Windows/NT); wrote all the missing library and message cat‐\nalog code to interface to Windows.\nTaga Nayuta, 1998\nColor ls additions.\n",
            "subsections": []
        },
        "THANKS TO": {
            "content": "Bryan Dunlap, Clayton Elwell, Karl Kleinpaste, Bob Manson, Steve Romig, Diana  Smetters,  Bob\nSutterfield, Mark Verber, Elizabeth Zwicky and all the other people at Ohio State for sugges‐\ntions and encouragement\n\nAll the people on the net, for putting up with, reporting bugs in, and suggesting  new  addi‐\ntions to each and every version\n\nRichard M. Alderson III, for writing the `T in tcsh' section\n\n\n\nAstron 6.21.00                               8 May 2019                                      TCSH(1)",
            "subsections": []
        }
    },
    "summary": "tcsh - C shell with file name completion and command line editing",
    "flags": [
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "treated as non-option arguments. The remaining arguments will not be interpreted as shell options. This may be used to pass options to a shell script without confusion or possible subterfuge. The shell will not run a set-user ID script without this option."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "gle argument), stored in the command shell variable for reference, and executed. Any re‐ maining arguments are placed in the argv shell variable."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "down, whether or not it is a login shell. (+)"
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": "Sets the environment variable name to value. (Domain/OS only) (+)"
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "status."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "and thus starts faster."
        },
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "be a terminal. Shells are interactive without this option if their inputs and outputs are terminals."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "sions of su(1) can pass -m to the shell. (+)"
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "scripts."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "bugger. Job control is disabled. (u)"
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "newline at the end of this line and continue onto another line."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "tion."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--help",
            "arg": null,
            "description": "Print a help message on the standard output and exit. (+)"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Print the version/platform/compilation options on the standard output and exit. This in‐ formation is also contained in the version shell variable. (+) After processing of flag arguments, if arguments remain but none of the -c, -i, -s, or -t op‐ tions 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 resub‐ stitution by `$0'. Because 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 `stan‐ dard' shell to execute a script whose first character is not a `#', i.e., that does not start with a comment. Remaining arguments are placed in the argv shell variable."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "emacs",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/emacs/1/json"
        },
        {
            "name": "ls",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ls/1/json"
        },
        {
            "name": "newgrp",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/newgrp/1/json"
        },
        {
            "name": "sh",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/sh/1/json"
        },
        {
            "name": "setpath",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/setpath/1/json"
        },
        {
            "name": "stty",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/stty/1/json"
        },
        {
            "name": "su",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/su/1/json"
        },
        {
            "name": "tset",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/tset/1/json"
        },
        {
            "name": "vi",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/vi/1/json"
        },
        {
            "name": "x",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/x/1/json"
        },
        {
            "name": "access",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/access/2/json"
        },
        {
            "name": "execve",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/execve/2/json"
        },
        {
            "name": "fork",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fork/2/json"
        },
        {
            "name": "killpg",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/killpg/2/json"
        },
        {
            "name": "pipe",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/pipe/2/json"
        },
        {
            "name": "setrlimit",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/setrlimit/2/json"
        },
        {
            "name": "sigvec",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/sigvec/2/json"
        },
        {
            "name": "stat",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/stat/2/json"
        },
        {
            "name": "umask",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/umask/2/json"
        },
        {
            "name": "vfork",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/vfork/2/json"
        },
        {
            "name": "wait",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/wait/2/json"
        },
        {
            "name": "malloc",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/malloc/3/json"
        },
        {
            "name": "setlocale",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/setlocale/3/json"
        },
        {
            "name": "tty",
            "section": "4",
            "url": "https://www.chedong.com/phpMan.php/man/tty/4/json"
        },
        {
            "name": "a.out",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/a.out/5/json"
        },
        {
            "name": "termcap",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/termcap/5/json"
        },
        {
            "name": "ron",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ron/7/json"
        },
        {
            "name": "termio",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/termio/7/json"
        }
    ]
}