I have a list with four dates
say load_date.lst contains
2010-01-01 2010-01-31
2010-03-01 2010-03-31
2010-05-01 2010-05-31
2010-07-01 2010-07-31
And I have directory /lll/src/sql with set of sql's
1_load.sql
2_load.sql
3_load.sql
I want to run the sql'in series with respective to each date and In parallel with respective to load
I mean
1,2,3 with input 2010-01-01 2010-01-31
1,2,3 with input 2010-03-01 2010-03-31
How this can be done?
I have something like this
sql_list=`ls /lll/src/sql/*.sql`
for i in ${sql_list}
do
c_l=`wc -l load_date.lst | awk ' { print $1 }'`
nol=`expr $c_l - 0`
z=1
while [[ $z -le $nol ]]
do
cat load_date.lst | nawk -v I="$z" 'NR==I { print $0 }' | read from_date to_date
echo "$from_date $to_date"
some_script.ksh ${i} ${from_date} ${to_date} &
z=$((z + 1))
done
Will this work? or can you suggest some good ways
Thanks in advance...