Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
How do I set a user environment variable? (permanently, not session)

So each time I log on I want to execute a command like export PATH=~/gcc-4.5.0-g/bin:$PATH. I have no sudo rights. So how to make a .sh execute each time I log in?

share|improve this question

marked as duplicate by Mat, jasonwryan, Renan, Gilles, warl0ck Oct 8 '12 at 1:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Place it in your .profile –  Marco Oct 7 '12 at 16:08
    
What does it have to do with sudo? –  warl0ck Oct 8 '12 at 1:09

2 Answers 2

up vote 2 down vote accepted

You can do it in the .profile, .bashrc or .bash_profile files located in your home directory.

share|improve this answer

A nice approach is create a $HOME/bin directory that contains links to yours executables files:

mkdir $HOME/bin
ln -s $HOME/gcc-4.5.0-g/bin/gcc $HOME/bin/gcc
ln -s $HOME/project-Y/bin/py $HOME/bin/py

Now you can export only the main bin directory instead of each each small one. Use .profile, .bashrc or .bash_profile files located in your home to put export PATH=$HOME/bin:$PATH.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.