From 08046ad2f2a136435b953034ce32ec7192280b46 Mon Sep 17 00:00:00 2001 From: zleyyij Date: Thu, 30 May 2024 18:34:46 -0600 Subject: [PATCH] vault backup: 2024-05-30 18:34:46 --- IT/Scripting.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |