How to start multiple processes in Bash

前端 未结 5 531
臣服心动
臣服心动 2020-12-24 01:00

I want to start 100 processes in bash, but the for statement doesn\'t seems to like the & symbol and I\'m getting a syntax error,

5条回答
  •  不思量自难忘°
    2020-12-24 01:20

    As others have noted, your snippet is valid code.

    Not sure if this is what you need ... but you can fork twice:

    ( ( /complete/path/my_script.py & ) & )
    

    This will let your script run even if the shell it was launced from is destroyed.

提交回复
热议问题