Use of export from a shell script..


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Use of export from a shell script..
# 1  
Old 09-01-2010
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:
Code:
export ORACLE_HOME=/path/to/bin/
  export NG_USER_HOME=/path/to/bin/
  etc....

2. I have another shell script inside which i am calling the above script to export all the path variables.
3. In this script i am calling an Oracle utility which ll run only if the path is set.
4. 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!!!
# 2  
Old 09-01-2010
Code:
ORACLE_HOME=/path/to/bin/
NG_USER_HOME=/path/to/bin/
export ORACLE_HOME NG_USER_HOME

# 3  
Old 09-01-2010
thanks for the reply, but i am calling this script inside another shell script... will it still get set/work....?
# 4  
Old 09-01-2010
Do you try it first?
# 5  
Old 09-01-2010
You will need to source the script with variables instead of calling it. Use:
Code:
. /path/to/script-with-variables

from within the script that calls the Oracle utility.
This User Gave Thanks to Scrutinizer For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Data export UNIX shell script

Hi, I want to write a shell script which connect to my database with the following credentials : User name : user PWD : rap_user_1 Hostname : app.Unix.Gsm1900.Org Port : 7862 SID : PTNC1 Once connected to DB i want to fetch data with the help of a SQL statement and expoet... (4 Replies)
Discussion started by: neeraj617
4 Replies

2. Shell Programming and Scripting

Export Error in Shell script

All, While executing the bellow commnad after the sed, awk command to export the value to, i am getting the fallowing error. line="_AABBB.EEEEEEE.LOG4JDISPLAY.PATH_=/apps/opt/abcde/pdstdsd/esapp/apadsfasdf/logadsfasdf.xml" keystring=`echo $line | awk -F"=" '{ print $1 }'`... (1 Reply)
Discussion started by: jothi basu
1 Replies

3. Shell Programming and Scripting

Export data from database in Excel sheet with the help of Shell script and automated the report

Export data from database in Excel sheet with the help of Shell script and automated the report every day in the mornig. (1 Reply)
Discussion started by: neeraj617
1 Replies

4. Shell Programming and Scripting

export repository shell script

Hi Forum, I have script to export he Siebel repository. My requirment is to have a shell script in place so when placed in it in a cron it should generate the repsoitory dat file on date basis. Script for export: repimexp /a E /c UCM_ES_DEV2_DSN /u sadmin /p SADMIN /d siebel /r... (4 Replies)
Discussion started by: nuthakki
4 Replies

5. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

6. Shell Programming and Scripting

Shell script to export data from Oracle table .

Hi, I want to write a shell script which will export data from oracle table . I don't want to save that data . I want the queries . Right now i am right clicking on the table and clicking on export as to my desktop . Please let me know if any one have any idea . (2 Replies)
Discussion started by: honey26
2 Replies

7. Shell Programming and Scripting

Set/Export Env Vars from with Shell Script With Input Variable

I have a shell script I want to run that will set environment variables based on the value of an input variable submitted when the shell script is called. For example: $ mgenv.sh prod This would set environment variables for prod $ mgenv.sh test This would set environment variables... (1 Reply)
Discussion started by: brtaylor73
1 Replies

8. Shell Programming and Scripting

Export to Microsoft excel using shell script

I have requirement where i have to export the data extracted from a flat file to a microsoft excel sheet. If the awk returns multiple records then all these records should go in into different rows of same column in excel. Eg. say data returned by excel is A,B,C,D then these 4 records should go... (1 Reply)
Discussion started by: goutam_igate
1 Replies

9. Shell Programming and Scripting

problem running shell script (for oracle export) in crontab

Hello Gurus, I've been tasked with solving a problem at my new job and I'm stumped. We've got a script that dynamically builds an oracle export parameter files and then runs export from the shell. it runs fine when using the shell, but will NOT run (fails in one spot everytime) when entered... (1 Reply)
Discussion started by: jsheehan223
1 Replies

10. Shell Programming and Scripting

help for writing shell script to export table data

Hi All, I need to write a shell script(ksh) to take the tables backup in oracle(exporting tables data). The tables list is not static, and those are selecting through dynamic sql query. Can any body help how to write this shell script. Thanks, (3 Replies)
Discussion started by: sankarg
3 Replies
Login or Register to Ask a Question