LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-24-2004, 03:26 AM   #1
gugamare
LQ Newbie
 
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 24

Rep: Reputation: 15
Linux Environment variables


Hello guys,

I'm currently creating an RPM package for a device driver and I 'm having difficulty finding documentation which contains a list of standard Linux environment variables that I can use in the spec file. This presents a problem because I'm currently pointing to specific directories in my box (for example the kernel source path), which will be different depending on what version of the Kernel and etc that the end-user has. Any one know where I can find this stuff?

Also, how does linux handle environment variables? What files do I have to modify to include a directory in the PATH, etc...

Thanks in advance, you guys have always been great.
 
Old 12-24-2004, 04:09 AM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
Most of the variables you would be concerned with would be shell variables. You will find a long list of shell variables in man bash.

Of course each program may have its own set of variables. For instance it's common to have these variables:
JAVA_HOME=/usr/lib/java
KDEDIR=/opt/kde

To modify the path you would do something like this:
export PATH=${PATH}:/MyDirectory
You can change this for all users by putting it in /etc/profile or just a specific user by editing ~/.bashrc
 
Old 12-24-2004, 08:18 AM   #3
gugamare
LQ Newbie
 
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 24

Original Poster
Rep: Reputation: 15
Those are good tips /bin/bash, thanks. But I still can't find a variable or a command to discover the kernel version, or the path to the kernel source of the user.
 
Old 12-24-2004, 10:25 AM   #4
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
uname -r will give you the running kernel version.

for the kernel source, mine's in /usr/src where there's a directory called linux-2.X.XXXX-X. basically look in /usr/src.

the file that i use to add to the path variable is /etc/profile as it allows for the path to be seen globally for all users. after saving changes, you can load those variables with the 'source /etc/profile' command.
 
Old 12-31-2004, 04:27 AM   #5
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
Most config files will set the path to the kernel sources to the default /usr/src/linux, and of course if there are no sources there you get an error. If you put your kernel sources somewhere else just make a symlink /usr/src/linux that points to your sources. e.g.
/usr/src/linux -> /home/user/linux-2.6.10
 
Old 12-31-2004, 11:19 AM   #6
gugamare
LQ Newbie
 
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 24

Original Poster
Rep: Reputation: 15
It works, thanks
 
  


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
Using VBS on Linux to get environment variables squinn Linux - General 1 11-21-2005 11:11 PM
environment variables nasht Linux - General 3 08-11-2005 02:12 PM
Environment variables in linux redhat 9 neerajchaudhari Linux - Newbie 1 07-27-2005 01:27 AM
environment variables aethereal Linux - Newbie 7 12-19-2001 09:34 AM
linux environment variables? doris Linux - General 3 08-04-2001 09:42 AM


All times are GMT -5. The time now is 10:36 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration