Use of export from a shell script..

Hi All,
I am facing a problem while trying to export path variables from a script. Here's my situation

  1. I have a script in which i have defined all the path variables to be exported:
export ORACLE_HOME=/path/to/bin/
  export NG_USER_HOME=/path/to/bin/
  etc....
  1. I have another shell script inside which i am calling the above script to export all the path variables.
  2. In this script i am calling an Oracle utility which ll run only if the path is set.
  3. The problem is that the path is not getting set and the utility doesnt run and fails
    Please help me out here...
    Thanks in advance!!!
ORACLE_HOME=/path/to/bin/
NG_USER_HOME=/path/to/bin/
export ORACLE_HOME NG_USER_HOME

thanks for the reply, but i am calling this script inside another shell script... will it still get set/work....?

Do you try it first?

You will need to source the script with variables instead of calling it. Use:

. /path/to/script-with-variables

from within the script that calls the Oracle utility.

1 Like