Local Variables and Getting a Value Back

local keeps a function's variables to itself, so it can't change the script's by accident; a function hands back a result by printing it with echo, which the caller catches with $( ), and answers yes or no with return, which if can test.

Updated

Cheat sheet for the lesson Local Variables and Getting a Value Back: local keeps a function's variables to itself, so it can't change the script's by accident; a function hands back a result by printing it with echo, which the caller catches with $( ), and answers yes or no with return, which if…
Category
Bash
Level
Journeyman
Tags
command-substitution, exit-code, global-variable, linux, local-variable, return, unix