Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的循环:
#!/bin/bash count=3 for i in $(seq $count) do echo $i killall midori midori http://www.test.com/test.html?id=$i & done
但它不会杀死 midori 并在后台启动另一个以继续循环。有任何想法吗?
它很可能完全按照您的意愿工作,除非您在启动它的一毫秒内杀死 midori,在它有机会打开窗口或任何东西之前。
尝试添加 asleep让它有机会在你杀死它之前启动并做一些事情:
sleep
#!/bin/bash count=3 for i in $(seq $count) do echo $i killall midori midori http://www.test.com/test.html?id=$i & sleep 10 done