Shell scripting seems to confuse quite a few people. In concept, it's no different than writing a batch file. In practice, it's merely putting a series of commands into a text file. It can, however, be much more than just a set of commands in a file. A shell script can bring in command-line arguments, just like a regular program. It can request input from a user. It can read from and write to files. Shell scripts can contain complex logic. The limit of what a shell script can do is essentially the limit of the author's imagination and skill.
I've linked to several shell scripting tutorials here. I hope you find them useful.
Hopefully, those four links are enough to get you going. Here are several examples of shell scripts.
- Retire.bash--a shell script which takes a username and removes an account from the system.
- verify.bash--a shell script which does a long listing of a filename, then runs the md5sum program on it to get a checksum. Useful for verifying downloaded CD iso images.
- unix1_grader.awk. Even though this is a big awk command in a text file, it's still a shell script, since the shell is what executes awk. This is the program I use to compute everyone's Unix1 grade.
- slacker.bash. This script runs and tells me who has an account but has never even logged into the system.