LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setting environment variables (https://www.linuxquestions.org/questions/linux-newbie-8/setting-environment-variables-458848/)

v333k 06-27-2006 02:13 PM

setting environment variables
 
Hi,
I working with Fedora Core 5 and I am trying to install QT.
I have done the installation and the next step is to update my environement variable.

I am using bash.

I looked at the online documentation and they said I need to add to my .profile the following:

PATH=/usr/local/Trolltech/Qt-4.1.4/bin:$PATH
export PATH

I did so by adding it to different places:
1. /etc/profile
2. ~/.bashrc
3. /etc/bash

when I type set, my PATH doesn't append the new string.

What should I do? I am doing exactly as I am reading and it is not working!


v333k

Nylex 06-27-2006 02:20 PM

After you've edited your .bash_profile or .profile, you need to use source, e.g. "source .bash_profile". Either file should be in your home directory, if not there you can create them. If you run set after that, you should see the changes.

Edit: see this post for a reason you should add it to .bash_profile instead of .bashrc.

manishsingh4u 06-27-2006 02:25 PM

Simple add this line at the end of /etc/profile and relogin (Sometimes reboot might be required)
Code:

export PATH=$PATH:/usr/local/Trolltech/Qt-4.1.4/bin
It should work.

Nylex 06-27-2006 03:03 PM

If you use source, you don't have to reboot or login again..

jschiwal 06-27-2006 03:36 PM

The changed path will exist in the shell where you sourced your profile, or ran "bash -l", however it won't change for other shells, such as when you click on an icon for a qt program. You need to log out and log in again to do that.

v333k 06-27-2006 04:15 PM

it works
 
Thanks! The "source" fixed it.

THanks again!

v333k


All times are GMT -5. The time now is 01:46 PM.