Section 6.7. Porting Shell Scripts to Linux

6.7. Porting Shell Scripts to Linux

Figure 6-1 shows the Linux shell in relation to the rest of the operating system. The shell, as it is aptly named, sits on the outer edge of the system. It gives users easier ways to interact with system utilities that query or control the operating system, start or stop processes, and list or modify files and directories.

Figure 6-1. Linux shell creates an environment to access system interfaces easier.

Depending on the Linux installation, several shells developed for Linux are installed by default. The more popular shells developed for Linux are bash, tcsh, zsh, and pdksh. bash, however, is considered the default shell on Linux.

On HP-UX, the main shells available are bsh, ksh, and csh. Most applications use these shells to source or check environment variables and kick off processes or deamons. In porting projects that involve porting of test harnesses, however, use of scripting becomes more prevalent.

Table 6-11 compares HP-UX and Linux shells.

Table 6-11. HP-UX and Linux Shell Comparison Table

Shell Name

HP-UX Shell Path

Linux Shell Path

Bourne shell


/bin/sh (linked to bash)

Korn shell


/bin/ksh (linked to pdksh)

C shell


/bin/csh (linked to tcsh)

GNU Bourne Again shell[25]



TC shell



Z shell



[25] Installed through the Technical Computing Open Source Product bundle

Porting scripts is not covered in this book, but an excellent reference book about UNIX and Linux shells that can be helpful is UNIX Shells by Example, 4th edition (Prentice Hall, 2005).

UNIX to Linux Porting. A Comprehensive Reference
UNIX to Linux Porting: A Comprehensive Reference
ISBN: 0131871099
EAN: 2147483647
Year: 2004
Pages: 175 © 2008-2017.
If you may any questions please contact us: