bash-boost is a set of library functions for bash, useful for both scripting and interactive use. It draws inspiration from the Boost C++ libraries.
- Prefer pure-bash solutions
- Don't reimplement existing bash features, complement them
- Functions should have a single purpose, without complicated options
- Avoid cluttering the user's environment
For examples and further details, see CONTRIBUTING.md
bash
version 4.2 or later.
This has only been tested for Linux. YMMV for other platforms.
Download and extract the latest release, then follow the instructions in the Usage section.
Clone this repository and run make
. For manual generation, perl
and pandoc
are required.
Source the bash-boost.sh
script and use bb_load
to load modules and/or packages
source /path/to/bash-boost.sh
bb_load MODULE # e.g. cli
bb_load MODULE/PKG # e.g. cli/arg
Alternatively, you can list modules and packages to load by argument when sourcing bash-boost.sh
:
source /path/to/bash-boost.sh MODULE MODULE/PKG ...
If you want to distribute bash-boost as a single file, you can use bash-boost-portable.sh
and all modules and packages will be available for use. Please use proper attribution if distributing bash-boost. See LICENSE for details.
source /path/to/bash-boost-portable.sh
bash-boost consists of the following modules, each with different packages
- cli - for command-line (script) use
- interactive - for interactive use
- util - general purpose routines
- env - for checking and setting environment variables
- file - file and filesystem related operations
- kwargs - for handling keyword arguments
- list - common list operations
- math - common math operations
- prof - runtime profiling routines
- string - common string operations
- time - common time and date operations
You have the choice of loading an entire module, or select certain packages from them.
See the manual for an exhaustive list of functions defined in each package.
This project follows semantic versioning. Any breaking changes must be made in a new major release. New functions are introduced in minor releases. Patch releases only include fixes to existing functions. No documented feature should be regressed in a minor or patch release.
There are a number of different bash libraries out there, including: