function on a bash script code example
Example 1: bash function
function hello {
echo Hello
}
hello
function e {
echo $1 # $1 is the first argument
}
e Hello
Example 2: how to make a function in bash
function_name () {
<commands>
}
function hello {
echo Hello
}
hello
function e {
echo $1 # $1 is the first argument
}
e Hello
function_name () {
<commands>
}