Some longer examples
The class accounts have directories with all of the examples from the books by Blinn,
Michael, Rosenblatt, and Taylor. These can also be downloaded (see the References page).
Some of these are linked below (but not included in the printed notes), with additional comments.
Download a compressed tar file of all example scripts used in these notes.
- postprint display, text
A wrapper script for printing a mix of text and postscript files
- checkpath display,
Check all the directories in the
$PATH for possibly conflicting programs.
- run-with-timeout display,
Run a command with a timeout. Kill the command if it hasn't finished when the timeout expires.
- MailPkg display, text
Tar, compress, split and uuendcode a set of files for mailing. (Blinn)
- Ptree (original) display, text
- Ptree (ksh version) display, text
Runs "ps" to get a process listing and then
reformats to show the process family hierarchies. The original example is pure Bourne shell
and inefficient. The ksh version is a fairly simple translation to use ksh internal commands
where possible, and avoid writing scratch files, and runs very much faster. (Blinn).
This entire tutorial was created from individual HTML pages using a content management system written
as ksh scripts (heavily using sed to edit the pages), coordinated by
You can even write an entire web server as a shell script. This one is part of the
(Linux Embedded Appliance Firewall) project. This wouldn't be suitable for much load, but handles occasional queries on
static HTML and CGI scripts.