summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoralexandre medeiros <alexandre.medeiros@students.ic.unicamp.br>2013-10-13 00:14:24 -0300
committeralexandre medeiros <alexandre.medeiros@students.ic.unicamp.br>2013-10-13 00:17:27 -0300
commit3bfc820721618af1c1421e2858198bbc739ec70a (patch)
treeea851e5d8b944c1127a4ac8fbcf7c38f392bc4bd
parentc149c619da0f258c55bfb355e9d9e3b02dc880c2 (diff)
add another way to define functions to bash (fix #380)
-rw-r--r--bash.html.markdown9
1 files changed, 8 insertions, 1 deletions
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