problem with EXPORT


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers problem with EXPORT
# 1  
Old 12-14-2006
problem with EXPORT

hi, Smilie
I created a main script called "Paymain.prg" ( /proj/paymain.prg)
In this script i created two variables as follows
MASTER=/HOME/emaster.dbf
TRAN=/HOME/etran.dbf
Aftre that i exported that two variables
EXPORT MASTER TRAN

But when i use these two variable in another script calld dboper.prg(/proj/dboper.prg),those values are not getting accessed in this script.


what might be the reason?


any help?


cheers
RRK
# 2  
Old 12-14-2006
If you executed the script Paymain.prg like this
Code:
$Paymain.prg
$

Then this script will be executed in a new shell and you cannot access those variables in another script.

Code:
. Paymain.prg

If you use this then the script is executed in the same shell and can access those variables.
# 3  
Old 12-14-2006
problem with EXPORT

hi, Smilie
I created a main script called "Paymain.prg" ( /proj/paymain.prg)
In this script i created two variables as follows
MASTER=/HOME/emaster.dbf
TRAN=/HOME/etran.dbf
Aftre that i exported that two variables
EXPORT MASTER TRAN

But when i use these two variable in another script calld dboper.prg(/proj/dboper.prg),those values are not getting accessed in this script.


what might be the reason?


any help?


cheers
RRK
# 4  
Old 12-14-2006
Add this
Code:
. Paymain.prg

to dboper.prg before using those variables.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem in understanding export uses

i am beginner in shell scripting. not able to understand what below line will do. PS1=${HOST:=Žuname -nŽ}"$ " ; export PS1 HOST below is the script #!/bin/hash PS1=${HOST:=Žuname -nŽ}"$ " ; export PS1 HOST ; echo $PS1 and i getting the below output Žuname -nŽ$ (25 Replies)
Discussion started by: scriptor
25 Replies

2. Shell Programming and Scripting

Export command variable exporting problem

I have a txt file from which i am assiging a value to a variable using the code in script1 script1.sh export f=$(sed -n "/Freq *=/ s/.*= *//p" ${R_path}/output.txt) echo "$f" --------> this works in script2 ( which executes the script1) eval ./script1.sh if && ; then echo... (1 Reply)
Discussion started by: shashi792
1 Replies

3. UNIX for Dummies Questions & Answers

Problem with export command

hello all, I know this is a silly question but i have no answer. I have a shell script temp.ksh export value="mynh" echo $value but when i execute the temp.ksh "mynh" is printed but when i give echo $value in the shell after the program is executed, nothing is printed. ... (3 Replies)
Discussion started by: anijan
3 Replies

4. Shell Programming and Scripting

Problem in scheduling an Export of a table

Hi, I am facing a problem while scheduling an export of a table using cron job. I have written a simple export command inside a shell script test.sh like echo started exp schemaname/temp1234 file= /test/d.dmp tables=per_st log= /test/d.log echo ended I tried scheduling it through... (6 Replies)
Discussion started by: beautifulmind
6 Replies

5. Shell Programming and Scripting

About export

Hi all, I am calling a script from main script. The called script (second script) have to return some value, i can use exit to pass but in exit i have to pass some other value. i used "export Var", but this command resides in a function of second script. could you please tell me how to... (3 Replies)
Discussion started by: Arunprasad
3 Replies

6. 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

7. Solaris

automountd [24] : Mount of /export/home problem

Hi Guys, Thanks for taking the time to read the problem i having outlined below: Before i go into the problem can you please tell me what the following means? a. "dt" stands for and what does it means? Configuration Below: 1x Unix Server 2x Unix Terminals (both systems are... (3 Replies)
Discussion started by: tlee
3 Replies

8. BSD

How to export

Hi I need to export some directpry path like below: var1=/<>/<>/<> export var1 This is my basic idea. I tried export var1=/<>/<>/<> after executing this in a shell i did an echo of the var1. But nothing happened. Can you please help me with this. I need to srite a script to... (4 Replies)
Discussion started by: jisha
4 Replies

9. Shell Programming and Scripting

export???

I am trying to export the variable OBJ2 and set it to done. Can some one please let me how to do this? I have tried editing my .bashrc file with this echo <VARIABLE_NAME>=<"OBJ2"> But that wont seem to work... (1 Reply)
Discussion started by: Justinkase
1 Replies

10. Shell Programming and Scripting

Beginner export problem

Me dumb. Can't get this to work... #!/bin/sh export JAVA_HOME_BAK=${JAVA_HOME} or #!/bin/sh export JAVA_HOME_BAK=/usr/java or #!/bin/sh export JAVA_HOME_BAK=$JAVA_HOME or #!/bin/sh export JAVA_HOME_BAK $JAVA_HOME etc.... none work. Either i get: "JAVA_HOME_BAK=/usr/java: is not... (1 Reply)
Discussion started by: xplodersuv
1 Replies
Login or Register to Ask a Question