Skip to content

Instantly share code, notes, and snippets.

@odadoda
Last active August 29, 2015 13:57
Show Gist options
  • Save odadoda/9409284 to your computer and use it in GitHub Desktop.
Save odadoda/9409284 to your computer and use it in GitHub Desktop.
subroutines in bash
# 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