Quote:
"Does anybody have some tips on understanding and mapping out the logic and flow of scripts"
First, you're rambling; get some sleep (if you can after 3 pots of coffee).
Second, "scripts" are usually executed in order the lines appear in the program, with the exception of things like loops. SH and derivatives (bash, zsh) handle functions, and these functions need to be defined before they are invoked. Other than that, it's pretty straight-forward.
*Sigh* then again, I've been coding since I was 10.
Third: You
must understand Binary Logic (aka, Boolean Logic). The keys are understanding the basic operators: OR, AND, NOT. If you don't understand these correctly, you'll have a hard time. In most modern languages, including shell scripting, perl, and C, the
operands can be
expressions which means in the case of shell scripting, a program that returns an exit code.
So fourth, you have to understand that programs return exit codes. If the exit code is numerically 0, that means
true. (0 for true is known sometimes as "negative logic").
If you are visually oriented,
this tutorial might help.
I googled around and found this video which might help:
YouTube - Prelude to Computer Science - 6: Binary Logic and
YouTube - Prelude to Computer Science - 7: Logic Gates