Back to Browse

Bash Tutorial 5: Functions

22.1K views
Jun 2, 2013
5:05

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

Download

1 formats

Video Formats

360pmp48.0 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Bash Tutorial 5: Functions | NatokHD