title: Set environment variables using shell script (Linux)
body: <p>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.</p>
  
  <hr>
  
  <h1>First Script</h1>
  
  <pre><code>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
  </code></pre>
  
  <h1>Second Script</h1>
  
  <pre><code>#This script will set ORACLE_HOME and SID
  export ORACLE_HOME=$1
  export  ORACLE_SID=$2
  </code></pre>
  
  <p>When I run the second script as </p>
  
  <pre><code>./oracle_env.sh /u01/app/oracle test
  </code></pre>
  
  <p>it's working fine. I mean, when I run </p>
  
  <pre><code>echo $ORACLE_HOME
  </code></pre>
  
  <p>it gives path like</p>
  
  <pre><code>/u01/app/oracle
  </code></pre>
  
  <p>Now the problem is when I run the same script from first script, it's not working.</p>
  
  <p>Please help me out !!!</p>