Set env variables for user


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Set env variables for user
# 1  
Old 04-08-2014
Set env variables for user

Hi ,

I have installed oracle in Solaris machine and unable to set the env variable. I tried to put the env variable in .dtprofile file but didn't help. So everytime I login in need to run the command and export the variable. Kindly suggest where I am doing wrong.Pls excuse as I am not too familiar with unix .

OS: Sun OS 5.10
User name : oracle
shell : sh
user home dir : /oracle
Here are the contents of user's home dir

Code:
drwxrwxr-x   4 oracle   root           4 Apr  1 21:23 app
drwxrwxr-x   2 oracle   oinstall       2 Apr  1 21:33 oradata
drwxrwxr-x   2 oracle   oinstall      78 Apr  3 15:10 .fontconfig
drwxrwxr-x   3 oracle   oinstall       3 Apr  3 15:11 .oracle
drwx------   2 oracle   oinstall       3 Apr  4 15:17 .ssh
drwxr-xr-x   9 oracle   oinstall      10 Apr  4 17:47 .dt
drwx------   2 oracle   oinstall       2 Apr  4 17:47 .gnome2_private
drwx------   4 oracle   oinstall       4 Apr  4 17:47 .gnome
-rw-r--r--   1 oracle   oinstall      83 Apr  4 17:47 .gtkrc-1.2-gnome2
drwxr-xr-x   2 oracle   oinstall       2 Apr  4 17:47 Documents
drwx------   3 oracle   oinstall       3 Apr  4 17:47 .metacity
-rw-------   1 oracle   oinstall       0 Apr  4 17:47 .recently-used
drwxr-xr-x   3 oracle   oinstall       4 Apr  4 17:47 .nautilus
drwxr-xr-x   2 oracle   oinstall       3 Apr  4 17:47 Desktop
drwxr-xr-x   3 oracle   oinstall       3 Apr  4 17:47 .softwareupdate
drwx------   7 oracle   oinstall       8 Apr  4 17:50 .gnome2
-rw-------   1 oracle   oinstall       0 Apr  4 17:50 .ICEauthority
drwxr-xr-x  40 root     root          47 Apr  7 23:38 ..
drwx------   4 oracle   oinstall       4 Apr  7 23:54 .gconf
drwx------   4 oracle   oinstall       4 Apr  7 23:54 .mozilla
drwx------   2 oracle   oinstall       3 Apr  7 23:54 .gconfd
 -rwxr-xr-x   1 root     root        5399 Apr  8 20:31 .dtprofile
-rw-------   1 oracle   oinstall     288 Apr  8 20:31 .Xauthority
drwxrwxr-x  20 oracle   oinstall      29 Apr  8 20:31 .

I put something like this in .dtprofile
Variable= value
export variable


Thanks
# 2  
Old 04-08-2014
Put the environment variables to .profile (create if doesn't exist).
Do not put spaces around the = in an assignment!
Code:
variable=value
export variable

Ensure the following is in .dtprofile:
Code:
DTSOURCEPROFILE=true

The .profile is executed at login.
This User Gave Thanks to MadeInGermany For This Post:
# 3  
Old 04-08-2014
Thanks a lot it worked !!!!!
I was trying to figure it out for so many hours
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Set Env

Hi, I need to add file the /usr/lib under the command set. The /usr/lib need to be set under the DIRS=' ' while listing the set command. I tried with the command below: export PATH=${PATH}:/usr/bin But this doesn't work out... (4 Replies)
Discussion started by: gsiva
4 Replies

2. 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

3. 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

4. Solaris

export vs env vs set commands

Hi I'm trying to understand variable scopes in solaris10. It is said that to display env variables we use 3 commands : - env - set - export What is the difference between them ? thx for help. ---------- Post updated at 11:00 AM ---------- Previous update was at 10:50 AM ---------- ... (2 Replies)
Discussion started by: presul
2 Replies

5. Shell Programming and Scripting

Manipulating env variables for user apache?

So that they can be used in a cgi script? How best to do this? Thanks ---------- Post updated at 06:24 PM ---------- Previous update was at 02:38 AM ---------- Anyone that can help me with this? Basically I want to add an environment variable that will be visible to the cgi scripts when I... (0 Replies)
Discussion started by: stevenswj
0 Replies

6. Solaris

How to set PS1 in env

Hello whenenver i login to solaris server the prompt is displaying as #. i want to customize the promt with server name for all users. how to customize the PS1 variable for all the users?. Thanks for your help in advance. regards, Saravana (2 Replies)
Discussion started by: tsaravanan
2 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. UNIX for Advanced & Expert Users

How to export ENV variables, which remains set for all the shell

Hi ! How to export ENV variables, which remains set for all the shell Example :- Login :myID Pwd : **** -> Here my ID .profile is executed. Let say I set MYENV variable Kisses% rlogin ABC -l XXXGroupID -> I login into a remote Solaris Server ABC password : **** -> "XXXGroupID's... (1 Reply)
Discussion started by: dashok.83
1 Replies

9. 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

10. HP-UX

How to use own account env variables to cron user

hi all, i have one account for unix Tru64. i can login this account and i do execute special shell script(login sqlplus, execute another shell, etc... ) on this account on my server. but i can't run this shell from cron tab. i think that become cron user envirnoment variables. (3 Replies)
Discussion started by: Tlg13team
3 Replies
Login or Register to Ask a Question