Basic bash "library"
- The idea of this is to provide basic convenience settings in a Bash script.
How to use
- Install
src/basic.bashto/path/to/basic.bash. - At the very beginning of a script (after the shebang):
source /path/to/basic.bash || exit 1 - If a script includes (
sources) other libraries, these should be included afterbasic.bash, which will then also apply to those. - The
basic.bashlibrary should not be included in other libraries, except when these are meant as wrappers ofbasic.bash, providing additional functionality.- I.e.,
basic.bashshould not be included more than once (while it should be safe to do so).
- I.e.,
- Alternatively, one could also copy the content of
basic.bashto the top (after the shebang) of a script.
Semantics
- See basic.bash and Error handling.
