Solved

Adding variables to Terminal

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Filesystems reporting faster growth than actual file growth... 7 75
(Open)LDAP V2.44  search proxy to AD (W2012R2) 37 176
AWS Central Authentication 1 88
linux 13 77
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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…
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.

830 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