Time condition loop in shell

后端 未结 8 1591
故里飘歌
故里飘歌 2020-12-04 10:34

I have just started learning shell script recently, so I don\'t know much about it.

I am trying to find example of time based while loop but not having any luck.

8条回答
  •  心在旅途
    2020-12-04 10:43

    You can use the loop command, available here, like so:

    $ loop './do_thing.sh' --for-duration 1h --every 5s
    

    Which will do the your thing every five seconds for one hour.

提交回复
热议问题