Nasıl olur:
( # In a subshell, for isolation, protecting $!
while true; do
perform-command & # in the background
sleep 10 ;
### If you want to wait for a perform-command
### that happens to run for more than ten seconds,
### uncomment the following line:
# wait $! ;
### If you prefer to kill a perform-command
### that happens to run for more than ten seconds,
### uncomment the following line instead:
# kill $! ;
### (If you prefer to ignore it, uncomment neither.)
done
)
ETA: Tüm bu yorumlar, alternatifler ve ekstra koruma için alt kabuk ile, bu başlangıçtan çok daha karmaşık görünüyor. Yani, karşılaştırma için, endişelenmeye başlamadan önce waitya da izolasyon gereksinimlerine killsahip gibi görünüyordu $!:
while true; do perform-command & sleep 10 ; done
Gerisi gerçekten ihtiyacınız olduğunda.