My new 564-page book, Shell Scripting, published by Wiley, is on sale now. Please click "Like" on the left if you are on Facebook, or just click here to get the book.
Various examples of shell scripts. For the full list of scripts, click here.

getcluster - GetCluster

determine what installation cluster(s) are required to get a given package to be installed on Sun Solaris.
(here's a sample clustertoc file to get it working; it looks for Solaris install media in /cdrom/cdrom0, /cdrom, /mnt after checking the current directory).
README

MPG - Miles Per Gallon

A sample script which converts $X miles for $Y litres into $Z MPG

BCD - Binary Coded Decimal

This was requested by a reader, so here's a sample script to do BCD.

check_dups

Check for Duplicate Files.
There are a number of things you can do with this - the bravest is to pick one to delete; the most sensible is to list duplicates, so that the user can use that information according to their wishes.

mkkernel

I wrote various stuff for DRS/NX, which taught me a lot about shell scripting - here they are, in all their ugly glory...
intel | notes | updated (a partially updated version, which I must actually complete - fixing the errors, noting why certain things in the original were bad, and how the can be done better) | readme | sparc

Getopt

- How to use getopt in a shell script.

ppp-test

This was written for my speedtouchconf.sourceforge.net project - a way of testing if a PPP (or any other) link is active.

rterm

Remote Terminal. Rterm is a simple utility to log into boxes. The EMULATOR variable should point to something which takes xterm-style parameters, namely "-T" for the window title, and "-e" for a command to execute. Personally, I use kvt. You can hardcode your fave machine into the code, so "rterm" by itself will go into that box, or "rterm host" will connect to host. "rterm host user" will connect to host host as user user.

title

Set the title of an xterm (works on konsole, gnome-terminal, etc) via ANSI codes.

Simple Network Analysis Tool

Here is a tool I wrote a while ago, not yet documented.

trasher

A simple script to trash file contents. Not exactly secure, but makes a decent attempt. Read the disclaimers in the script itself.

IPTCFG

That's all the documentation you get for iptcfg...

Tutorial Scripts

Various scripts related to the Shell Scripting Tutorial are available here and here.

Stolen Scripts

ocl.ksh

Written by Liam Crilly, who I went to college with. We had a challenge to write a "rough time" script... Liam's was far better than mine :-)

rlogout

Also written by Liam, and taken for posterity.
My new 564-page book, Shell Scripting, published by Wiley, is on sale now. Please click "Like" on the left if you are on Facebook, or just click here to get the book.
Steve's Bourne / Bash shell scripting tutorial
Share on Twitter Share on Facebook Share on LinkedIn Share on Identi.ca Share on StumbleUpon

Want to take the tutorial with you?

My Shell Scripting Book:
    Shell Scripting, Expert Recipes for Linux, Bash and more
is available online and from all good booksellers.

Buy my 600-page Shell Scripting Book...

From Amazon USA:

From Amazon UK:

For Kindle:

Or From other retailers

You can also find the book, and join a shell scripting community, on Facebook:


Option Two: Buy the 70-page PDF (£4.99/$9.99/€6.99)
(Free Sample)

And you can always Download my Free Shell Scripting Cheatsheet PDF