tail -f findings.out

« How to completely reset an Apache instance in Ubuntu

Python Programming: An Introduction to Computer Science »

vim for Bash scripting: A happier union

Two factors recently caused me to look less than positively toward writing Bash scripts. First, I have started actively using Python more, and performing tasks in it that I would have previously written in Bash. Second, I came across a number of Python-specific, and more general purpose programming related, improvements to my vim experience. Relatively, writting Bash scripts just got worse.

Luckily, another awesome post at The Geek Stuff shook me from my unproductive stupor. After installing the bash-Support plugin the post describes how to install and use, Bash scripting is easier and slightly more pleasurable.

  • The first handy feature to notice is that any new file ending in .sh will include a header with things like name, purpose, etc. By customizing its template, you can create consistent, helpful headers for all your new scripts.
  • The trigger completion ability to quickly create functions and other bash constructs is something I had gotten quite accustomed to when writing Python, so it’s good to have that in place.
  • Another essential addition is the built-in help. Simply place your cursor over a Bash built-in command you need information on and press “Leader (default ‘\’) hh”. A window will open with man-page assistance.
  • Quick formatted comments, custom snippets and more make bash-Support simply essential for writing Bash scripts.

There are definitely cases where a programming task can be more quickly accomplished in a Bash script as compared to one written in Python. It takes a certain length of code or task for the increased (and welcome) verbosity of Python to be “worth it”. But don’t languish when those times arise, try out the bash-Support plugin!

Share and Enjoy:
  • email
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • Technorati
  • Netvibes

Post to Twitter Post to Delicious Post to Digg Post to Reddit

Possibly Related (no promises):

  1. Useful Bash functions to determine OS and more
  2. A better way to search for methods of Python objects
  3. More efficient HTML editing in vim
  4. Send events to Zenoss from scripts
  5. Useful ways to list directory contents

Related posts brought to you by Yet Another Related Posts Plugin.

Tags: , , , ,
March 1, 2009 - 9:23 PM
Leave a reply

Subscribe without commenting

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.