Bash scripting 101:





Bash scripting is a sort of shell scripting(bash=Bourne Again SHell). Most of my bash scripts are in reality sh scripts. I stick to using bash for them all usually though, in case i use something bash specific.

i will do some "out there" solutions sometimes, like much of the introduction page before we get into using text editors, these aren't something one has to know, but they can be handy to look at and try to figure out why they work as they do. So what IS a bash/sh script? well, in *nix (generic name for linux and unix'es (yes this kinda includes solaris, freebsd, openbsd, netbsd and so forth)) you can link commands and pipe them (i'll get to that), you can redirect input and output and use variables, even "subroutines" of sorts.

A shell script is pretty much a canned version of such a long command, or a combination of long such commands or short ones. a shell script can be a complex program or a small "thing" that doesn't do too much.

it's simply a way of simplifying life at the command prompt, if it's too advanced for alias to handle it, and too long for you to want to type it on the commandprompt, yet you need it often..then a shell script is a good solution.







LINKS
Steve's bash tutorial
shelldorado
ooblick



w0nderer