Understanding Functions
Functions are an important component of pretty much every modern programming language. They’re simply blocks of code that each perform one specific task. The cool thing about them is that they allow programmers to reuse code. That is, one block of code can be called either from within a program in various places, or it can be called by various different programs from function libraries. In this chapter, I’ll show you the basics about using functions in shell scripts.
Topics in this chapter include:
- Introduction to functions
- Defining a function
- Using functions in shell scripts
- Creating function libraries
- Looking at some real-world examples
If you’re ready, let’s get started.