Bash-Completion Mac OS X

Just a quick note on how to turn on Bash-Completion on Mac OS X. Bash-Completion is a set of scripts that is essentially auto-complete on steroids. The benefits of this is that when you go to auto-complete on a make file or ant build file auto-complete will search the build file for the  build targets and list them instead of/ aswell as the files within the cwd. For a while now this has been included by default in most bash setups but not for Mac OS X. To install:

  1. Assuming you have Mac Ports installed:

    $ sudo port install bash-completion

  2. Add the following to your ~/.profile file.

    if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion

  3. Open a new terminal and then enjoy!

One Response to Bash-Completion Mac OS X

  1. Parad0X says:

    Current version of OSX comes with an older version of bash (3.2). bash-completion requires bash 4.1. Check out Step 3:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: