How is it possible to run multiple commands and background them using bash?For example:$ for i in {1..10}; do wait file$i &; donewhere wait is a custom binary.Right now I get an error:syntax error near unexpected token `;'when running the above command. Once backgrounded the commands should run in parallel.
Run the same command multiple times in background
bash;command line;background process
The &, just like ; is a list terminator operator. They have the same syntax and can be used interchangeably (depending on what you want to do). This means that you don't want, or need, command1 &; command2, all you need is command1 & command2. So, in your example, you could just write:for i in {1..10}; do wait file$i & doneand each wait command will be launched in the background and the loop will immediately move on to the next. 