问题
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