Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multi-pass script

Status
Not open for further replies.

ianholmes

Programmer
Mar 24, 2001
61
GB
I need to run a process a large number of times.
In /home/runX, I have process X, which accesses a file X.ini.
X.ini contains 3 variables, as follows :

X_date=ccccmm
X_location=aaa
X_type= t

where date will be 200501 thru 200611
location will be aaa, bbb, ccc, or ddd
type will be t, q, or r.

So there will be 23 * 4 * 3 passes
ie 276 passes

Each pass will output a file in directory /home/print
Can someone help me with the script please ?
 
And what have you tried so far ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
So are you saying that for each of the 276 passes you need to create the X.ini file with the correct parameters, and then run the programme X?

Or do all of the X.ini files already exist somewhere?

Annihilannic.
 
Hi Annihilannic
X.ini will contain the 3 variables
So running it manually, I would have to edit it 276 times to cover all the possibilities and then run X

I have got to something like
for date in 200611 200610 etc etc
do
for location in "aaa" "bbb" "ccc" "ddd"
do
for type in "t" "q" "r"
do
????? /home/print/$location_$type
done
done
done

but I don't know the ???? bit

Thanks for your help
 
That's a good start, how about:

[tt]echo X_date=$date > /home/runX/X.ini
echo X_location=$location >> /home/runX/X.ini
echo X_type=$type >> /home/runX/X.ini
/home/runX/X > /home/print/$location_$type[/tt]

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top