?
Solved

Adding variables to Terminal

Posted on 2004-10-21
4
Medium Priority
?
200 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 200 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 200 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.
Suggested Courses

718 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