Bash Tutorial 5: Functions

Channel:
Subscribers:
54,800
Published on ● Video Link: https://www.youtube.com/watch?v=kiEbj_DHB4k



Category:
Tutorial
Duration: 5:06
19,137 views
132


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







Tags:
Linux
Bash
Script
Programming
Guide
Terminal
Basic
Functions
Parse Variables
Return Value
Error Code
Computing
Ubuntu
Mint
Debian
Arch
Fedora
Gentoo
Quids
Quidsup