Solved

Adding variables to Terminal

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

12 Experts available now in Live!

Get 1:1 Help Now