Bash 09 – Functions

Author:
Source

We have covered all of Bash, except for Functions. Functions can be very helpful for a script.

If you have any programming experience, then you should already have an understanding of the Function. A Function is a set of commands that you utilize multiple times. We can set the Function up one time and called as many times as we need.

Structure

Each script can have multiple Functions, but we must lay them out as one of the following:

function_name() {
command1

https://www.linux.org/threads/bash-09-–-functions.41374/

Read more