Functions group commands: name() { ...; } or function name { ...; }. return sets the exit status (0–255); use echo or printf to send data back — not return for strings. Local variables inside functions avoid polluting global scope.
Examples
Functions group commands: name() { ...; } or function name { ...; }. return sets the exit status (0–255); use echo or printf to send data back — not return for strings. Local variables inside functions avoid polluting global scope.