Capital City Christian Church
Introduction to Bash
This page will not get into the specifics of coding Bash script but will provide information about why and how we use Bash at CapCity.
For the details of coding in Bash and examples see The Bash Notes page.
I do want to clarify what I mean by Bash Scripts.
Generically, scripts are a type of programming language in which the source code (the stuff the programmer types) is stored in normal ASCII text files.
They are Operating System specific in that scripts coded for Window do not usually run on Linux and visa versa.
In Windows they are called Batch Files. They usually invoke the cmd.exe terminal interrupter, and the file name ends with .cmd
In Linux they are call Bash Scripts or Shell Scripts. I will try to use Shell Script from here on for clarity.
Bash is the "Born Again SHell". It is the interpreted used in the common Linux terminal. There are several other such interpreters that have different strengths and weaknesses. For our purposes this documentation, examples, and so on will assume you are using the Bash interpreter.
When you are at a terminal you basically type in text commands with parameters to execute other programs that produce output or perform a process. Well a shell script is simply a file that contains those sames commands and parameters along with some basic logic which allows you to develop a huge varity of scripts.
One of the main uses of shell scripts, and which CapCity primarily uses them, is to automate routine tasks, and produce text based reports.
As introducint Shell Scripting to CapCity begins, here are some examples of the possible uses of shell scripts;
One of the obvious benefits to shell scripts is that you can wrap long and complicated routines into a script and then invoke it all with a single command. This helps protect against typos and typing tedium.
When I arrived at CapCity (~2016) there was no in-house programming being done. That was understandable since so few in the church had that skill and the time to develop, train, and maintaine code. There was also no obvious need for it.
For the first four years I did not introduce any coding other than a few things that helped me with specific tasks for which there were manual solutions.
My idea was that someday someone(s) would replace me (I am about 66 now) and any of the coding I had typically done was full-stack web application, Perl scripts, and the such. Introducing any of that would require future CapCity techs to learn enough coding to support those apps, and I considered that too much a burden.
But now after four years I have changed my mind a bit.