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:

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).

13 thoughts on “Bash shell-scripting libraries

  1. Nice list you made, some I’m familiar with, others are new to me. I’m the person messing around with BSFL. This is still a work in progress and may not serve all needs, but I hope someone may find a use for it.

    BSFL is not for advanced stuff, but provides basic functionality to make your shell scripts more human friendly regarding output (status messages, logging, etc) but it is not limited to this.

    If people have any ideas/suggestions about what they certainly would want from a bash library, please tell me.

  2. Another me too for the comparison.

    Having programmed bash for 20 years now, I _do_ believe that if your bash code becomes too complex and large, its a sign that you should rewrite into another language. Unless bash is written particularly cleanly (“set -e”, only “local” variables, clean STDOUT/STDERR handling, …) it is hard to read and maintain large bash scripts. And they can be slow besides.

    In that way it’s similar to make: if your Makefile becomes too complicated, it’s a sign you are trying to be too complex for the language.

  3. While I generally do agree that overly complex apps should not be written in bash, there are times when this may not be so easily avoidable. Other times things only seem complex. Having library that makes scripting easier is definitely a good thing.

    Consider adding BLIB -> to your list.


Comments are closed.