How to use functions in a BASH shell script

- by

BASH can deal with simple functions, and they are defined like this:

# this defines the function
function testing {
    echo "Hi there!"
}

# this calls our function
testing

As far as I know, BASH functions cannot take or return parameters.



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.