![]() |
Out of Egypt:Halfway to the Promised Land"God is a place you will wait for the rest of your life." |
March 30, 2008
followup: editing the .bash_profile in a visual editor on mac os x
Using vi to edit the .bash_profile is all well and good, but its command structure is a bit inscrutable at first, and easy to get wrong later on. A visual editor might be nice. I recommend my favorite - TextWrangler.
But you have a problem. The .bash_profile is a hidden file. So how do you open it in a visual editor? If we were in Windows, we could use the "Show Hidden Files" option. But on Mac OS X, you have to use some obscure command-line wizardry to do the same thing, and then you might find you're seeing too much. (Macs, for some reason, have tons of hidden files in every directory.)
Fortunately, there's an easier way. The .bash_profile is located in your home directory, so just make sure that you're there (if you're using the default prompt, there should be a tilde before the dollar sign). Then just use ls -a to confirm that there's a .bash_profile there (if not, use touch .bash_profile to create it). Finally type in the following:
open -b com.barebones.textwrangler .bash_profile
Depending on the file permissions set on .bash_profile, you may have to put sudo at the beginning of that command (and then enter your admin (root) password). Otherwise, you should be set.
If you're curious about how I did that, just type man open. After reading about the -b switch, check out this article about application bundles to learn how I figured out what the application code for TextWrangler was.
Posted by donovan at 11:50 PM | Category: Technology
