Depending on the particular Unix system you’re using, you may have several shells available to you. Table 3.1 describes a few of the more common ones. Each of these shells has slightly different capabilities and features. Keep in mind that the differences in shells do not affect what you can do in Unix; rather, they affect how easily and flexibly you can interact with the system.
SHELL NAME | FEATURES |
---|---|
sh | This shell, which is the original Unix shell (often called the Bourne shell), is fine for scripting but lacks a lot of the flexibility and power for interactive use. For example, it doesn’t have features like command completion, email checking, history, or aliasing. |
csh and tcsh | This family of shells adds great interactive uses but discards the popular scripting support that sh-related shells offer in favor of a C programming-like syntax. Because of the C syntax, this shell is often just called the C shell. Unless you’re a C programmer, these are not likely to be your best choices. |
ksh, bash, and zsh | These provide a good blend of scripting and interactive capabilities, but they stem from different sources (bash is most similar to sh, hence the Bourne Again SHell name). |
You’ll likely have bash, ksh, or tcsh (csh)as your shell, but you can change to one of many other shells fairly easily. As Code Listings 3.3 and 3.4 show, you can start by finding out which shells are available to you. Figure 3.1 shows some shells and how they relate to each other.
At the shell prompt, type cat /etc/shells to find out which shells are available to you. Code Listings 3.4 and 3.5 show the results of this command on two different systems.
✓ Tips
Before you go leaping forward through the next sections and changing your shell, you might check with your system administrator or help desk to find out which shells they support and sanction.
If all else is equal in terms of support from your system administrator or help desk, and you have no clear preference, we’d suggest zsh as a first choice, with bash as a close second. For most purposes, either will be fine. Power users will like zsh better in the long run.
Not all systems use /etc/shells to list acceptable shells--you may have to just look for specific shells, as shown later in this chapter.
[ejr@hobbes]$ more /etc/shells
/bin/bash
/bin/sh
/bin/tcsh
/bin/csh
[ejr@hobbes]$
|
xmission> cat /etc/shells
/usr/local/bin/tcsh
/bin/csh
/usr/bin/csh
/bin/ksh
/usr/bin/ksh
/sbin/sh
/usr/bin/sh
/usr/local/bin/zsh
/usr/local/bin/bash
/usr/local/bin/nologin
/usr/local/bin/terminated
/usr/local/bin/xmmenu.email
/usr/local/bin/xmmenu.noshell
/usr/lib/uucp/uucico
xmission>
|