Solved

Adding variables to Terminal

Posted on 2004-10-21
4
191 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
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

930 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now