calling script with multiple variables in second script

Hi All,

Just give me an idea on how to do the below logic.

  1. I have one master script masterload.sh, the usage of this script is

a. masterload.sh FULL BFLF_LOAD.txt
b. masterload.sh DELTA TDLD_LOAD.txt
c.masterload.sh USER MAS_LOAD.txt

FULL , DELTA ,USER are the varaibles based on this variables inside that particular code will be executed. and the .txt are the source files.

  1. Now I am creating one more script mdo_sha.sh(second script) which has to call the masterload.sh and I want to write a loop for the below requirement.

All the BFLF* file names are listed in BFLF.txt
All the TDLD* file names are listed in TDLD.txt
All the MAS* file names are listed in MAS.txt

the second script has to check all these .txt files in the above example and if this files have a value then

it has to do a while loop like iif BFLF.txt has some file names in it then the script has to call the master_load.sh full (and pass the file names one by one from the BFLF.txt)

master_load.sh FULL 1.txt
master_load.sh FULL 2.txt
master_load.sh FULL 3.txt
master_load.sh FULL 4.txt
master_load.sh FULL 5.txt

similarly if TDLD.txt has some value then the script has to call the master_load.sh full (and pass the file names one by one from the TDLD.txt)

master_load.sh DELTA 1.txt
master_load.sh DELTA 2.txt
master_load.sh DELTA 3.txt
master_load.sh DELTA 4.txt

similarly for the thrid one,Pls give some logic on how to implement the same.

--Mora

---------- Post updated at 08:33 PM ---------- Previous update was at 08:22 AM ----------

Hi,

Can some one please give me an idea on how to do this in shell scripting...

--Mora

Hey Mora,

can you tell what exactly should be you out put.

your second script mdo_sha.sh should call the first script and check in all the three .txt files if some file name exists then it should run (the first script, parameter and the file name)master_load.sh FULL 1.txt.., it should be in a while loop.

Are you expecting this as output?

Regards,
Deepti