如何开始猛砸多个进程 [英] How to start multiple processes in Bash
本文介绍了如何开始猛砸多个进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要开始在庆典
100的过程,但为
语句似乎并不喜欢&安培;
符号,我得到一个语法错误,这里是我迄今为止:
回声产卵100的过程
因为我在{} 1..100
做
./my_script.py&安培;
DONE
编辑:我copypasting这个code,这就是为什么&安培;
字符是非法的。
解决方案
回声产卵100的过程
因为我在{1..100};
做
(./my_script&安培;)
; DONE
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, here is what I have so far:
echo "Spawning 100 processes"
for i in {1..100}
do
./my_script.py &
done
EDIT: I was copypasting this code, that's why the &
char was illegal.
解决方案
echo "Spawning 100 processes"
for i in {1..100} ;
do
( ./my_script & )
; done
这篇关于如何开始猛砸多个进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文