local Variables
local limits a variable to the function. Without it variables are global.
Example
x=global
f() { local x=inner; echo "in: $x"; }
f
echo "out: $x"Result
in: inner out: global
Exercise
Function only variable.
x=1Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.