is there any way to excute script every N seconds?

Hello
i have script that show me stuff , i need to excute this script every N seconds , is there any way to do it with one liner ? ( mybe perl )
thanks

Does "some command" every 5 seconds.

while true
do
sleep 5
some command
done

to be one liner ?

You should not be creating an external wrapper to run a script every 5 seconds. The script itself should have an internal loop added.

Try this :

yes 'date;sleep 5' | ksh

yes 'date;sleep 5' | ksh
Want to iunderstand this . What exactly is being done here

Thanks
Ashok

The command 'date' is executed every 5 seconds ...

$ yes 'date;sleep 5' | ksh
Mon Jan 23 16:31:56 NFT 2006
Mon Jan 23 16:32:01 NFT 2006
Mon Jan 23 16:32:06 NFT 2006
Mon Jan 23 16:32:11 NFT 2006
^C$

The yes command as piped input to another command that requires an affirmative response before it completes the specified action.

The yes command outputs 'date;sleep 5'.
Ksh read end execute yes output.
Ye outputs 'date;sleep 5' again .....

Jean-Pierre.

Is there anu way to do it with perl one liner ?