Summary

In this chapter, you learned how to use functions in shell scripts. Some of the important topics you learned about are

  • Creating functions

  • Invoking functions

  • Using variable scope

  • Function chaining and recursion

  • Return codes from functions

  • Data sharing between functions

In Chapter 21, “Problem Solving with Functions,” you will revisit functions and learn how to create a set of functions that can be used in multiple scripts. In the next chapter, you will explore the topic of text filtering.

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.