How would you run “watch” command for “one minute” and then exit?

老子叫甜甜 提交于 2019-12-11 01:34:11

问题


I'm trying to use "watch" command watch -n1 './script.sh' that runs every second for 1 minute then stops. How would you achive this by using pipeline or very short for/while loop. Thanks.


回答1:


I found one way is by using "timeout"

timeout -sHUP 1m watch -n1 ./script.sh

Any one knows any other ways ?



来源:https://stackoverflow.com/questions/19997584/how-would-you-run-watch-command-for-one-minute-and-then-exit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!