Tcsh


tcsh is a Unix shell based on and compatible with the C shell. It is essentially the C shell with programmable command-line completion, command-line 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. It is the native root shell for BSD-based systems such as FreeBSD.
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 with the original C shell. Though it started as a side branch from the original csh source tree that Bill Joy 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 Mac OS X and Red Hat Linux, csh is actually tcsh. Often one of the two files is either a hard link or a symbolic link to the other, so that either name refers to the same improved version of the C shell.
On Debian and some derivatives, 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 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

  1. Alias the cd command so that when you change directories, the contents are immediately displayed.
alias cd 'cd \!* && ls'

if then
echo "the input starts with an integer"
else
echo "the input does NOT start with an integer"
endif

Early versions of Mac OS X shipped with tcsh as the default shell, but the default for new accounts became bash as of 10.3 then zsh as of 10.15.. The tcsh is the default root shell of FreeBSD and its descendants like DragonFly BSD and DesktopBSD.