mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 10:01:38 +00:00
Merge pull request #385 from alemedeiros/master
[bash/en] add another way to define functions to bash (fix #380)
This commit is contained in:
commit
894892a594
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user