Monday, November 12, 2012

Repeat shell command

http://www.thegeekstuff.com/2010/05/watch-command-examples/
http://unix.stackexchange.com/questions/10646/repeat-a-unix-command-every-x-seconds-forever
http://www.linuxquestions.org/questions/programming-9/to-find-if-a-file-exist-using-shell-script-668713/

Use watch 

or


while sleep 1; do uptime; done
while true; do uptime; done
for i in {1..9}; do uptime; done

[Note]  while [ -f test.log ]; do xxx; done
[Note]  while [ -s test.log ]; do xxx; done

No comments:

Related Posts Plugin for WordPress, Blogger...