Shell Game


You are now the master of logging in to and out of Unix. If you are not a master yet, then continue to practice until you are; each lesson after this one builds in complexity, so this skill must be mastered to continue. As was previously mentioned, the true power of Unix is within the text-based environment, where you can execute every command completely. Again, the only problem with this is knowing how to manipulate these commands. Another thing to consider is what shell you are working within. Experienced Windows users will know that Windows, when conceptualized, was intended to run on top of DOS (disk operating system). Windows installed on top of DOS to make a complete operating system. Windows was the environment, and there were a few different versions of DOS available.

Now, apply the same concept to Unix. The shell (the shell prompt you just worked within to log in and log out) can also be changed. You applied KDE to get your environment. The concepts behind all shells are the same, so now that you understand what a shell is, let's go over the different types available and most commonly used.

This Shell Smells a Bit Fishy One of your goals while learning Unix should be to not let any of the lingo scare you. A shell is nothing more than a preference. Most commands and functionalities are the same between shells. Unless you are a hardcore developer and well versed in Unix, most times, you will use and continue to use whatever environment you grow accustomed to learning. However, one great thing about Unix is the fact that you can change your shell easily once you know how. This adds a deep layer of flexibility into an already powerful engine.


As we just mentioned, Unix has a wide variety of shells that you can choose from, and many of the major differences between them are related to programming with them. Programming is usually based around the need to try to automate a process or job. With this in mind, remember that the shell you select changes the way you program. To automate jobs, you can write a shell script. A script is nothing more than a file that calls commands to automate a process. We will learn more about shell scripting in Lesson 14, "Shell Scripting Fundamentals."

Shell Scripting Is Very Powerful A script is very similar to a DOS batch file. For those of you with Windows and DOS skills, comparing DOS batch files with Unix shell scripts is like comparing a piece of sand with the desert.


For those of you new to Unix, you will probably have to use whatever shell is available to you, unless you are able to install Unix and manipulate it yourself. In this section, we will explore only what shells are most commonly used and what their benefits are; your shell selection is your own choice and your own preference. In any case, the shells that are most commonly used today are as follows:

  • sh The Bourne shell: This is one of the most commonly seen shells, and it is available on just about any Unix distribution in use today. The Bourne shell offers a simple scripting syntax and is the most commonly used and learned by Unix users.

  • csh The C-shell: The csh shell takes its name from the C programming language. A programming language is similar to shell scripting in which it uses the same concepts of automation, but takes it to a high level. The scripting environment that is offered by csh is similar to the C language and offers enough flexibility to write lengthy, customized scripts that run on most Unix machines. Most developers will be familiar with csh.

  • tcsh The extended C-shell: If you are familiar with csh, then tcsh will be no mystery to you. Some of the shell extensions available with tcsh include filename completion and an accessible command history.

  • bash The Bourne-again shell: This is the default shell available on most Linux systems.

In Lesson 15, "User Utilities," you will learn to change to a different shell. If you can't select your shell and begin this book with the one you want, never fear: By the end of the book, you will be able to. For now, let's get comfortable with getting beyond the login and logout process and issuing commands to the shell prompt so we can be productive.



    SAMS Teach Yourself Unix in 10 Minutes
    Sams Teach Yourself Unix in 10 Minutes (2nd Edition)
    ISBN: 0672327643
    EAN: 2147483647
    Year: 2005
    Pages: 170

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