The local command

Define local variables. 4 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Examples

local filename="$1"

local = only accessible inside function

local content="$2"
local src="$1"
local dest="$2"

Lessons that use local