Disclaimer

[Ouch]

No Warranty

These programs are distributed with the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A...

Oh, you know the rest.

I would like to be better at this, wish my left-brain was a little more intact. But I'm really more of an intuitive person, so the best you can hope for here is an artist's rendition of good coding... In broad strokes.

I seem to fit the 1973 definition of a hacker, so you can expect plenty of `good enough', but incomplete answers to various problems here. On the other hand, I might come up with a few questions you'd never think to ask.

If you're smarter than I am [at least in some ways] and if they give you ideas, you might want to improve on some of them. If so, and if you do, I'd like to hear about it. If you have any trouble running them, please and I'll see what I can do about it.

I've tried to avoid GNU extensions to common Unix utilities, but can't promise that I've succeeded. But I've done what I can, which includes testing each of these scripts against three shells;
/bin/dash
/bin/posh and
/bin/bash --posix
the same way you're supposed to test web pages in two or more browsers. May be overkill, but I'm pretty sure it's dead, whatever it is. Let me know if you have any trouble.

All of the scripts on this site have a `.txt' suffix added, and have their execution permissions turned off. As you might have guessed I'm no expert, so you probably should read these things before running them. If you don't know how to read them, perhaps you shouldn't run them either, or try to learn from them [much better to learn this stuff from a book]. 50webs' FTP servers don't support the CHMOD command anyway, but it is a good idea, and I'd probably keep doing that if/when the site moves to another host.


Gripe:

There are a lot of programs around that like to call themselves /bin/sh . Linux generally has a /bin/sh of some sort hanging around so old scripts will run, and simple ones will run fast. On Ubuntu and its variants, /bin/sh is really a symlink to /bin/dash , which does work pretty well. On some others, it's just a symlink to /bin/bash [Aha! On Xandros Linux, it is. Should explain some of the weird behaviour, below].

But although dash claims to be POSIX compliant, I can't be sure that any of my scripts really are. [See warning, on the `Policy-compliant Ordinary SHell' package info page.] And then there's the external programs they use...

I've noticed slightly different behaviour, running the same script on Xubuntu 6.10 [my main system] and the Xandros Linux that ships with the Asus EEE. The visible difference was tiny; an `echo "\n"' produces a literal `\n' in Xandros, instead of a newline, but it did give me cause to pause and ponder. What else was it doing differently? How many Bash extensions were supported, without anyone telling me they're non-standard extensions?

So learning to script was like reading a book about web standards, enjoying it, then looking at the fine print on the back only to find that it's © 2007 Microsoft™, Best Viewed with Internet Explorer 6 or higher.

Damn.

Well at least I tried.

-- pAb


Up to Main Index