Solved

Adding variables to Terminal

Posted on 2004-10-21
4
197 Views
Last Modified: 2013-12-06
I have Fedora 2 and am using the default terminal shell.

If I declare a variable i.e. JAVA_HOME = /opt/jdk1.5.0 then when I reboot it has disappeared how do I specify permanent variables? Is there a config file or similar?
0
Comment
Question by:beechhorn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 4

Assisted Solution

by:EinarTh
EinarTh earned 50 total points
ID: 12367904
several ways. If the variable should be a 'user' variable (as opposed to a global 'system' variable), you'd put a line like:

export VARIABLE=value

in the .bashrc or .bash_profile file in that users home directory, i.e. ~/.bash_profile

you could also put into the corresponding file in /etc/skel to make it a default variable for all new users.

If, on the other hand you want this to be a global 'system' variable, you'd put the same line in a file in /etc/rc.d/
I don't know the exact file for Fedora, but on SuSe it's /etc/rc.d/boot.local ... propably something similar on Fedora.

Cheers.
0
 

Author Comment

by:beechhorn
ID: 12367923
It would need to be a global system variable. Will try it out tonight if it works you get the points. If someone can tell me where the exact file is for Fedora then there will be a split not much insentive I know for 25 points but only have a few atm.
0
 
LVL 4

Accepted Solution

by:
EinarTh earned 50 total points
ID: 12379146
/etc/rc.d/rc.local
0
 

Author Comment

by:beechhorn
ID: 12379410
Cheers guys much appreciated.

Boots like 2 seconds faster using the export prefix. I have tried several times both ways and it is a definite lag not specifying export.
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question