Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have written a bash script which inturn needs to run around 130 Perl scripts.

#!/bin/bash
perl file1.pl &
perl file2.pl &
perl file3.pl &
....
....
perl file130.pl &

The above bash script is configured in the cron to run after every 10 minutes. Is there any other way in which we can run all these 130+ perl scripts at a time ?

share|improve this question

2 Answers 2

for script in file*.pl
do
  perl "$script" &
done
share|improve this answer

If the scripts are actually named like that:

#!/bin/bash
for i in {1..130}
do
    perl "file$i.pl" &
done
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.