diff --git a/IT/Scripting.md b/IT/Scripting.md index 2b245fc..a0de1f1 100644 --- a/IT/Scripting.md +++ b/IT/Scripting.md @@ -119,13 +119,16 @@ To execute a function, simply include the name of the function. To execute the a function_name ``` -To declare a local variable in a function, prefix the declaration with the `local` keyword. +By default, all variables in bash are global. To declare a local variable in a function, prefix the declaration with the `local` keyword. ```bash function_name () { - + local A='A' + echo `A` } ``` +To return a value from a function, use the `retu` + ## Commands | Command | Description | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |