Jump to content

How to fix a malformed PATH?


Recommended Posts

My path environment variable reads as follows:

 

PATH=/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin/:/usr/games:/usr/lib/qt3//bin:/home/rvd/bin:/usr/lib/qt3//bin

 

How can I find where the malformed "qt3//bin" is being put in the path? Also, how can I find where the extra qt3 reference is being added to the path?

 

 

[moved from Software by spinynorman]

Link to comment
Share on other sites

Just look at the end of your PATH component. If it is the very same as you posted, you could search your system for the occurence of the string /usr/lib/qt3//bin if you've not been successful using the manual method Steve suggested. In a case like that I'd be using "mc" (being too lazy to memorize the find options :-). Using the search command from the command menu, you can look for every string you like inside all files (which you may need if only the /bin part is added wrongly). Also check "qtconfig" and qt related config files in addition:

 

/etc/profile.d/qtdir3.sh

/etc/qtrc

 

HTH,

 

scoonma

Link to comment
Share on other sites

Steve Scrimpshire:

I looked in /etc/bashrc. Nothing there.

 

Don't think I checked ~/.bash_profile, /etc/profile. Will check when I get back home from work.

 

 

scoonma:

I had tried using find in konqueror. It got to a point where it hung and was frozen. Perhaps it hit a file that was in use and was waiting? I had to kill it.

 

 

ramfree17:

I can't imagine that qt3//bin is good syntax. To what directory would it be referring. Are you suggesting that the extra slash is just ignored? Plus, it annoys me when the same path is in there more than once.

Link to comment
Share on other sites

Think I've found the problem in /etc/profile.d/qtdir3.sh The script follows: But which slash is wrong ?? - the one after "qt3" or the one before "bin" ??

 

# Set QTDIR for Bash shell

if [ -z "$QTDIR" ]; then

export QTDIR="/usr/lib/qt3/"

fi

 

PATH=$PATH:$QTDIR/bin

export PATH

 

 

I'm thinking that the slash after "qt3" should be removed.

Edited by RVDowning
Link to comment
Share on other sites

Okay, after editing and rebooting, the PATH var looks better. However, for non-root users the entry /usr/lib/qt3/bin is a double, while for root it looks good. So I presume that path component is set twice: Once systemwide, and once when the user is logging in initially. However, I do not (yet) know which mechanism would cause that behaviour. After all it looks like a small system bug. (A double entry is not elegant, but will probably not hurt anything as long as it contains exactly the same string.)

Link to comment
Share on other sites

ramfree17:

I can't imagine that qt3//bin is good syntax. To what directory would it be referring. Are you suggesting that the extra slash is just ignored? Plus, it annoys me when the same path is in there more than once.

 

it isnt, or it shouldnt be but i think most shells understand redundant file separators like that and interpret them as one. even the windows cmd shell can handle stuff like that. the only issue i was thinking is if you export the path and reused in an older shell not capable of reading duplicated file separators. but how often would that scenarion happen? :)

 

ciao!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...