set enviroment variable..


 
Thread Tools Search this Thread
Operating Systems Solaris set enviroment variable..
# 1  
Old 08-14-2006
set enviroment variable..

Hello...

I was wondering can anyone explain me how to set up enviroment variable to be permanent...

I tryed with setenv but my solaris does not have this command...

then I did:

export ORACLE_SID=base1
export ORACLE_BASE=/home
export ORACLE_HOME=$ORACLE_BASE/oracle/8.1.6

and by doing this I can start my sqlplus...but as soon as I break telnet connection to my solaris..and start it over again...I am losing these variables..

I have to set them again and sqlplus works..

can U help me with this..
# 2  
Old 08-14-2006
Put them into .profile of your home directory!!
# 3  
Old 08-17-2006
The reason you don't have setenv is because that's a function of the csh environment and you're probably using ksh or bash (you can find out by typing "echo $SHELL").

The above will solve your problem.
# 4  
Old 08-20-2006
Check which shell you are using by echo $SHELL as described above. If you are using bash, you will need to place them in your .bashrc file. If sh or ksh, then your .profile as described above. If you are using csh or tcsh, you will need to edit your .login file. But from the output above, I don't think you are using csh or tcsh.
# 5  
Old 08-21-2006
Hi,

I too am facing this problem of setting the environment variables permanently. i'm using sh as my shell and I looked for .profile directory in my root filesystem but did not see any directory named like that. What directory am I supposed to be looking at ???

Thanks
rohit
# 6  
Old 08-21-2006
.profile is a file in the home directory of the user. If it does not exist you can simply crete it. However .profile is used only by bourne derivative shells so it you are using csh/tcsh then you should use .cshrc.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Question about enviroment variable.

Hi Gurus, I am stuck on below issue. in my .profile. I have two variable: x=abc$123 t=xyz$ when running env command, I got below: x=abc t=xyz$ my OS is SunOS 5.10 sun4v sparc SUNW,SPARC-Enterprise-T5220 I am wondering why t=xyz$ shows exactly value? I try below: (9 Replies)
Discussion started by: ken6503
9 Replies

2. Shell Programming and Scripting

do you have a better way to set this variable?

greetings, i have a variable $input that i want to use to set $output. $input is /dir/filename.mph and $input is passed to my script that i manipulate it as follows: input=`basename $input`i want the $output to be filename_solved.mph, basically stuffing "_solved" in the filename. here's how i... (2 Replies)
Discussion started by: crimso
2 Replies

3. Shell Programming and Scripting

How to know who and where a variable is set ?

hi, i'm not a root user and i want to know which user and in which file is loaded a variable seen in the "env" display ? I will use this variable but i want to be sure that it will be a permanent variable ! i don't see it in my files (.profile , kshrc...) and neither in /etc/profile. ... (3 Replies)
Discussion started by: Nicol
3 Replies

4. HP-UX

What is the use of command set -- and set - variable?

Hi, I am using hp unix i want to know the use of the following commands set -- set - variable thanks (4 Replies)
Discussion started by: gomathi
4 Replies

5. Shell Programming and Scripting

How to pass enviroment variable from csh to Informix sql script

Hello, I have a csh script that creates an environment variable. I want to pass the environment variable(CURR_TABLE_DATE) to an Informix sql script. Here is the csh: #!/bin/csh -f setenv INFORMIXSERVER market3_tcp setenv CURR_TABLE_DATE 20090714 set DATABASE = gm_cdr set SQL_DIR =... (0 Replies)
Discussion started by: jwoj
0 Replies

6. Shell Programming and Scripting

How to set gobal enviroment vaibles in HPUNIX

Hi , I have one script setting envrioments varaible , calling this scripts in another script,i wnat to user thoese envrioemnt variables in parent script. I am trying set envrioment variables with "export" comand i am unable to access thoese envrioment variables. $ cat dm_env21... (3 Replies)
Discussion started by: ramakoti.s
3 Replies

7. Shell Programming and Scripting

set variable with another variable? c shell

okay, this shouldn't be difficult but I can't figure it out. How can I set a variable with another variable. I have the following: foreach pe ($dir $sp) set tpe = `echo $pe | grep M` if ($tpe == M) then set ${$pe} = M <--- This doesn't work else endif end In this case what... (2 Replies)
Discussion started by: wxornot
2 Replies

8. UNIX for Dummies Questions & Answers

Export command giving Variable Name vs the Value set for the Variable

I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so: set -a export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data" export... (2 Replies)
Discussion started by: ParNone
2 Replies

9. UNIX for Dummies Questions & Answers

Accessing remote machine via an enviroment variable

Hi. Is it possible to remotely access another unix box via an enviroment variable, on another machine? I am trying to create an environment variable $MIPSDATA which will point to a folder on another machine. I have setup the .rhosts file and got that working on both machines (tested via a... (4 Replies)
Discussion started by: ElCaito
4 Replies

10. UNIX for Dummies Questions & Answers

Where to set the LANG variable

When I login to my AIX server, the LANG variable is automatically being set to En_US. This is causing locale warning messages when I run emacs or perl. The reason seems to be that En_US is not a valid locale (seen by running locale -a). I can change the variable from the command line (export... (3 Replies)
Discussion started by: wvdeijk
3 Replies
Login or Register to Ask a Question