From 3bfc820721618af1c1421e2858198bbc739ec70a Mon Sep 17 00:00:00 2001 From: alexandre medeiros Date: Sun, 13 Oct 2013 00:14:24 -0300 Subject: [PATCH] add another way to define functions to bash (fix #380) --- bash.html.markdown | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bash.html.markdown b/bash.html.markdown index 276bc31f..d208b957 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -117,7 +117,7 @@ done # You can also define functions # Definition: -foo () +function foo () { echo "Arguments work just like script arguments: $@" echo "And: $1 $2..." @@ -125,6 +125,13 @@ foo () return 0 } +# or simply +bar () +{ + echo "Another way to declare functions!" + return 0 +} + # Calling your function foo "My name is" $NAME