I need a shell script to simultaneously run multiple instances of a compiled c code
can some one please help i'm using BASH
arjayes 0 Newbie Poster
Recommended Answers
Jump to PostOne 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++; }
Jump to PostChange this
#!/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 done
The bash tutorial referenced in a previous post is a good read …
All 5 Replies
stilllearning 148 Posting Whiz
arjayes 0 Newbie Poster
stilllearning 148 Posting Whiz
eggi 92 Posting Whiz
arjayes 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.