Bash 09 – Functions

Author:
Source

Sponsored:

Atlas of AI: Power, Politics, and the Planetary Costs of Artificial Intelligence - Audiobook


Uncover the true cost of artificial intelligence.

Listen now, and see the system behind the screens before the future listens to you. = > Atlas of AI $0.00 with trial. Read by Larissa Gallagher


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