How to kill and launch a same process repeatly inside a same loop?

bobbysch
bobbysch used Ask the Experts™
on
Hello,

Normally I do this separately:
while true; do command; done
while true; do sleep 10; pkill command; done

I wonder if it's possible to do this with a loop only.

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2014
Top Expert 2015
Commented:
while true; do command;  sleep 10; pkill command; done

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial