make function in bash code example
Example 1: bash function
function hello {
echo Hello
}
hello
function e {
echo $1 # $1 is the first argument
}
e Hello
Example 2: function in bash
#FIRST METHOD
Hello () {
echo 'Hello Wordl'
}
Hello
#SECOND METHOD
function Hello {
echo 'Hello Wordl'
}
Hello
Example 3: how to make a function in bash
print_something () {
echo Hello I am a function
}
Example 4: how to make a function in bash
function_name () {
<commands>
}