Section 4.5. Porting Shell Scripts to Linux


4.5. Porting Shell Scripts to Linux

Figure 4-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 provides 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 4-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. Chapter 2 contains additional information about Linux shells.

On Solaris, the main shells available are Bourne shell, ksh, csh, tcsh, and bash. Most applications use these shells to source or check environment variables and kick off processes or daemons. In porting projects that involve porting of test harnesses, however, use of scripting becomes more prevalent.

Table 4-8 compares Solaris and Linux shells.

Table 4-8. Solaris and Linux Shell Comparison Table

Shell Name

Solaris Shell Path

Linux Shell Path

Bourne shell

/usr/bin/sh

/bin/sh (linked to bash)

Korn shell

/usr/bin/ksh

/bin/ksh

C shell

/usr/bin/csh

/bin/csh (linked to tcsh)

GNU Bourne Again shell

/usr/bin/bash

/bin/bash

TC shell

/usr/bin/tcsh

/bin/tcsh

Z shell

/usr/bin/zsh

/bin/zsh





UNIX to Linux Porting. A Comprehensive Reference
UNIX to Linux Porting: A Comprehensive Reference
ISBN: 0131871099
EAN: 2147483647
Year: 2004
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net