Bash shell-scripting libraries
One of the most powerful aspects of popular high-level languages is the existence of a comprehensive standard library. Unfortunately, the most popular Linux shell, bash, lacks a full-featured library bundled with it. A number of people have written libraries to compensate for this lack, which can make your life infinitely easier if you need to write complex bash scripts. Here are links to all the bash/shell-scripting libraries and collections I’m aware of:
- Marco’s Bash Functions Library (mbfl)
- Bash Shell Function Library (bsfl)
- Bashinator: Bash Shell Script Framework (by our own wschlich)
- shesfw: shell script framework tool
- Wicked Cool Shell Scripts library (from the book)
- UNIX Power Tools library (from the book)
- Portable Shell Programming (from the book)
- Learning the bash shell (from the book)
- Bash Cookbook (from the book)
- Classic Shell Scripting (from the book)
- shunit2: A unit-test framework
- log4sh: A flexible logging framework
- libbash: Enables creation of dynamic-like shared libraries
- bashworks: Framework depending on bash-4 or newer
- bfw: Bash FrameWork (Harvard Neuroinformatics)
- rerun: Turns loose shell scripts into modular automation
It was a real pain to come up with this whole list, so hopefully it’s useful to some of you. In future posts, I’m thinking of reviewing these libraries in more depth and comparing them to equivalent functionality in Python, my other language of choice. My goal is not to have functionality re-implemented in shell script to replace basic tools like head/tail, but instead to discover or create (if necessary) a library using the full suite of standard UNIX tools to provide a fun and convenient experience for shell scripters.
Update (2013/07/08): Added rerun.
Update: Fixed a couple of broken links (bashworks and Portable Shell).