LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-25-2006, 05:13 PM   #1
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Rep: Reputation: 15
Can't add directory to the PATH


Hey all,

If I do the following:

Quote:
export PATH="$PATH:/usr/lib/qt-3.3/bin"
The entry is only in the PATH for the current session. If I reboot qt-3.3 directory is missing from the PATH's.

Tried editing the /etc/profile.d file directly, but it does not contain the colon separated list of directories that I expected to find there.

I'm using Fedora Core 4.
 
Old 07-25-2006, 05:18 PM   #2
spirit receiver
Member
 
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
Put that line into ~/.bash_profile. (I hope that's the right file for Red Hat, it might also be ~/.profile)
 
Old 07-25-2006, 05:46 PM   #3
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Original Poster
Rep: Reputation: 15
Spirit,

Aaaaah that's much better.

For the sake of knowledge -- could I have done something the following?

Quote:
export PATH= place the current colon separarted list here:usr/lib/qt-3.3/bin
It was .bash_profile in case you were curious. Linux folks usually are -- that's how we got into this mess

Thanks.
 
Old 07-25-2006, 05:54 PM   #4
spirit receiver
Member
 
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
Quote:
Originally Posted by hpladd
could I have done something the following?
You could, but it makes sense to have some system wide default content of the PATH variable (coming from /etc/profile for example) and add some custom settings on a per user basis as explained here.

Edit: Although the system wide settings would probably seem appropriate for Qt binaries. There might be some extra file for customized system wide settings, I don't know which file that is in Red Hat. Here it's /etc/profile.local, but then SUSE also uses ~/.profile instead of ~/.bash_profile, maybe someone else can help.

Last edited by spirit receiver; 07-25-2006 at 06:02 PM.
 
Old 07-25-2006, 05:55 PM   #5
zytsef
Member
 
Registered: Apr 2006
Location: Vancouver, Canada
Distribution: Slackware, Ubuntu
Posts: 168

Rep: Reputation: 30
Putting the same thing in ~/.bashrc ought to do the trick for non-login shells, if you need such a thing.
 
Old 07-25-2006, 06:17 PM   #6
spirit receiver
Member
 
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
zytsef, .profile is the better place for this as you don't want it to be executed each time a subshell is spawned. Have a look at the following, here I added the line "export a=$a:Oops" to ~/.bashrc
Code:
ada@barnabas:~> echo $a
Default
ada@barnabas:~> bash
ada@barnabas:~> echo $a
Default:Oops
ada@barnabas:~> bash
ada@barnabas:~> echo $a
Default:Oops:Oops
This won't happen with .profile, and note that an interactive shell will inherit its environment from a login shell anyway.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
add to path towel401 Linux - Newbie 3 07-23-2006 11:38 PM
Add path to @INC deus1 Linux - Software 0 07-27-2005 08:52 AM
How to rsynce the actual directory path instead of just the directory at the end of Niceman2005 Linux - General 5 04-08-2005 08:58 PM
I need to add a directory to the search path johnjafa Linux - Software 1 01-06-2005 02:43 PM
How to add a directory to PATH permantely paulmedic555 SUSE / openSUSE 1 11-12-2004 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration