Text-only Table of Contents (frame/ no frame)
(6) ksh/bash vs sh Previous Top Next

ksh/bash vs sh

Ksh and bash are both supersets of sh. For maximum portability, even to very old computers, you should stick to the commands found in sh. Where possible, ksh or bash-specific features will be noted in the following pages. In general, the newer shells run a little faster and scripts are often more readable because logic can be expressed more cleanly user the newer syntax. Many commands and conditional tests are now internal. More detail

If you follow textbooks on Bourne shell programming, all of the advice should apply no matter which of the Bourne-derived shells you use. Unfortunately, many vendors have added features over the years and achieving complete portability can be a challenge. Explicitly writing for ksh (or bash) and insisting on that shell being installed, can often be simpler.

The sh and ksh man pages use the term special command for the internal commands - handled by the shell itself.

Previous Top Next

ksh-vs-sh.src  last modified Mar 10, 2005 Introduction Table of Contents
(frame/no frame)
(single file)
© Dartmouth College