UNIX / Linux Shell Scripting Tutorial

Unix / Linux Shell Scripting Tutorial

Steve's Shell Programming Stuff

I intend to dump stuff in here as I come across things which could be at all useful, either in themselves, or as examples of shell code.
Just read them yourself at /code/sh.

One thing I wrote a while ago and try to keep up to date, is a bourne shell programming tutorial, which I kind of like. Give me your comments. steve at steve-parker.org.

I've also got a mirror of Steve Bourne's own guide to the Bourne Shell, which has been converted into HTML by someone at iki.fi. You can find that guide here.

Very simple Miles-Per-Gallon calculator. This doesn't really belong here, as it's written in PHP, but it's a good example of a utility better written in PHP than the Shell.

What we do have here, is some old stuff I wrote years ago when I was working for ICL testing their DRS/NX Unix OS. There are also a few things here written by Liam Crilly, whom I've lost contact with, but wrote some good scripts, a few of which I've still got copies of lying around.

Douglas Dallas also helped with the mkkernel scripts; these are the first "scary" scripts I wrote, in that they automate the mangling of significant kernel-tuning files (quite inefficiently, looking back at them now), but that was a major turning point for me as I saw how effective scripting could be. These particular scripts turned half a day's hard work into a few quick keystrokes. That's what turned me on to scripting as a nice way of doing sysadmin (which I find kind of boring otherwise!)
PS. Also at ICL, I bumped into Malcolm Mladenovic a few times, who inspired me with his depth and breadth of knowledge. Maybe it was my naivete at the time, but he struck me as a genius. Googling for him, it seems he lives at tinc.org.uk; very private man, it seems, but I'd just like to thank him for the inspiration. Of course, he won't remember me, I was just a student on placement.

Other things to note: title.sh puts a title at the top of an xterm, using ANSI codes I ripped off from somewhere, no doubt. And the only recent (as in, from the past five years) thing to date, is rterm, which is another one-liner.

I will get some recent scripts into here as I come across them, honest!

There are quite a few free *nix accounts available, if you look around. Have a look at http://www.ductape.net/~mitja/freeunix.shtml for a list of some.

Suggested books: Recommended Reading
StumbleUponStumbleUpon | del.icio.usdel.icio.us

Site Links



1. Intro
2. Philosophy
3. A First Script
4. Variables - Part I
5. Wildcards
6. Escape Characters
7. Loops
8. Test
9. Case
10. Variables - Part II
11. Variables - Part III
12. External Programs
13. Functions
14. Hints and Tips
15. Quick Reference
16. Interactive
17. Exercises
18. Forum
19. Recommended Books




My blog has tips about how to use Unix and Linux commands XML



contact