Introduction to the Shell
The shell is the user interface to Unix, and by the same token, several shells are available in Unix. Mac OS X provides you with more than one shell to choose from. Each shell has different features, but all of them affect how commands are interpreted and provide tools to create your Unix environment.
Let’s suppose that the Unix operating system is a car. When you drive, you issue a variety of “commands”: you turn the steering wheel, press the accelerator, or step on the brake. But how does the car translate your commands into the action you want? The car’s drive mechanism, which can be thought of as the car’s user interface, is responsible. Cars can be equipped with front-wheel drive, rear-wheel drive, four-wheel drive, and sometimes combinations of these.
The shell is simply a program that allows the system to understand your commands. (That’s why the shell is often called a command interpreter.) For many users, the shell works invisibly behind the scenes and is something they’ll never see. Your only concern is that the system does what you tell it to; you don’t care about the inner workings. In the car analogy, this is comparable to pressing the brake. Most of us don’t care whether the user interface involves disc, drum, or antilock brakes, as long as the car stops when you step on the brake pedal.
There are three main uses for the shell:
- Interactive use
When the shell is used interactively, it waits for you to issue commands, processes them (to interpret ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access