Home » Infrastructure » Linux » Export Environment Variables.
Export Environment Variables. [message #249185] Tue, 03 July 2007 10:38 Go to next message
Koolwant
Messages: 49
Registered: June 2007
Location: new jersey
Member
Hey Experts

I have Red Hat Enterprise Linux ES release 4 (Nahant Update 5) on the server, I have installed Oracle on it .
I have also added the environment variables in it(.bashrc) and executed the file .bashrc
Now still everytime I go into that server , I have to export Environment Variables again to go into my database.

Can somebody help to know if there is any specific setting i have set so when i log into my server ,it automatically executes those environment Variables( like .profile in UNIX)

Thanks in advance.

Re: Export Environment Variables. [message #249202 is a reply to message #249185] Tue, 03 July 2007 11:09 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
every time when you would connect with your server you must have to run .bashrc file to make your variable setting affective.
Re: Export Environment Variables. [message #249207 is a reply to message #249185] Tue, 03 July 2007 11:15 Go to previous messageGo to next message
Koolwant
Messages: 49
Registered: June 2007
Location: new jersey
Member
Thanks DreamzZ for reply

Even if I Execute .bashrc (./.bashrc which is executeable also)
when i do echo $ORACLE_SID ,i dont see anything and i have to export manually and then i can go to my database using sqlplus

Also is there not any setting like in UNIX ,whenever you login the .profile is automatically executed and all the environment variables are set without dong it manually.

Regards

Re: Export Environment Variables. [message #249212 is a reply to message #249207] Tue, 03 July 2007 11:22 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
I guess we always export when we login to our linux box in our .bash file.
Y you not using ksh for that.?
Re: Export Environment Variables. [message #249214 is a reply to message #249185] Tue, 03 July 2007 11:33 Go to previous messageGo to next message
Koolwant
Messages: 49
Registered: June 2007
Location: new jersey
Member
how can i use ksh??
( just type ksh or something else , by default when i login to server the shell i see is bash)
can u tell me little bit??
Re: Export Environment Variables. [message #249216 is a reply to message #249214] Tue, 03 July 2007 11:48 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
It would be your default shell then because when we creating user we assign him shell .

useradd [-c comment] [-d home_dir]
	       [-e expire_date] [-f inactive_time]
	       [-g initial_group] [-G group[,...]]
	       [-m [-k skeleton_dir] | -M] [-n] [-o] [-p passwd] [-r]
	       [-s shell] [-u uid] login

       useradd -D [-g default_group] [-b default_home]
	       [-e default_expire_date] [-f default_inactive]
	       [-s default_shell]


If you have root privileges change your shell.


yes enter ksh

minebox14% bash
bash-3.00$ csh
minebox14% ksh

[Updated on: Tue, 03 July 2007 11:50]

Report message to a moderator

Re: Export Environment Variables. [message #249218 is a reply to message #249185] Tue, 03 July 2007 12:13 Go to previous messageGo to next message
Koolwant
Messages: 49
Registered: June 2007
Location: new jersey
Member
Thanks again for reply DreamzZ

But still As i have other servers also which are also using default bash shell . On them i dont have execute .bashrc everytime i log in to the server.My environment variables are set automatically .
Is there any setting i have to change.
Re: Export Environment Variables. [message #249225 is a reply to message #249185] Tue, 03 July 2007 12:25 Go to previous messageGo to next message
BlackSwan
Messages: 23150
Registered: January 2009
Senior Member
cp .bashrc .bash_profile
& then login again
env | sort
Re: Export Environment Variables. [message #249229 is a reply to message #249185] Tue, 03 July 2007 12:45 Go to previous messageGo to next message
Koolwant
Messages: 49
Registered: June 2007
Location: new jersey
Member
Thanks A LOTT..

This cp .bashrc .bash_profile WORKS

Now i dont have to set environment variables again and again i log into the server..

You saved a lot of my time.

Thanks AGAIN

Regards

Re: Export Environment Variables. [message #249230 is a reply to message #249229] Tue, 03 July 2007 12:50 Go to previous message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Laughing
Previous Topic: disk group is full
Next Topic: Oracle 10g on RHEL4 AS for Itanium Error
Goto Forum:
  


Current Time: Fri Dec 19 15:14:03 CST 2014

Total time taken to generate the page: 0.17950 seconds