I have been using this command successfully, which changes a variable in a config file and then executes a Python script within a loop:
for((i=114;i<=255;i+=1)); do echo $i > numbers.txt; python DoMyScript.py; done
As each DoMyScript.py
instance takes about 30 seconds to run before terminating, I'd like to relegate them to the background while the next one can be spawned.
I have tried what I am familiar with, by adding in an ampersand as below:
for((i=114;i<=255;i+=1)); do echo $i > numbers.txt; python DoMyScript.py &; done
However, this results in the below error:
-bash: syntax error near unexpected token `;'