ksh keeps up

March 20, 2001, 01:07 PM —  Unix Insider — 


You're a shell programmer, right? Do you know how far that can take you?


If you use ksh93, you can travel roughly as far as you could with any other scripting language.


You already know it

Most Unix workers have done at least simple command-line scripting with login shells such as sh, bash, tcsh, and so on. Perhaps you've needed the names of the 10 files in a particular directory that were most recently changed, and you wrote:


      ls -1td $DIRECTORY | head -10
   


If you know that much about programming the shell, then you're ready to do complicated arithmetic, network applications, and even GUIs. That's the promise that ksh93 fulfills.


ksh is the Korn shell, named after AT&T Labs researcher David Korn. Korn has been working on ksh for almost 20 years. ksh is upward-compatible with the Bourne shell (sh), it has essentially all the capabilities of other popular login shells, it was a standard for SysVr4 Unix, and it was the reference for the POSIX and ISO shell definitions. It's also faster than other shells, sometimes as much as by an order of magnitude, and it has functionality that makes it a full-fledged language, on a par with Perl, Tcl, and other newcomer languages.


What was the holdup?

So why aren't you already using ksh for everything you do? Probably not for technical reasons. ksh has always been owned by AT&T and other companies (various combinations of Lucent and Novell, mostly). Its license was onerous, compared with those of Perl, Tcl, and Bash. This hindered its adoption in many cases.


Last year, however, Korn succeeded in opening up the source code, and now ksh93 is available in both source and binary forms under a liberal AT&T license. This promotes Korn's positioning of KornShell (the language that ksh93 implements) as a peer of Perl, Python, and so on. "We don't write anything in Perl anymore, because [ksh93] has all the functionality built-in," Korn claims.


That's strictly true only for a restricted meaning of all, of course; there's no ksh equivalent to CPAN, which supplies all Perl's add-on functionality in Web service, database management, and other specific areas. ksh93 also doesn't support programming in the large with the namespaces, object orientation, and exception handling of other advanced scripting languages. However, anyone accustomed to shell programming who needs to manage networks, build GUI control panels, integrate C-coded modules, and write maintainable applications should look into ksh93. ksh is nearly unique, of course, in offering all this power from a processor that is also usable as a login shell.


Portable shell

ksh93 is freely available for essentially all Unixes, and also, with light license restrictions, for Windows and MVS. A handful of vendors support ksh93 commercially. Korn's team at AT&T plans to upgrade a future release of KornShell with a combination of object inheritance, support for

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Resources
White Paper

Symantec Backup Exec 12 and Backup Exec System Recovery 8 deliver industry leading Windows data protection and system recovery. Download this whitepaper to find out the top reasons to upgrade and how to get continuous data protection and complete system recovery.

Webcast

Data and system loss — from a hard drive failure, malicious attack, natural disaster, or simple human error — can happen anytime. Don’t leave your business vulnerable. Make sure you have a secure recovery strategy in place. Symantec's latest backup and system recovery technology can efficiently restore critical applications, individual emails and documents and even restore your entire system in minutes in the event of a loss.

White Paper

Businesses face a growing challenge to ensure that the IT environment is properly protected. Backup Exec 12 integrates with other applications in the Symantec family of products, to complement your current data protection strategy, keep your data securely backed up and make it recoverable when you need it most.

Free stuff

Crimeware: Understanding New Attacks and Defenses
By Markus Jakobsson, Zulfikar Ramzan
Published Apr 6, 2008 by Addison-Wesley Professional. Part of the Symantec Press series.
Enter now! | Official rules | Sample chapter

Securing VoIP Networks: Threats, Vulnerabilities, and Countermeasures
By Peter Thermos, Ari Takanen
Published Aug 1, 2007 by Addison-Wesley Professional.
Enter now! | Official rules | Sample chapter

Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

More Resources