How to modify my .bashrc file?

Hi, I may have asked something similar before, but now I'm ready to explain my problem "more in detail" (hope it makes sense)


I'm trying to install a compiler named HLA and make it work;


after decompressing some files and following some simple instructions these follows:



• Next, (logged in as a plain user rather than root or the super-user), I edited the ".bashrc" file in my home directory ("/home/rhyde" in my particular case, this will probably be different for you). I found the line that defined the "path" variable, it originally looked like this on my system:

PATH=$DBROOT/bin:$DBROOT/pgm:$PATH

I edited this line to add the path to the HLA directory, producing the following:

PATH=$DBROOT/bin:$DBROOT/pgm:/usr/hla:$PATH

Without this modification, *NIX will probably not find HLA when you attempt to execute it unless you type a full path (e.g., "/usr/hla/hla") when running the program. Since this is a pain, you’ll definitely want to add "/usr/hla" to your path. Of course, if you’ve chosen to copy hla and hlaparse to the "/usr/bin" or "/usr/local/bin" directory, chances are good you won’t have to change the path as it already contains these directories.

• Next, I added the following four lines to ".bashrc" (note that *NIX filenames beginning with a period don’t normally show up in directory listings unless you supply the "-a" option to ls):

hlalib=/usr/hla/hlalib export hlalib hlainc=/usr/hla/include export hlainc

These four lines define (and export) environment variables that HLA needs during compilation. Without these environment variables, HLA will probably complain about not being able to find include files, or the linker (ld) will complain about strange undefined symbols when you attempt to compile your programs. Note that this step is optional if you leave the library and include files installed in the /usr/hla directory subtree.

• Optionally, you can add the following two lines to the .bashrc file (but make sure you’ve created the /tmp directory if you do this):

hlatemp=/tmpHLA Reference Manual 5/24/10 Chapter 3

export hlatemp

After saving the ".bashrc" shell, you can tell *NIX to make the changes to the system by using the command:

source .bashrc


The problem is that I don't have any .bashrc in my Users/me/ directory so I guess its the plain bashrc file in /etc ?


except that file looks like:


# System-wide .bashrc file for interactive bash(1) shells.

if [ -z "$PS1" ]; then

return

fi



PS1='\h:\W \u\$ '

# Make bash check its window size after a process completes

shopt -s checkwinsize


and has nothing like


PATH=$DBROOT/bin:$DBROOT/pgm:$PATH


plus, its a readonly file, should I change permissions with chmod and modify it?


Hope somebody can give me some advice...


THANK YOU!


terminal-OTHER, Mac OS X (10.6.7), bash shell

Posted on Jun 9, 2011 3:49 PM

Reply
4 replies

Jun 9, 2011 4:39 PM in response to RogerMx_1

As Linc says, you create it yourself. However, .bashrc is NOT invoked by default when you login, which is why most people make changes to .bash_profile (which you also need to create unless you already did that sometime in the past).


If you are not confortable using a Unix text editor you could try


nano .bash_profile


Or you could use something like TextWrangler (free download) that has the ability to edit hidden files.

Jun 10, 2011 5:25 AM in response to BobHarris

BobHarris wrote:


Or you could use something like TextWrangler (free download) that has the ability to edit hidden files.


With Snow Leopard, you can use TextEdit (in Plain Text Mode ⌘⇧T). In the Open or Save dialog press ⇧⌘. (Shift-Command-Period) to display hidden files and folders. This command is a toggle; hidden files will be displayed as you navigate various directories in the Open or Save dialog.


Tony

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to modify my .bashrc file?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.