Thursday, January 14, 2010

Making your Bash scripts look a little better

One thing I have noticed about this blog is that shell scripts are _very_ difficult to make look nice.  I am not sure if that is a Blogger problem, or an issue with this template.  Either way, I don't like mucking around with the way things look.  I want to get my ideas down and not have to be constantly tweaking the text formatting.

Anyway, after monkeying around for a while with the shell script on the previous post, I decided to search for a script beautifier, along the lines of GNU indent, but for shell scripts.  Eventually, I came across a ruby script, written by Paul Lutus, and aptly named Bash Script Beautifier.  So far, it has worked very well for me.

As always, utilities such as this one may not work exactly the way you want.  You would do well to make a backup copy of your script before you run it through the beautifier.  Also, be sure to read the documentation on the download page.  You can read all about it, and download the script here.

No comments:

Post a Comment