LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-06-2005, 05:21 PM   #1
maxhugen
LQ Newbie
 
Registered: Mar 2003
Location: Sydney, Australia
Distribution: Red Hat 7.1
Posts: 15

Rep: Reputation: 0
Angry Export Shell Variable not working


In my /etc/profile, I set a few variables such as JAVA_HOME etc, in the form:

JAVA_HOME="/usr/local/j2sdk1.4.1_01"
export JAVA_HOME

Following a power outage, on a reboot these variables aren't being set any more.

I tried doing them manually at the command line, but this doesn't work either, as evidenced when I tried:

echo $JAVA_HOME

The export command just brought up a bunch of other variables set by programs such as apache etc.

I'm stumped as to what could be wrong... if anyone can suggest something I'd be very grateful!


MTIA

Last edited by maxhugen; 01-06-2005 at 06:15 PM.
 
Old 01-06-2005, 09:22 PM   #2
kvedaa
Member
 
Registered: Mar 2004
Location: Virginia
Distribution: PacketProtector
Posts: 331

Rep: Reputation: 30
What shell are you using?

For instance....

[kvedaa@mobilev ~]$ echo $SHELL
/bin/bash
 
Old 01-06-2005, 10:40 PM   #3
mikEdub
LQ Newbie
 
Registered: Dec 2004
Distribution: Gentoo, GentooX
Posts: 21

Rep: Reputation: 15
what distro are you using?
 
Old 01-06-2005, 10:47 PM   #4
maxhugen
LQ Newbie
 
Registered: Mar 2003
Location: Sydney, Australia
Distribution: Red Hat 7.1
Posts: 15

Original Poster
Rep: Reputation: 0
I'm using Red Hat 7.1, and the shell is /bin/bash.
 
Old 01-06-2005, 10:58 PM   #5
maxhugen
LQ Newbie
 
Registered: Mar 2003
Location: Sydney, Australia
Distribution: Red Hat 7.1
Posts: 15

Original Poster
Rep: Reputation: 0
Found the problem - but it's WEIRD!

I've been using Webmin to access my Linux internet server remotely. I log in as root. Using Webmin's Command Shell, I can't see global variables.

Then I tried using SSH, logging in as admin, then su to root. NOW I can see the variables!

So my global variables set in /etc/profile were there all the time, and I've been beating my brain for nought!

Don't know if there is something odd about the Command Shell in Webmin (but how could it be?) or whether the way I log in makes a difference... I'm scratching my head over this one!

Cheers, Max
 
Old 01-06-2005, 11:00 PM   #6
mikEdub
LQ Newbie
 
Registered: Dec 2004
Distribution: Gentoo, GentooX
Posts: 21

Rep: Reputation: 15
do you have a file called .profile in your home dir?


edit: nevermind :-)

Last edited by mikEdub; 01-06-2005 at 11:02 PM.
 
Old 01-06-2005, 11:12 PM   #7
maxhugen
LQ Newbie
 
Registered: Mar 2003
Location: Sydney, Australia
Distribution: Red Hat 7.1
Posts: 15

Original Poster
Rep: Reputation: 0
No, I don't have a .profile in either my /root or /home/admin directories.


Thanks anyway!!! :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
my database export shell script run from command line but not form crontab saifee Linux - General 11 01-29-2012 10:24 AM
How to export environment variable from a bash script dimaash Linux - Newbie 20 08-09-2011 08:12 AM
Export variable loopoo Linux - Newbie 4 08-08-2005 05:08 AM
cannot export result from awk into a variable in a bash script Emmanuel_uk Linux - Newbie 4 03-07-2005 02:54 AM
BASH variable export Barbarian Programming 2 11-27-2001 09:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration