Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

starrin

macrumors member
Original poster
Aug 22, 2004
42
0
I am trying to add certain extra directories to my path when I open a Terminal window -- my understanding is that I would put this in my .bashrc file. The problem is that I do not see this file in my home directory---should I?

If I had to create one -- is there an example someone can point me to in order to make it right?

Thanks in advance.
 
You need to create one; here is a dated but still relevant example.

Good luck, and report back if you have any problems!
 
Hi and thank you for your help --

I created a .bashrc file and placed it in my home directory and my settings are not coming through -- here are my settings - again thanks for any input:

# Set JAVA_HOME
export JAVA_HOME=/Library/Java/Home

# Set Classpath
export CLASSPATH=/Users/jason

# Entries for ANT
export ANT_HOME=/Users/jason/Development/SoftwareDownloads/apache-ant-1.6.2
export PATH=$PATH:$ANT_HOME/bin
export CLASSPATH=$CLASSPATH:$ANT_HOME

# Entries for Maven
export PATH=$PATH:/Users/jason/Development/SoftwareDownloads/maven-1.0.2/bin
export MAVEN_HOME=/Users/jason/Development/SoftwareDownloads/maven-1.0.2
 
Hi -- searching other posts I came across that -- but I have no .bash_profile file

I have a .profile file....

Thanks for the help
 
Okay -- I changed the name of my .bashrc file to .bash_profile (and added quotes to my exports) -- it all works

So -- should I keep my .bashrc file and make a .bash_profile file call it with the code above? What does that do for me?


Thanks in advance.
 
Dunno. :confused:

I thought that the profile always called the resource file during login (see here) but I'm not even vaguely a guru in this area.
 
starrin said:
So -- should I keep my .bashrc file and make a .bash_profile file call it with the code above? What does that do for me?

Short answer is: yes, do it. :D

.bash_profile gets called when your shell is a login shell (which, if you're using Terminal, it generally is). However it won't get invoked by non-login shells; but .bashrc will.

This probably won't matter to you in the least. :D But it is more flexible, if sometime in the future you get bored and start playing with bash.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.