Understanding scripting
A shell script is a simple text file filled with commands. Unlike compiled programs, shell scripts are not evaluated before execution, but rather while they are being executed. This makes for a very quick development process – there’s no compilation at all. But at the same time, the execution is a bit slower. Also, the errors that the compiler would have caught surface during execution and can often lead to script exiting.
On the upside, there’s not much to learn when you are writing a script – much less than when you are writing a program in C or Python. Interacting with system commands is as simple as just typing their names.
Bash lacks a lot of sophistication in programming languages: there are not many data types and structures, there’s very rudimentary control of scope, and the memory implementation is not meant to be efficient with scale.
There’s not one good rule of thumb for choosing when to write a...