You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do i repeate a unix command ever 5 seconds?

Linux seems to have the watch command.


What command does mac os x terminal have?


Tried to type this in termial:


mac $ while [ "1" = "1" ] ; do ; id ; done

-bash: syntax error near unexpected token `;'


Robert

iMac G3 600, Mac OS X (10.4.11)

Posted on Jul 18, 2011 2:14 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 18, 2011 2:35 PM

rccharles wrote:


Linux seems to have the watch command.


What command does mac os x terminal have?


Tried to type this in termial:


mac $ while [ "1" = "1" ] ; do ; id ; done

-bash: syntax error near unexpected token `;'


Robert

Use sleep in the loop.



while <whatever>
     do 
      your command
      sleep 5
     done
5 replies

How do i repeate a unix command ever 5 seconds?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.