One Script, Several Files: source
A library is a file of functions that several scripts share: each script loads it with source, and finds it from any folder with here=$(dirname "${BASH_SOURCE[0]}"), the folder the script itself is saved in.
Updated
![Cheat sheet for the lesson One Script, Several Files: source: A library is a file of functions that several scripts share: each script loads it with source, and finds it from any folder with here=$(dirname "${BASH_SOURCE[0]}"), the folder the script itself is saved in.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/5ba0fb2194374b2ab665173959f8dd38.webp)
- Category
- Bash
- Level
- Journeyman
- Tags
- <source>, bash-source, dirname, library, linux, shell-function, unix