Overview - Function libraries (sourcing scripts)
What is it?
Function libraries in bash scripting are files that contain reusable functions. Instead of writing the same code repeatedly, you keep these functions in a separate script file. You then 'source' this file in your main script to use those functions. This helps keep your scripts clean and organized.
Why it matters
Without function libraries, scripts become long and repetitive, making them hard to read and maintain. If you want to fix a bug or add a feature, you’d have to change many scripts separately. Function libraries let you write code once and reuse it everywhere, saving time and reducing errors.
Where it fits
Before learning function libraries, you should know basic bash scripting and how to write functions. After this, you can learn about script modularization, advanced script debugging, and automation workflows that use multiple scripts working together.