Creating a Library

Now that you have learned the basics about creating and using a library, you can create a library of utility functions designed to facilitate scripting tasks. In this section, you will learn about several of the functions from the library. The “Questions” section at the end of this chapter asks you to develop five additional functions for this library. The entire library, including sample implementations of the functions you will be asked to develop, is listed in Appendix D,“Shell Function Library.”

Naming the Library

For the purposes of this discussion, assume that the library is located in the file $HOME/lib/sh/libTYSP2.sh. The name of this library was derived as follows:

  • The lib in libTYSP2.sh indicates that this file is ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.