Chapter 1. Introduction

In This chapter:

  • Using the Examples

  • Selecting a Login Shell

  • Before You Read Further

When you log in to a UNIX system, you're typically greeted by some sort of banner message and a prompt such as % or $. The prompt indicates that you're talking to a shell—a command interpreter that provides you with an interface to the services UNIX offers. Why the name "shell"? Think of a shell as a wrapper around UNIX, insulating you from the need to know the underlying details of the operating system. Your shell helps you get your work done by reading the commands you type and passing the commands to the operating system for execution.

This handbook is about csh, a popular shell that is well suited for issuing commands, and tcsh, csh's more powerful cousin. When you use a shell, the shell's capabilities and your ability to effectively employ them have a direct impact on the efficiency with which you work. This handbook helps you get more out of csh or tcsh by showing you what the shells can do and how to use their services in interesting and creative ways. Your shell will become more valuable to you, because you'll know how to use it to get your work done more easily.

Using the Examples

This handbook works best when read while sitting at the keyboard. Try the examples yourself (or make up your own commands based on them). In doing so, you'll more easily grasp the illustrated techniques. If I don't specify whether an example is specific to csh or tcsh, you can assume the example works for both shells. tcsh-specific features are noted as such.

It's likely that you'll need to make some substitutions in the example commands, due to differences among versions of UNIX. For instance, many of the examples use more to paginate command output, but some systems supply pg instead. Similarly, a number of examples use –s as the argument to the mail command for specifying a message subject, but on some systems mailx rather than mail understands –s. Printing commands vary quite a bit as well. I use lpr in the examples, but you'll need to substitute your local equivalent. Table 1-1 lists some of the substitute commands you can try.

Table 1-1. Command Equivalencies

If you don't have…

Try this instead…

more

page, pg, less, most

mail –s

mailx –s, elm –s

stty all

stty –a

lpr

lp

emacs

gmacs, gnumacs

colrm

cut –c

Get Using csh & tcsh 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.