add another way to define functions to bash (fix #380)

This commit is contained in:
alexandre medeiros 2013-10-13 00:14:24 -03:00
parent c149c619da
commit 3bfc820721

View File

@ -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