Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.