Reputation: 357
Inside an script we are executing another script in the same directory which contain some variables definition:
SCRIPT1:
cd $configDir
script=PLS00170.sh
./config_fecha$script.sh
if [ ! -f /f_PL_50007622_Hist_Rel_Sico_Vta_Cp.$F1S4_FEOPERACA1 ]
config_fechaPLS00170.sh.sh:
#! /bin/ksh
#------------------------------------
#FEOPERAC
#------------------------------------
F1S4_FEOPERACA1=20150401
....
The Script 1 is not able to resolve the script $F1S4_FEOPERACA1
:
Sysout:
...
+ ./config_fechaPLS00170.sh.sh
+ [ ! -f /f_PL_50007622_Hist_Rel_Sico_Vta_Cp. ]
...
Any idea?
Upvotes: 0
Views: 40
Reputation: 44094
You're executing the second script in its own process, so any variables defined there will be lost when it exits.
You could instead "source" the second script into the first one. This will run it as if the text was literally there. You can do that with
. ./config_fechaPLS00170.sh.sh # note the first dot, then a space
or
source ./config_fechaPLS00170.sh.sh
Upvotes: 3