How to Restrict Variable and Function Scope in Bash Scripts