This page will have a few hints and, I hope, enough information to get you started. The best thing to do is to try making some simple scripts to get a feel for this kind of work, then look at examples of scripts that do work to get more ideas of what you can do.
I don't pretend to be an expert in unix and/or c. I have done a lot of c programming, but don't do it regularly and need to refresh my memory when things come up that I have not worked on for a while. If you ask a question and I don't know the answer right away, I will find it (or at least help you find it.)
| Function | Bourne | Korn | c |
|---|---|---|---|
| Availability | most | least | Berkeley unix, some System V |
| Variables | local global(export) |
local global(export) |
local (set) global (setenv) |
| Control | if-then-else-fi | if-then-else-fi | if-then-else-end-if |
| Commands | case-esac for-do-done xargs while-do-done until-do-done |
case-esac select for-do-done xargs while-do-done until-do-done |
switch-case-endsw foreach-done repeat while-end |
| Conditional Evaluation | test, expr | direct | direct |
| Interactive | history | history | |
| Aliasing | functions | functions | alias |
| Signals | trap | trap | |
| Efficiency | fast | medium | medium |
The unix man page on the c shell contains a lot of information on commands available in the c shell.
The sed command is the stream editor. It allows modification of a string of text. For example,
sed -e "s/htm/html/g" mypage.html>newpage.htmlsubstitutes html for each htm in the file mypage.html and puts the result into a file named newpage.html. The delimiter / can be changed to any other character you wish. The g indicates global substitution.
Look at the script /cgi-bin/cgi-bin/gentest and /cgi-bin/cgi-bin/gen.pl for fairly simple examples of script files at work.
-------------More later ----------------