How to periodically run a command with very short interval and get the return

command line

I need to call a specific command in an interval of about 5 sec. How would I setup a daemon/process running in the background or something similar to do that? I looked at cronjobs, but the minimum interval seems to be 1 minute. Any advice is appreciated 😉

Fedora is the system.

EDIT
the command would be a bashscript, so "watch" wouldn´t do it I think.

Best Answer

(
  while true
  do
    your-command-here
    sleep 5
  done
) &
disown
Related Question