Keep it coming Dave.

I do a lot of bash programming, mostly because I work on the assumption that if I need to type the same complex command-line more than twice it should be a script, to cut down on typing, trying to remember stuff, and to cut down on errors.

I don't enjoy bash programming very much. Mostly because I hate not being able to use normal language constructs like:

result = function(argumments)

So the more tips and ideas from anybody else who faces the same questions the better