Last active
August 29, 2015 13:57
-
-
Save odadoda/9409284 to your computer and use it in GitHub Desktop.
subroutines in bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# declare a subrutine | |
kewl(){ | |
echo "kewl!"; | |
#access arguments in $1, $2 ... etc | |
echo "$1" | |
# declare a local variable | |
local LOCAL_IN = 1 | |
} | |
# call a subroutine | |
kewl "First argument" "Second argument" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment