global and local variables

suggest change

Introduction

By default, every variable in Bash is global to every function in the same shell. A script that is executed (not sourced) does not change variables in the shell that started it.

If you want a variable to be local to a function, use local. That variable is independent of the global scope, and its value is accessible only inside that function.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents