The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-23-2007
arunkumar_mca arunkumar_mca is offline
Registered User
  
 

Join Date: Oct 2004
Posts: 256
setting a global variable in script

Hi All,

I know to set global variable i can use export .. But take the situation like below ..

I want to set a variable in one script and access that in second script

i have done like this .. It is not working



one.sh
#!/usr/bin/ksh
echo $RISSHI
export RISSHI=1


two.sh
#!/usr/bin/ksh
echo $RISSHI
export RISSHI=2

the variable RISSHI is not changed to two when i run two.sh after one.sh
i tries to execute like . one.sh i got error...

Is there is way to share a variable between scripts?

Thanks,
Arun