Section 3.3. Shells


[Page 43 (continued)]

3.3. Shells

The $ or % prompt that you see when you first log in or start a terminal window is displayed by a special kind of program called a shell. A shell is a program that acts as a middleman between you and the Linux operating system. It lets you run programs, build pipelines of processes, save output to files, and run more than one program at the same time. A shell executes all of the commands that you enter. The three most popular shells in Linux environments are:

  • the Bourne Again shell (bash)

  • the Korn shell (ksh)

  • the C shell (csh)

All of these shells share a similar set of core functionality, together with some specialized properties. The Korn shell and Bash are both supersets of the original UNIX Bourne shell. Bash, the newest of all these shells, is quickly becoming the most popular, as it includes many of the most popular features of the others as well as compatibility with the original Bourne shell. This book contains information on how to use all three shells, each discussed in a separate chapter. Chapter 5, "The Linux Shells," describes the core functionality found in all Linux command shells, and subsequent chapters describe the specialized features of each shell.


[Page 44]

Each shell has its own programming language. One reasonable question to ask is: Why would you write a program in a shell language rather than a language like C or Java? The answer is that the shell languages are tailored to manipulating files and processes in the Linux system, which makes them more convenient in many situations. In this chapter the only shell facilities that I use are the abilities to run utilities and to save the output of a process to a file. Let's go ahead and run a few simple GNU utilities.




Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net