Learning the Korn Shell

Learning the Korn ShellSearch this book
Previous: A.4 pdkshAppendix A
Related Shells
Next: A.6 Workalikes on PC Platforms
 

A.5 bash

bash is another popular "third-party" shell that is available on the Internet, via anonymous FTP on prep.ai.mit.edu in the directory /pub/gnu. You can also order it from its maker: The Free Software Foundation (FSF) 675 Massachusetts Avenue Cambridge MA 02139, phone (617) 876-3296.

Bash was written by Brian Fox and Chet Ramey. Its name is in line with the FSF's penchant for bad puns: it stands for Bourne-Again Shell. Although bash is easily available and you don't have to pay for it (other than the cost of media, phone calls, etc.), it's not really public domain software. While public domain software doesn't have licensing restrictions, the FSF's software does. But those restrictions are diametrically opposed to those in a commercial license: [3] instead of agreeing not to distribute the software further, you agree not to prevent it from being distributed further! In other words, you enjoy unrestricted use of the software as long as you agree not to inhibit others from doing the same. Richard Stallman, the founder of the FSF, invented this intriguing and admirable concept.

[3] Accordingly, the document that spells out these restrictions is called a copyleft.

You may have heard that public domain software tends to be buggy, poorly maintained and documented, etc. Let us emphasize that this is absolutely not the case with software from the FSF. It is among the finest, most full-featured, best-maintained, and most technically advanced software in existence.

The FSF has been developing a complete, UNIX-compatible operating system called GNU, which stands for GNU's Not UNIX. [4] They have already written lots of utilities and software tools for GNU that also run on most varieties of UNIX, the most famous of which is the GNU Emacs editor. The shell for GNU is bash.

[4] This is an example of a recursive acronym, in which the first letter stands for the acronym itself. It is the result of a mental disorder caused by a rare brain parasite endemic to the southern part of Cambridge, MA.

bash is fully compatible with the Bourne shell. It has several of the most important Korn shell features and the C shell features that the Korn shell has appropriated, including aliases, functions, tilde notation, emacs and vi editing modes, arithmetic expressions, job control, etc.

Yet bash is not really a Korn shell workalike. Various aspects of its syntax are different, e.g.:

Some of these will change as the POSIX 1003.2 standard evolves. Bash also doesn't implement various small Korn shell features, including most of those listed above for pdksh, and it doesn't support the DEBUG fake signal.

However, bash has many features of its own that make it a very powerful and flexible environment. Here are some of the highlights:

We're compelled to say that many users prefer bash to the Korn shell. Although the latter is probably used by more people, because of the commercial channels through which it's distributed, bash is clearly an excellent choice.


Previous: A.4 pdkshLearning the Korn ShellNext: A.6 Workalikes on PC Platforms
A.4 pdkshBook IndexA.6 Workalikes on PC Platforms

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System


Banner.Novgorod.Ru