Home » Infrastructure » Unix » How to set gobal enviroment vaibles in UNIX
How to set gobal enviroment vaibles in UNIX [message #376623] Thu, 18 December 2008 01:08 Go to next message
ramakoti.s
Messages: 1
Registered: December 2008
Location: bangalore
Junior Member
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
DM_TK_DB=MICDEV1B;export DM_TK_DB
test=SVWMIG1B;export test
echo $?
echo $DM_TK_DB

I want DM_TK_DB,test varibles in test.sh scripts

$ cat test.sh
#!/bin/ksh
sudo su - micdev1b << EOF
cd /m61/micdev1b/work/dm/scripts
. /m61/micdev1b/work/dm/scripts/dm_env21
echo $?
#echo $DM_TK_DB
echo $test
EOF


I am runing test.sh with my user and i have sudo permission on micdev1b.

I am runing tihs test.sh script i am getting DM_TK_DB,test variable contains null values.

Could u please help me.

[Updated on: Thu, 18 December 2008 01:16]

Report message to a moderator

Re: How to set gobal enviroment vaibles in UNIX [message #376626 is a reply to message #376623] Thu, 18 December 2008 01:22 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As far as I know, you can't do it through a sudo.

This question bears no connection with Oracle.
Please find a more appropriate forum.
The topic is locked.

Regards
Michel
Previous Topic: Copying (archiving) multiple files with sysdate
Next Topic: Bonnie++ Benchmark Software
Goto Forum:
  


Current Time: Thu Mar 28 10:11:48 CDT 2024