•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 455,985 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,760 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 742 | Replies: 5
![]() |
•
•
Join Date: Oct 2007
Posts: 302
Reputation:
Rep Power: 3
Solved Threads: 37
One way to do it, also assuming know how many instances of it you want to run, is in a loop, start the process in the background.
while (x < counter){
./process&
x++;
} Last edited by stilllearning : Dec 4th, 2007 at 10:57 am.
•
•
Join Date: Dec 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
One way to do it, also assuming know how many instances of it you want to run, is in a loop, start the process in the background.
while (x < counter){ ./process& x++; }
thanks for that
but the code is giving an error
./runall.sh: line 7: syntax error: unexpected end of file
#!/bin/bash
while (x < 101)
{
./<filename> &
x++;
}•
•
Join Date: Oct 2007
Posts: 302
Reputation:
Rep Power: 2
Solved Threads: 29
Change this
To this and you should be good
The bash tutorial referenced in a previous post is a good read if you're going to be doing this a lot. There are more succinct ways of getting this done using bash's built-ins, but, I'm an old dog
Best wishes,
, Mike
#!/bin/bash
while (x < 101)
{
./<filename> &
x++;
}To this and you should be good
#!/bin/bash
x=1
while [ $x -lt 101]
do
./filename &
let x=$x+1
doneThe bash tutorial referenced in a previous post is a good read if you're going to be doing this a lot. There are more succinct ways of getting this done using bash's built-ins, but, I'm an old dog

Best wishes,
, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the Shell Scripting Forum
- Previous Thread: BASH script - sales per each associate (3 files)
- Next Thread: Can this be done?


Linear Mode