inserting entries into /etc/profile
For some ungodly reason I've been tasked with building a OpenNMS server on OpenSUSE 10.3 even though I've never touched Linux.... I'm following the directions from
.howtoforge.com/opennms_network_management, but am stuck on... Setup Environment variable for java home. Insert the following entries in /etc/profile. JAVA_HOME="/usr/lib/java" export JAVA_HOME How do I enter in the above statements into /etc/profile? |
just open the file in whatever text editor you like as root and add them, then save the file.
|
If I'm reading your question right then what you need is a text editor. If you're in the console then use either nano, vii or emacs. I myself perfer nano for just editting text and use emacs when I'm coding/testing.
Anyways once you're in the etc directory just type "nano profile" and take it from there. Apologies if I misunderstood what you asked. |
Try either of the following methods:
method 1: Fire the following command: Quote:
Then press "Escape" Key & then "I" Then copy and paste the following into this file: Quote:
Fire the following command: Quote:
Quote:
|
Does it matter where in that file I insert:
JAVA_HOME="/usr/lib/java" export JAVA_HOME And how I subsequently save the changes I made? Thank you for your easy to follow instructions! |
It really doesn't matter. These two lines are actually bash commands that get executed when the machine starts. However since you are using SuSE 10.2, edit /etc/profile.local instead. If the file doesn't exist, then create a new one with just those two lines.
The /etc/profile script will run the /etc/profile.local script. |
using the vi method to save the file you would need to do hit 'esc' after you type and then a :wq If you are in vi and want to exit without saving any changes, do a :q! .. also i would recommend making a test document and playing around with various commands if you plan on doing a lot of changes to text files using vi.. there are tons of guides, just google vi commands it should give a good guide.. best thing to do would be make a new document somewhere.. just type vi test.txt and play around in there so you don't mess anything up..
not really sure about exiting using nano -- i primary stick to vi as its easy to navigate once you get some commands committed to memory. enjoy |
And (depending on your distro) there may be the more
elegant option of sticking individual files into the /etc/profile.d/ directory. Cheers, Tink |
All times are GMT -5. The time now is 08:51 AM. |