Chapter 21. The tcsh Shell


  • The history of the tcsh shell

  • Parts of tcsh

  • Using the tcsh shell

Another popular alternative shell available in the Linux world is the C shell. The C shell, as you might guess, is somewhat of an attempt to incorporate features found in the C programming language into shell scripting. The most popular version of the C shell implemented in open source is the tcsh shell. This chapter discusses the tcsh shell, describing its features, and showing how to write shell scripts for it.

What Is the tcsh Shell?

The C shell was developed at the University of California, Berkeley by Bill Joy as a replacement for the original Unix shell created at AT&T Labs (before there was even a Bourne shell). Developers at Berkeley had designed and built a Unix system to compete with AT&T Unix, and the C shell was their choice for the default shell. This version of Unix is popularly called the Berkeley Software Distribution (or BSD Unix). The goal of the C shell was to provide a command line and scripting environment that C programmers would be comfortable with.

In the late 1970s Ken Greer created an extension to the C shell that added command line editing features found in the TENEX operating system. This is where the name tcsh came from. The tcsh shell has become a popular shell for many Unix systems patterned after BSD Unix (including early versions of the Mac OS X operating system; newer versions now use the bash shell as the default).

While the bash shell has become ...

Get Linux® Command Line and Shell Scripting Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.