This is my current script which runs another script on multiple files (filename0, filename1, etc). My problem is that it takes time to run and so would like to run them in parallel. Most solutions involve backgrounding the jobs. However if I do this then the job just stops. The way I get round this at the moment is to run this command in different terminal windows in batches of 10.
for i in `seq 0 100`
do
my-other-script filename$i
done
seqcommand. It is older than time. Usefor i in {0..100}to iterate over numbers. And as a constant reminder: always quote parameter expansions. Using"filename$i"would be safer and you wouldn't have to worry about filenames containing whitespace.