LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-27-2007, 01:30 PM   #1
trainee
Member
 
Registered: Dec 2004
Distribution: Slackware
Posts: 142

Rep: Reputation: 16
PATH - what does it mean?


I am installing Qt, and I followed the instruction here.
ftp://ftp.trolltech.com/qt/source/INSTALL
But
when I encounter this instruction, I did not know what does it mean and what to do.
Quote:
In order to use Qt, some environment variables needs to be
extended.

PATH - to locate qmake, moc and other Qt tools

This is done like this:

In .profile (if your shell is bash, ksh, zsh or sh), add the
following lines:

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

In .login (in case your shell is csh or tcsh), add the following line:

setenv PATH /usr/local/Trolltech/Qt-4.1.3/bin:$PATH

If you use a different shell, please modify your environment
variables accordingly.

For compilers that do not support rpath you must also extended the
LD_LIBRARY_PATH environment variable to include
/usr/local/Trolltech/Qt-4.1.3/lib. On Linux with GCC this step
is not needed.
I am using Zenwalk 4.2
As I understand, PATH and LD_LIBRARY_PATH are two environment variable of the system. But I don't know where to locate it. My shell is bash, but I could not find the file .profile (I tried to look for the file .login in the $HOME directory, but I didn't find it either)

Besides, I am installing Qt on a personal machine, and I want every user on that machine to be able to use the lib of Qt, is there any special restriction that I have to follow.
 
Old 01-27-2007, 01:42 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
The PATH is simply a variable which is a colon-delimited list of directory paths to look for binaries to run, so you can type 'foo' at the command prompt rather than, say, '/opt/somebigpackage/bin/foo'.

Typically, you will have a basic PATH set for you at login, usually "/bin:/sbin:/usr/bin/:/usr/sbin". It is up to you as a user to add to this if you want. To add to it, you can follow the instructions you posted above:

Code:
PATH=/usr/local/Trolltech/Qt-4.1.3/bin:$PATH
export PATH
What these two lines do is say: "make my path '/usr/local/Trolltech/Qt-4.1.3/bin' plus my current PATH, then export the results.

I would rather do it as:
Code:
export PATH=$PATH:/usr/local/Trolltech/Qt-4.1.3/bin
Does the same thing, but in one line. Here, I put '/usr/local/Trolltech/Qt-4.1.3/bin' after the current PATH, as the PATH is searched from left to right until it finds a matching name, and presumably you will use the 'normal' unix commands more than the QT stuff. The 'export' is so that the changed PATH will be available to all new terms you open (otherwise the changes will only take effect in the current shell).

To make this change permanent (ie: for all you future logins) you must put it in a file that gets parsed at login such as ~/.profile or ~/.bashrc.
 
Old 01-27-2007, 01:51 PM   #3
trainee
Member
 
Registered: Dec 2004
Distribution: Slackware
Posts: 142

Original Poster
Rep: Reputation: 16
Thank you bulliver.
Besides, if I add that line to the file .bashrc in the directory /etc/skel, does it mean that if I add any user in the future, this user would be able to use the lib for Qt as well.
 
Old 01-27-2007, 01:57 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
Besides, if I add that line to the file .bashrc in the directory /etc/skel, does it mean that if I add any user in the future, this user would be able to use the lib for Qt as well.
Yes. When you create a new user the files in /etc/skel are used as defaults/starting points
 
Old 01-27-2007, 01:58 PM   #5
trainee
Member
 
Registered: Dec 2004
Distribution: Slackware
Posts: 142

Original Poster
Rep: Reputation: 16
Thank you bulliver. That was a lot of help.
 
Old 01-27-2007, 05:23 PM   #6
Prostetnic_Jeltz
Member
 
Registered: Feb 2006
Posts: 66

Rep: Reputation: 16
the command "env" will show you your current path, along with other environment variables

not sure where initial path is set in zen, but iirc the path in slack is set in /etc/profile. obviously you can add to that in .bashrc or whatever. see the "INVOCATION" section of bash man page for more on that.

 
Old 01-27-2007, 05:25 PM   #7
trainee
Member
 
Registered: Dec 2004
Distribution: Slackware
Posts: 142

Original Poster
Rep: Reputation: 16
Thank you, Prostetnic_Jeltz
 
Old 01-27-2007, 09:50 PM   #8
Prostetnic_Jeltz
Member
 
Registered: Feb 2006
Posts: 66

Rep: Reputation: 16
You're welcome
 
  


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
Do you add to the path line or make a new path in /etc/profile? M$ISBS Linux - Newbie 2 12-13-2006 03:14 PM
Image Path reference in Linux (Absolute path) javabuddy Linux - General 7 06-05-2006 08:45 AM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 02:05 PM
Why is the value of $PATH in console mode different from the $PATH in xterm emulator? Akhran Debian 9 03-09-2006 07:10 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 07:10 PM


All times are GMT -5. The time now is 06:47 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