How to update env variables.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to update env variables.
# 1  
Old 05-30-2010
How to update env variables.

I am newbie on Unix system and seek help for updating env variables. The condition is like this:

On Unix server, I log in as oracle user (this is the super for database on Unix), I type > env

all envirnment variables show up. I saw one variable DBA_LIST contains a few email addreses. I need to update this variable to reflect the new email accounts in this variable. So I update this variable like this:

>DBA_LIST=john@mycompany.com,henry@mycompany.com
>export DBA_LIST
>echo DBA_LIST

the new email accounts show up. Then I log out.

However, when I log in next time. I typed

>echo DBA_LIST

the old email accounts still show up and it indicate that the update only change the variavle in that session. After I login as a new session, the envirnment variables still contain its original contents.

So how to update env variables permanently. I only can login as oracle super user, but don't have root user privileges. Is this because Unix admin create oracle user with that env variable so that I couldn't update it permanently? I have to ask Unix admin with root privilege to make permanent change? Please educate me. Thanks.
# 2  
Old 05-30-2010
Quote:
Originally Posted by duke0001
So how to update env variables permanently.
That depends on the shell you are using and eventually on the OS too, e.g. if your default shell is the bourne sh or bash, you should be able to modify that variable in the $HOME/.profile file. If your shell is csh, then you should check the $HOME/.cshrc file. At least these are the appropriate files on my FreeBSD system.
Quote:
Originally Posted by duke0001
I only can login as oracle super user, but don't have root user privileges. Is this because Unix admin create oracle user with that env variable so that I couldn't update it permanently?
Oracle user does not necessarily need root privileges.
Simply check if the files I've mentioned above exist and check the file permissions for them. Take a look into them and see if you can find the DBA_LIST variable.
Quote:
Originally Posted by duke0001
I have to ask Unix admin with root privilege to make permanent change?
I can't tell that... not necessarily... though it's probably the best idea, to simply avoid any potential conflicts with him.

---------- Post updated at 07:13 ---------- Previous update was at 07:08 ----------

Update regarding root privileges for oracle user:
IMHO that's less a matter of setting env variables than powering off the machine, manipulating logfiles and the like...
# 3  
Old 05-30-2010
pseudocoder:

Thanks so much. your advice is absolutely correct. I have found that it was caused by .profile on my ksh. If I update .profile at oracle user home, the env variable will be updated. next time, when you log in, variables in .profile will update the system env variables. Thank you for your quick response.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Setting ENV variables in PERL

I have perl script and in the first line we are invoking .sh script to set ENV variables. e..g eval '. $envfile; exec $PERL -S $0 "$@"' I want to change some of the env variables while the program is running and I am settging it like this .. $ENV{ORACLE_HOME}=trim($oraclehome);... (1 Reply)
Discussion started by: talashil
1 Replies

2. Shell Programming and Scripting

Using env variables to run a program

Hi there, I need urgent help with a small program that is run via shell script. Unfortunately I only understand the bare basics of shell scripting and can't figure out how to do this. We have a program that tests the connection between 3 servers. I have a script that lets the program run on... (15 Replies)
Discussion started by: Pherdinand
15 Replies

3. Shell Programming and Scripting

Env variables in script

Hi All, I have script and it's hardcoded the script ca invoke in user home dir and logs will be redirected to home dir of user. how to make the same script will be invoke from /usr/bin with out chg the logs and other functions path from /user/homedir . code is below: pls check how to... (1 Reply)
Discussion started by: saku
1 Replies

4. Red Hat

how to use env variables within ed

i have a file that i need to edit and replace a single value with another. so i have two variables, $oldvalue and $newvalue but below doesn't work: ed file.txt << EOF ,s/$oldversion/$newversion/g wq EOFi presume it's the $ that is the issue since it's actually special to ed. any suggestions?... (1 Reply)
Discussion started by: crimso
1 Replies

5. Solaris

env variables again

What is the difference between ${variable} and $variable when used in a script? (2 Replies)
Discussion started by: orange47
2 Replies

6. UNIX for Dummies Questions & Answers

Setting env variables using script

Hi, I wrote two small scripts to set env variables in a shell. java_env.csh #!/bin/csh -fn setenv JAVA_HOME '/scratch/software/jdk1.5.0_11' setenv PATH $PATH':'$JAVA_HOME'/bin' and run it using csh ./java_env.csh But the env variables are not set. I tried running each line on the... (5 Replies)
Discussion started by: NoviceAmod
5 Replies

7. UNIX for Dummies Questions & Answers

set env variables in a new xterm

Hi, I have a script that sets some env variables. I want to source the script in a new xterm and after the script execution is over, the xterm has to be alive with the env variables set according to the script. I tried xterm -e "source ./myscript;tcsh" & The variables are getting set... (3 Replies)
Discussion started by: chaitubek
3 Replies

8. Shell Programming and Scripting

Getting the value of env variables

Hi, I want to get the value of the env varables using the ksh script. All the env variables are stored in a file. Eg. file1 $INPATH $OUTPATH myscirpt: for name in `awk { print $1 } file1` do cd $name done i'm getting the error like $INPATH not found. in the same script... (1 Reply)
Discussion started by: vij_krr
1 Replies

9. UNIX for Advanced & Expert Users

Ksh - Env. Variables ??

Hey all, I have been using Ksh and in that I am setting Environment variables. To set Env. Variables I have created my own file "BuildScript.sh" in which i have written : export CLASSPATH=/somedir/some other dir/file:. export PATH=/some dir/file:. But when i am calling this... (4 Replies)
Discussion started by: varungupta
4 Replies

10. Shell Programming and Scripting

export env variables

hi i want to write a shell script to set environment variables . But i am not been able to set that for the current shell instead i have to spawn a new shell. Is there a way to set the env variable for the current shell using shell script in bash shell ? Thnx (2 Replies)
Discussion started by: varun.81
2 Replies
Login or Register to Ask a Question