Thu 30 Nov 2006
Different Types of Shell As well as allowing us to simply execute commands, the shell enables us to manage the execution of commands. It allows users to define shortcuts and abbreviations to refer to these commands and even to serve as a handy tool for knitting together commands to create conglomerates that function as new commands (they’re called scripts). In terms of flexibility, performance, task automation, and repetitive processing of tasks, the shell in the hands of a knowledgeable user still beats a GUI hands down. Different Types of Shell The earliest versions of UNIX came with what is today known as the Bourne shell (also known as sh), named after its inventor, Steve Bourne. Since then a variety of shell flavors have emerged. However, the core functionality and basic syntax of all of these shells has changed very little. The C-shell (or csh), distributed as part of BSD UNIX, was the next popular flavor of the shell to arrive. The C-shell syntax resembles the C programming language (particularly when it comes to writing shell scripts), hence its name. This aspect of the C-shell was intended to popularize it among the UNIX users, who at that time were largely C programmers. Other popular shells soon arrived - each with more features than the last, while all being backward compatible for the most part. Among them were the Korn shell (or ksh), which was written by David Korn of AT&T Bell Laboratories, and tcsh or the C-shell with command-completion features - that is, the shell ‘intuitively’ completes the commands when we type them in. The Born Again shell (or Bash) is one of the newer flavors of the shell, and is almost completely compatible with its ancestor, the Bourne shell. It is interesting to note that most Unix systems have sh available apart from a preferred flavor of the shell for that Unix system. In fact, some Unix systems make several shells available, and the user may switch between them at will. As far as Linux (and therefore Red Hat Linux 9) is concerned, Bash is the preferred shell, although users may switch to other shell flavors (for example, you can switch to the C-shell by typing csh at the Bash prompt). The choice of a shell is often dictated by personal preference, sometimes by the fact that a user started of with a particular flavor, or sometimes, as in the case of the C-shell, the programming language the user is comfortable with. In this chapter we focus on using the default shell, Bash, to illustrate features of the shell. Let’s begin the chapter by trying to find out what your current shell is. We can figure this out by typing the ps command in any terminal window at the command prompt. The ps command lists the processes - that is to say, the currently executing programs on your system: Note The command prompt is depicted as $ for brevity, it is usually [user@localhost current directory] by default. We shall learn more on setting the prompt later in this chapter. $ ps PID TTY TIME CMD 5355 pts/0 00:00:00 bash 5381 pts/0 00:00:00 ps On executing the ps command, we should see an output similar to the one above. On the last column of the second line of the output we see bash. If we were to switch to a different shell, say csh, we would see csh in 162
Hint: If you are looking for high quality webhost to host and run your jsp application check Vision web hosting jsp services