The Prodigal Son

About 10 years ago I got into K shell scripting in a big way (for a beginner). I absolutely loved it and wrote a number of database maintenance scripts that, while basic, worked extremely well.

Somehow, somewhere I picked up the style of scripting that was very similar to when I was doing Cobol programming, a central "command center" type structure (that was usually at the bottom of the script), that would direct the code to, for example, run section/paragraph/function (whatever the proper name is) 1, return to the command center, then run 2 etc. I saved off my scripts on a CD and they were lost in a move.

I spent the next 10 years in a position that did not involve scripting and I lost/forgot much of what I knew. Now I am again in a scripting position. I'd love to work on being able to recreate some of those type scripts but I haven't been able to find any source on the web or elsewhere that would detail that type scripting.

Can anyone point me to a source, book, web site etc that would enable me to get back to that type of scripting by function/module etc?

Many thanks.

I'm new to Unix. Which books should I read? - The UNIX and Linux Forums

Thanks but I have many of those. That's not what I am asking. I am asking about a source thats specific to scripting by functions. The same sort of scripting/programming that can is typically done in Cobol. Most scripting books I've seen are strictly sequentia/procedurall reading from top down.
Thanks again.

Do you mean something like the following?

function get_input
{
 # blah blah
}
function process_data
{
 # blah blah
}
function print_output
{
  # blah blah
}
# main
get_input
process_data
if [ $? -eq 0 ]
then
  print_output
fi

Roger that:)