开发者

Terminal Run Code for n seconds

开发者 https://www.devze.com 2023-01-18 08:15 出处:网络
I\'ve searched for this, but haven\'t found a single command yet - how would i开发者_如何转开发 run say hello.o for n amount of seconds on the terminal.? watch -n 60 hello.o

I've searched for this, but haven't found a single command yet - how would i开发者_如何转开发 run say hello.o for n amount of seconds on the terminal.?


 watch -n 60 hello.o

If you want to run hello.o for n number of seconds for X number of times

x=0
n=60
while [ "$x" -lt 10 ]; do ./hello.o; ((x++));sleep $n; done
0

精彩评论

暂无评论...
验证码 换一张
取 消