Bash Tutorial 5: Functions
How to use Functions in Bash Script. Functions are a handy feature to use when your code starts getting a bit large. I cover how to parse variables into the function and how to get a return value (which isn't particularly straight forward in Bash compared to other programming languages).
In this tutorial I show how:
0:34 Create a Basic Function
1:00 Input Variables / Arguments into a Function
2:09 Return a value using error code
4:18 Return a value using a global variable
Bash Tutorial Playlist: http://www.youtube.com/playlist?list=PLzZ0JczEkZfkvvycruN04zx6NmYYaavQI
Bash Tutorial 4: Loops - For While Until - http://youtu.be/sCmqBkz1yYY
Script Download: https://raw.githubusercontent.com/quidsup/bash-tutorials/master/5-Functions.sh
Wallpaper: http://imgur.com/sGe6tWp