LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 11-02-2007, 04:50 AM   #1
ra2000
LQ Newbie
 
Registered: Nov 2006
Posts: 15

Rep: Reputation: 0
setting more than one include location with export


hi
How can i set more than one location for include directory path
With export command
thanks
 
Old 11-02-2007, 08:30 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
What do you mean exactly for "include directory path"? If you have to specify more than one directory in an environment variable, the common way is to separate items with a colon (as for the environment variable PATH). However it depends from which application will try to use that variable and if it can interpret multiple items this way. On the other hand, if you have to specify path to includes when compiling a source code, you can specify multiple -I options, e.g.
Code:
gcc -I/usr/include -I/my/include/dir source_code.c
 
Old 11-02-2007, 08:35 AM   #3
neilengineer
LQ Newbie
 
Registered: Feb 2007
Location: Shanghai, China
Distribution: Fedora&&openSUSE&&Ubuntu
Posts: 13

Rep: Reputation: 0
Suppose you want to add /home into PATH, use:

export PATH=$PATH:/home
 
Old 11-02-2007, 09:10 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
If you were referring to exporting environmental variables e.g. path, you can do
Code:
$export VARIABLE=$VARIABLE:/some/dir:/some/other/dir

Last edited by reddazz; 11-03-2007 at 06:18 AM.
 
Old 11-02-2007, 09:44 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by reddazz View Post
Code:
$export VARIABLE = $VARIABLE:/some/dir:/some/other/dir
This is a typo. I think you mean without spaces around the = sign.
 
Old 11-03-2007, 06:18 AM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
Quote:
Originally Posted by colucix View Post
This is a typo. I think you mean without spaces around the = sign.
Thats correct. Thanks for spotting the error.
 
  


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
Setting Ubuntu include library path cbabbage Linux - Newbie 11 10-21-2007 07:42 PM
Best file location for include files Flip69 Linux - Newbie 2 06-13-2007 11:26 AM
Setting permissions that include sub-directories AlcoholicDoc Linux - Newbie 2 12-19-2005 11:33 AM
Permanently Set a Export Setting (LD_LIBRARY_PATH) nistelrooy Linux - General 1 11-25-2004 12:33 PM
location of kernel /usr/src/linux/include ??????? Lord Lance Mandriva 7 12-13-2003 08:41 AM


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