Run several codes at the same tim?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run several codes at the same tim?
# 1  
Old 01-16-2013
Hammer & Screwdriver Run several codes at the same tim?

Hello everyone,

I want start 30 codes at the same time in 30 different directories in one terminal.

I tried this bu it makes it one by one

Code:
sh damp-0000/coderun
sh damp-0005/coderun
sh damp-0010/coderun
etc...

İt took so much time that way. If run them at the same time that would be much better and I tried it also by openning 30 terminals but it is very complicated that way

So I thought there must be some way to start them at the same time in one terminal?
Is there a way with bash or csh?

Any help is appreciated..
# 2  
Old 01-16-2013
Code:
#!/bin/bash
sh damp-0000/coderun &
sh damp-0005/coderun &
sh damp-0010/coderun &
sh damp-0000/coderun &
sh damp-0005/coderun &
sh damp-0010/coderun &
wait
sh damp-0000/coderun &
sh damp-0005/coderun &
sh damp-0010/coderun &
sh damp-0000/coderun &
sh damp-0005/coderun &
sh damp-0010/coderun &
wait

I just copied and pasted your example over and over - use real damp-00nn values for each one. Set up blocks of 8-10 of the statements, with a wait. If you make your block 30 statements long it will probably affect other users. And will make the whole thing take longer.
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. What is on Your Mind?

Speed Bumps on the Road to Cyber Situational Awareness - Tim Bass

Speed Bumps on the Road to Cyber Situational Awareness Happy Holidays! (0 Replies)
Discussion started by: Neo
0 Replies

2. UNIX for Advanced & Expert Users

Know any good codes?

Know any good codes? (2 Replies)
Discussion started by: fgjiu
2 Replies

3. Shell Programming and Scripting

can anyone explain this codes here?

nawk 'FNR > 3 {printf("%s%c", $0, OFS)}END{print ""}' "$1" > "$1".out && mv "$1 ".out "$1" what is FNR? or printf("%s%c",$0, OFS)}? sorry..im lost... (2 Replies)
Discussion started by: forevercalz
2 Replies

4. UNIX for Dummies Questions & Answers

escape codes

I did a search and found the link for escape codes,- but I am not sure how to modify this script to set the margins. I started with a script that was already written on my system to set a printer to print landscape. I need to send an report that is in an ascii file to multiple printers from my... (1 Reply)
Discussion started by: MizzGail
1 Replies

5. UNIX for Dummies Questions & Answers

were could i get sorce codes

were could i get sorce codes for Linux OS of people that change or emulate programs for other Unix based OS's. for example i am looking for a way to emulate mac os programs to linux. were could i go for source codes or already emulated porgrams that i could download. i am very courios about finding... (1 Reply)
Discussion started by: ChildrenoftheOS
1 Replies
Login or Register to Ask a Question