bash_completion blissness on Mac OS X Leopard

Debian-like bash_completion! I missed you! But no more!

To install it just do:

sudo port install bash-completion
echo "source /opt/local/etc/bash_completion" >> ~/.bash_profile
chmod +x ~/.bash_profile

EDIT: You must have MacPorts installed to run the first command.  Tip from KA, on the commets.

If you don’t know yet what is bash_completion, it is  a feature for shells to autocomplete commands. Example: You are on a git repository. You type git fe and press TAB, bash_completion will fill “fetch” for you. If you have branches, they are autocompleted too. GNU Tar only shows files compatible with the filters you selected. So if you tar xvzf my-softw TAB, it will complete only filenames that are on tar.gz or tgz format and that starts with the string you already typed.

It is heaven again. 😉


~ by Dante Regis on October 27, 2008.

4 Responses to “bash_completion blissness on Mac OS X Leopard”

  1. But you need MacPorts first, right?

  2. That’s right, KA, you need to have MacPorts installed. I think, however, that you can download just the script and use it that way, buy I am not sure.

  3. this is perfect! I never knew about bash-completion. it is perfect for me in conjunction with CDPATH


  4. Hi, i think that i noticed you visited my weblog thus i got here to go back the favor?.I’m attempting to in finding things to improve my web site!I suppose its good enough to use a few of your concepts!!

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: