multi loop script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting multi loop script
# 1  
Old 11-01-2006
multi loop script

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 i.e. 276 passes

Each pass will output a file in directory /home/print
Can someone help me with the script please ?
# 2  
Old 11-01-2006
Quote:
Originally Posted by grinder182533
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 i.e. 276 passes

Each pass will output a file in directory /home/print
Can someone help me with the script please ?
You have only provided some information. You have not mentioned what to do with them.
Also, you mention 'Each pass will output a file in the directory /home/print'. What will the name of file be like? Something to do with those combinations ?

To give you an idea, here is a small snippet

Code:
#! /bin/ksh

for d in 200501 200502 200503 200504
do
  for l in aaa bbb ccc ddd
  do
    for type in t q r
    do
    :> /home/print/$d_$l_$type
    done
  done
done

The file would be named like 200501_aaa_t
# 3  
Old 11-02-2006
Many thanks Vino
Working perfectly !
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Python Paramiko multi threading to capture all output for command applied in loop

My issue : I am getting only last command output data in ouput file. Though comamnd "print(output)" displays data for all 3rd column values but the data saved in file is not what required it hs to be the same which is being printed by command"print(output)". Could you please help me to fix this,... (0 Replies)
Discussion started by: as7951
0 Replies

2. Shell Programming and Scripting

Script multi listener

hello can help to script to find the listener is up or down for diferent db i have 2 listener ps -fea |grep tns root 17333 17559 0 12:26:38 pts/3 0:00 grep tns oracle 3800 1 1 Jul 23 ? 400:42 /u01/app/oracle/product/9.2.0/bin/tnslsnr LISTENER -inherit ... (1 Reply)
Discussion started by: ceciaide
1 Replies

3. Shell Programming and Scripting

awk - 2 files comparison without for loop - multi-line issue

Greetings Experts, I need to handle the views created over monthly retention tables for which every new table in YYYYMMDD format, there is equivalent view created and the older table which might be dropped, the view over it has to be re-created over a dummy table so that it doesn't fail.... (2 Replies)
Discussion started by: chill3chee
2 Replies

4. Programming

Multi head/multi window hello world

I am trying to write a large X app. I have successfully modified my xorg.conf to setup 4 monitors on an NVIDIA Quatro5200. I am trying to modify a simple hello world application to open a window on three of the four monitors. depending on the changes to loop the window creation section and event... (2 Replies)
Discussion started by: advorak
2 Replies

5. Shell Programming and Scripting

To make my script multi-os compatible

Hi, I would like to make my script multi-os compatible and I am having problems to make it work. I would like it to be compatible with those 4 linux versions : Ubuntu, Debian, Fedora and Centos. I am mostly confused when it comes to the repository installation and the different os... (1 Reply)
Discussion started by: gaaara
1 Replies

6. Shell Programming and Scripting

How to substract selective values in multi row, multi column file (using awk or sed?)

Hi, I have a problem where I need to make this input: nameRow1a,text1a,text2a,floatValue1a,FloatValue2a,...,floatValue140a nameRow1b,text1b,text2b,floatValue1b,FloatValue2b,...,floatValue140b look like this output: nameRow1a,text1b,text2a,(floatValue1a - floatValue1b),(floatValue2a -... (4 Replies)
Discussion started by: nricardo
4 Replies

7. Shell Programming and Scripting

Script Help - Multi Comands

Hi guys I am trying to get a bunch of lines into a .sh script that will let me easily run a bunch of commands on its own without me having to be there... I have done this with other things but apparetnly it doesn't like to use yum.. I will post my script you will see what im trying to do.. ... (3 Replies)
Discussion started by: Bigstack
3 Replies

8. Shell Programming and Scripting

Multi level sorting script

I want to sort like below Suppose few lines in a file is like this systemid:ABC messagedestination:batchxpr replytoqname: myca systemid:BCD messagedestination:realtime replytoqname: myca systemid:ABC messagedestination:realtime replytoqname: eac systemid: BCD messagedestination:mqonline... (1 Reply)
Discussion started by: srkmish
1 Replies

9. Shell Programming and Scripting

Multi line variable script... needs help.

I am trying to write a script that will help me put a file into excel with little manipulation. Below is a sample of the file im using. Group1:*:gid1:user,user Group2:*:gid2:user,user Group3:*:gid3:user,user,user,user,user,user,user Group4:*:gid4:user,user I marked in red the part that is... (1 Reply)
Discussion started by: rookieuxixsa
1 Replies

10. UNIX for Dummies Questions & Answers

multi-file multi-edit

Good day! I am trying to learn how to use the "sed" editor, to perform multiple edits on multiple files in multiple directories. I have one script that tries to call up each file and process it according to the edits listed in a second script. I am using a small input text to test these, at... (12 Replies)
Discussion started by: kielitaide
12 Replies
Login or Register to Ask a Question