I have written a script that declares all the variables and its values in a conf file.
Now i use a variable whose value i need to change it in one of the sub-file that is used in the script.
In the startup file i want to print or check its value.
The value get changed and printed properly in the sub-file but in the startup file at the end it displays the value in the conf file which has all the variables declared.
how can i fetch the last updated value of that variable.
#This File contains all the variables used in the ETL Process
. ./utilityenv.conf #Process 5 #This File Loads the Actual Measure Data in the Staging Database User From the Source Files received
bash $CommandFiles/Load_Measure_Data_In_Staging.sh
Status=$?
mailsubject="ETL Process - Success"
echo "" > $ETL_HOME_DIR/mailbody.txt
echo "ETL Files found : " $ETLFILESFOUND
echo "Total ETL Files : " $TOTALETLFILES
if [ $ETLFILESFOUND -eq $TOTALETLFILES ]
then
echo "ETL process completed successfully." >> $ETL_HOME_DIR/mailbody.txt
else
echo "ETL process partially completed." >> $ETL_HOME_DIR/mailbody.txt
fi
echo "<BR><BR>" >> $ETL_HOME_DIR/mailbody.txt
-------------------------------------------------------
sub-file Load_Measure_Data_In_Staging.sh contents
-------------------------------------------------------
bash utilityenv.conf
if [ $filecount -gt 1 ] #Check for more than one dat files exist for a single control file
then
echo "set source_file_count = -1 " >> $SqlFiles/update_configuration_master.sql
elif test -f $datfile #Check file exist
then
ETLFILESFOUND=`expr $ETLFILESFOUND + 1`
echo "ETL files found : " $ETLFILESFOUND
loadtype=`echo $datfile | tr "_" "\n" | tail -1 | cut -d"." -f1`
filedatacount=\`cat $datfile | wc -l\`
\#filedatacount=\`cat $datfile | cut -sd "," -f13 | sed -e '/^$/ d' | wc -l\`