How to set gobal enviroment vaibles in UNIX [message #376623] |
Thu, 18 December 2008 01:08 |
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
|
|
|
|