How about:
( # 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: With all those comments, alternatives, and the subshell for extra protection, that looks a whole lot more complicated than it started. So, for comparison, here's what it looked like before I started worrying about wait
or kill
, with their $!
and need for isolation:
while true; do perform-command & sleep 10 ; done
The rest is really just for when you need it.