Find the answer to your Linux question:
Results 1 to 4 of 4
Hi to all in the forum... i wanna show a certain statment every one second in my code , any one can help me ..!! i now that i need ...
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    4

    Exclamation how to show statment every one second

    Hi to all in the forum...

    i wanna show a certain statment every one second in my code , any one can help me ..!!

    i now that i need using timer but how..???

    regards,

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    using the shell--

    while true
    > do
    > more statement; sleep 1s
    > done
    the sun is new every day (heraclitus)

  3. #3
    Linux User
    Join Date
    May 2008
    Location
    NYC, moved from KS & MO
    Posts
    251
    If you are programming in shell, you can also use command watch to accomplish the task. For example,
    Code:
    watch -n 1 df
    will show the current partitions usage at an interval of 1 second (useful if you need to estimate how much longer a cp or dd process is going to finish).

    Type man watch in shell to learn more.

  4. #4
    Just Joined!
    Join Date
    Nov 2009
    Posts
    4
    thx a lot for u , i try it and the problem was solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...