bash shell function code example
Example 1: bash function
function hello {
echo Hello
}
hello
function e {
echo $1 # $1 is the first argument
}
e Hello
Example 2: shell function example
#!/bin/sh
# Define your function here
Hello () {
echo "Hello World $1 $2"
}
# Invoke your function
Hello Zara Ali
Example 3: how to make a function in bash
print_something () {
echo Hello I am a function
}