HOME

TheInfoList



OR:

tcsh ( “tee-see-shell”, “tee-shell”, or as “tee see ess aitch”, tcsh) is a
Unix shell A Unix shell is a command-line Interpreter (computing), interpreter or shell (computing), shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting langua ...
based on and
backward compatible Backward compatibility (sometimes known as backwards compatibility) is a property of an operating system, product, or technology that allows for interoperability with an older legacy system, or with input designed for such a system, especially in ...
with the
C shell The C shell (csh or the improved version, tcsh) is a Unix shell created by Bill Joy while he was a graduate student at University of California, Berkeley in the late 1970s. It has been widely distributed, beginning with the 2BSD release of th ...
(csh).


Shell

It is essentially the C shell with programmable
command-line completion Command-line completion (also tab completion) is a common feature of command-line interpreters, in which the program automatically fills in partially typed commands. Command line interpreters are programs that allow a user to interact with the ...
,
command-line A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
editing, and a few other features. Unlike the other common shells, functions cannot be defined in a tcsh script and the user must use aliases instead (as in csh). It is the native root shell for BSD-based systems such as
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
. tcsh added filename and command completion and command line editing concepts borrowed from the TENEX operating system, which is the source of the “t”. Because it only added functionality and did not change what was there, tcsh remained
backward compatible Backward compatibility (sometimes known as backwards compatibility) is a property of an operating system, product, or technology that allows for interoperability with an older legacy system, or with input designed for such a system, especially in ...
with the original C shell. Though it started as a side branch from the original csh source tree that
Bill Joy William Nelson Joy (born November 8, 1954) is an American computer engineer and venture capitalist. He co-founded Sun Microsystems in 1982 along with Scott McNealy, Vinod Khosla, and Andy Bechtolsheim, and served as Chief Scientist and CTO at ...
had created, tcsh is now the main branch for ongoing development. tcsh is very stable but new releases continue to appear roughly once a year, consisting mostly of minor bug fixes. On many systems, such as
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
and
Red Hat Linux Red Hat Linux was a widely used commercial open-source Linux distribution created by Red Hat until its discontinuation in 2004. Early releases of Red Hat Linux were called Red Hat Commercial Linux. Red Hat published the first non-beta rele ...
, csh is actually tcsh. Often one of the two files is either a hard link or a
symbolic link In computing, a symbolic link (also symlink or soft link) is a file whose purpose is to point to a file or directory (called the "target") by specifying a path thereto. Symbolic links are supported by POSIX and by most Unix-like operating syste ...
to the other, so that either name refers to the same improved version of the C shell. On Debian and some derivatives (including
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All ...
), there are two different packages: csh and tcsh. The former is based on the original BSD version of csh and the latter is the improved tcsh.


History

The “t” in tcsh comes from the “T” in TENEX, an
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
which inspired Ken Greer at Carnegie Mellon University, the author of tcsh, with its command-completion feature. Greer began working on his code to implement Tenex-style file name completion in September 1975, finally merging it into the C shell in December 1981. Mike Ellis at Fairchild A.I. Labs added command completion in September 1983. On October 3, 1983, Greer posted source to the net.sources newsgroup.


Significant features

*Command history **The built-in history command displays the previously entered commands **Use of / at the command line to allow the user to select a command from the history to edit/execute **Invoking previous commands using
command history Command history is a feature in many operating system shells, computer algebra programs, and other software that allows the user to recall, edit and rerun previous commands. Command line history was added to Unix in Bill Joy's C shell of 1978; ...
***!! executes the previous command ***!n executes the nth command that was previously executed ***!-n executes the command that was executed ''n'' commands ago ***!''string'' executes the most recently executed command that starts with ''string'' ***!?''string'' executes the most recently executed command that contains ''string'' **Using history in new commands ***!* - refers to all of the arguments from the previous command ***!$ - refers to the last argument from the previous command ***!^ - refers to the first argument from the previous command ***!:n - refers to the nth argument from the previous command ***!:m-n - refers to the mth through nth arguments from the previous command ***!:n-$ - refers to the nth through the last argument from the previous command *Command line editing *Auto-completion of file names and variables as well as programmable completion at the command line *Alias argument selectors; the ability to define an alias to take arguments supplied to it and apply them to the commands that it refers to. Tcsh is the only shell that provides this feature. **\!# - argument selector for all arguments, including the alias/command itself; arguments need not be supplied. **\!* - argument selector for all arguments, excluding the alias/command; arguments need not be supplied. **\!$ - argument selector for the last argument; argument need not be supplied, but if none is supplied, the alias name is considered to be the last argument. **\!^ - argument selector for first argument; argument MUST be supplied. **\!:n - argument selector for the nth argument; argument MUST be supplied; n=0 refers to the alias/command name. **\!:m-n - argument selector for the arguments from the mth to the nth; arguments MUST be supplied. **\!:n-$ - argument selector for the arguments from the nth to the last; at least argument n MUST be supplied. **\!:n* - argument selector for the arguments from the nth to the last; sufficient arguments need not be supplied. #Alias the cd command so that when you change directories, the contents are immediately displayed. alias cd 'cd \!* && ls' *Wildcard matching if ( "$input" =~ -9 ) then echo "the input starts with an integer" else echo "the input does NOT start with an integer" endif *Job control *The built-in where command. Works like the which command but shows all locations of the target command in the directories specified in $PATH rather than only the one that will be used.


Deployment

Early versions of Mac OS X shipped with tcsh as the default shell, but the default for new accounts became
bash Bash or BASH may refer to: Arts and entertainment * ''Bash!'' (Rockapella album), 1992 * ''Bash!'' (Dave Bailey album), 1961 * '' Bash: Latter-Day Plays'', a dramatic triptych * ''BASH!'' (role-playing game), a 2005 superhero game * "Bash" ('' ...
as of 10.3 then
zsh The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell (computing), shell and as a command line interpreter, command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including som ...
as of 10.15. (tcsh is still provided, and upgrading the OS does not change the shell of any existing accounts). tcsh is the default root shell of
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
(the default user shell is
POSIX The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines both the system- and user-level application programming inter ...
-based)POSIX 2008 Shell Command Language
"The System V shell was selected as the starting point for the Shell and Utilities volume of POSIX.1-2008. The BSD C shell was excluded from consideration"
and its descendants like
DragonFly BSD DragonFly BSD is a free and open-source Unix-like operating system forked from FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and FreeBSD developer between 1994 and 2003, began working on DragonFly BSD in ...
and
DesktopBSD DesktopBSD is a Unix-derivative, desktop-oriented operating system based on FreeBSD. Its goal is to combine the stability of FreeBSD with the ease-of-use of K Desktop Environment 3, which is the default graphical user interface. History and de ...
.


See also

*
Comparison of command shells A command shell is a command-line interface to interact with and manipulate a computer's operating system. General characteristics Interactive features Background execution Background execution allows a shell to run a command without us ...


References


External links

*
tcsh releases

tcsh mailing list



Archive for the O'Reilly book "Using csh and tcsh"
{{Unix shells Cross-platform free software Free software programmed in C Scripting languages Software using the BSD license Text-oriented programming languages Unix shells