Striving for greatness

Thoughts on emerging tech, open source, and life

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


Written by Donnie Berkholz

April 7, 2011 at 10:59 pm

Posted in Blog

Tagged with ,

13 Responses

Subscribe to comments with RSS.

  1. I’m maintaining libui-sh, I UI-abstraction framework for bash (supporting both cli and ncurses through dialog)


    April 8, 2011 at 2:54 am

  2. A full featured standard library could probably come out of portage.


    April 8, 2011 at 4:07 am

  3. Although its not a bash framework, I have created a modular bash script called monkey tail which can merge and unmerge code into itself.

    Lucas Martin-King

    April 8, 2011 at 9:08 am

  4. Dude would be nice to have a comparison among those! 😀


    April 8, 2011 at 9:56 am

  5. Pretty awsome list! Thanks for sharing it! +1 on some description/comparison of the libraries.


    April 9, 2011 at 4:13 am

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


    April 9, 2011 at 4:43 pm

  7. […] Bash shell-scripting libraries […]

  8. Friend of mine did this:

    mainly object oriented string operations, java-python style


    April 11, 2011 at 6:39 am

  9. Thanks for this list! I’m a big fan of using shell functions myself, that’s why I wrote app-shells/prll. It’s meant to parallelize shell functions.


    April 14, 2011 at 1:08 pm

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


    April 29, 2011 at 10:02 am

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


    Mikel King

    May 27, 2011 at 12:35 pm

  12. […] Bash shell-scripting libraries ” Striving for greatness ( […]

Comments are closed.

%d bloggers like this: