Shell script

The educational technology and digital learning wiki
Revision as of 12:55, 3 August 2007 by Daniel K. Schneider (talk | contribs) (using an external editor)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Draft

Definition

A shell program executes commands that a user directly types or that are read from a file (the shell script).

An educational technologist should know some shell scripting for the following reasons:

  1. Often, educational software is programmed in java. When these programs are distributed as *.jar files they may not launch properly (even on Windows) and you will have to write a shell script.
  2. Some tools that may be useful (e.g. the most powerful XSLT processors) also may need a script to be launched.
  3. To deploy Internet Software it is better to use a linux system (it's cheaper and slightly safer than windows). To do so, you need a lit bit of scripting knowledge.

Overview of Shell Scripts

The following definitions are based on Garrels' and various articles from Wikipedia.

sh or Bourne Shell

The (almost) original shell still used on UNIX systems and in UNIX-related environments. This is the basic shell, a small program with few features. While this is not the standard shell, it is still available on every Linux system for compatibility with UNIX programs.

ksh or the Korn shell

The Korn shell (ksh) is a Unix shell which was developed by David Korn (AT&T Bell Laboratories) in the early 1980s. A superset of the Bourne shell and upwards compatible with the Bourneshell.

bash or Bourne Again shell

Bash is the default shell on most Linux systems as well as on Mac OS X and it can be run on most Unix-like operating systems. The Bash command syntax is a superset of the Bourne shell command syntax. The vast majority of Bourne shell scripts can be executed by Bash without modification. Commands that work in sh, also work in bash. However, the reverse is not always the case.

Bash is the default shell on most Linux systems as well as on Mac OS X and it can be run on most Unix-like operating systems. The Bash command syntax is a superset of the Bourne shell command syntax. The vast majority of Bourne shell scripts can be executed by Bash without modification,

csh or C shell

The C shell (csh) is a Unix shell developed by Bill Joy for the BSD Unix system. The syntax of this shell resembles that of the C programming language and therefore popular with C programmers. Today, mostly replaced by tsch.

tcsh or Turbo C shell

A superset of the common C shell, enhancing user-friendliness and speed.

What shells do you have

On a linux system type:

cat /etc/shells

On Windows XP:

  • Usually you only have cmd.exe
  • Some people however, install

Unix CSH

MS Windows

Links

Overviews

Introductions, comparisons
Various Flavors
  • Bourne shell (Wikipedia)
  • Bash (Wikipedia). The default Linux / MacOS X shell.
  • cmd.exe (Wikipedia). The Windows shell.

Resource sites

Tutorials

Bash