Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to add my Qt4.3 directory to my PATH, but I'm getting wierd results. I tried setting the two files:
Edited /etc/profile to:
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/Qt4.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH=/usr/local/Qt4.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
fi
.bashrc and .bash_profile are hidden files in the users home directory. /etc would have bash_profile and bashrc (bash.bashrc on some distros).
Quote:
# PATH="/usr/local/Qt4.3/bin:"$PATH
This is stated incorrectly. It should be '# PATH=$PATH:/usr/local/Qt4.3/bin'. Then remove the comment tag (#) and the double quotes. For more information on the issue of quotes (single and double) see the bash man pages.
The first version above leaves PATH with just one folder: /usr/local/Qt4.3/bin, assuming the double quotes haven't caused problems.
The second version assigns PATH the current value of PATH plus /usr/local/Qt4.3/bin
Last edited by bigrigdriver; 09-18-2007 at 12:11 PM.
Yes I know the hash symbol is a comment, I've altered the file a bit since it didn't work just to see if it made any difference.
I tried with and without quotes, also just to see if it made a difference, but the quotes didn't seem to cause any problem.
This is what my first attempt looked like:
# /etc/.profile
if [ "`id -u`" -eq 0 ]; then
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
else
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
fi
# if ... fi prompt stuff
PATH=/usr/local/Qt4.3/bin:$PATH
export PATH
umask 022
# eof
But the point is when I type echo $PATH on the command line, it looks like:
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
There's no X11 in my profile (!?) which led me to think that the path is being set from another script elsewhere...but where ??
I did a grep on X11, looked in home and /etc directories, only file that contains it is /etc/.login.defs (see my first post) but changing this file sort-of worked, if I was super user, path had Qt in there, but not as normal user...can't figure this out !
Then perhaps a different search query is called for in your case. Try find /etc -type f | xargs grep 'PATH' to find all references in /etc for PATH. Then track then down one by one until you find the offending case.
Maybe, the best place to define PATH is an entry in /etc/profile.d directory. Look at the other files there: you can put a similar script named qt4.sh. On my OpenSuse box I installed the Qt development package (headers and libraries) and it put qt3.sh and qt3.csh in /etc/profile.d automatically. If you have installed from source, you may have a look in the directory where you compiled and look if these scripts have been created for you. Cheers!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.