O'Reilly logo

Learning the bash Shell, Second Edition by Bill Rosenblatt, Cameron Newham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Korn Shell

One of the first major alternatives to the “traditional” shells, Bourne and C, was the Korn shell, publicly released in 1986 as part of AT&T’s “Experimental Toolchest.” The Korn shell was written by David Korn at AT&T. The first version was unsupported, but eventually UNIX System Laboratories (USL) decided to give it support when they released it with their version of UNIX (System V Release 4) in 1989. The November 1988 Korn shell is the most widely used version of this shell.

The 1988 release is not fully POSIX-compliant—less so than bash. The latest release (1993) has brought the Korn shell into better compliance as well as providing more features and streamlining existing features.

Unlike bash, the Korn shell is a commercial product; the source code is not available and you have to purchase the executable (which is usually bundled with the other utilities on most commercial versions of UNIX).

The 1988 Korn shell and bash share many features, but there are some important differences in the Korn shell:

  • Functions are more like separate entities than part of the invoking shell (traps and options are not shared with the invoking shell).

  • Coroutines are supported. Two processes can communicate with one another by using the print and read commands.

  • The command print replaces echo. print can have a file descriptor specified and can be used to communicate with coroutines.

  • Function autoloading is supported. Functions are read into memory only when they are called.

  • String conditional ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required