Bash Scripting - Functions
You want to write a Bash function that increments a counter variable without affecting the global variable of the same name. Which approach correctly uses
local to achieve this?local to achieve this?local counter inside the function creates a separate variable that does not affect the global one.export shares variables with child processes; declaring local outside function is invalid.local counter inside the function and increment it there. -> Option B15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions