Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Enable 'cd' into directory aliases from the Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Enable 'cd' into directory aliases from the Terminal
Authored by: blm on Sep 01, '05 08:51:25PM
add the bash function to your .bashrc (or .bash_profile)

Unless Tiger's bash is different than every other bash I've used, the bit in parens is incorrect. Functions aren't passed to subshells, and .bash_profile isn't run by subshells, only .bashrc is. So if you put the function declaration in your .bash_profile, it won't work, for example, if you drop into a subshell from vi using the :sh command. The function won't be defined, so you'll get the regular old cd.

The hint itself is great, just put it in your .bashrc, not your .bash_profile.

[ Reply to This | # ]