I am novice for shell scripting. I have written one script which checks if ORACLE_HOME AND ORACLE_SID are set. Inside this I have called other script to set the env variables.
First Script
while [ 1 -gt 0 ]
do
echo -e "Please enter path of oracle home directory:\c"
read DB_HOME
if [ -d $DB_HOME ]
then
./oracle_env.sh $DB_HOME "test1"
echo "ORACLE_HOME has been set successfully!"
status="Y"
break
else
echo "Path or directory does not exist."
fi
done
Second Script
#This script will set ORACLE_HOME and SID
export ORACLE_HOME=$1
export ORACLE_SID=$2
When I run the second script as
./oracle_env.sh /u01/app/oracle test
it's working fine. I mean, when I run
echo $ORACLE_HOME
it gives path like
/u01/app/oracle
Now the problem is when I run the same script from first script, it's not working.
Please help me out !!!