LoginSignup
76

More than 5 years have passed since last update.

posted at

コマンドラインで繰り返し実行する際のメモ

whileで1秒毎にコマンドを実行する
while true; do date; sleep 1s; done
whileで回数を決めてコマンドを実行する
i=1; while [ $i -le 10 ]; do echo $i; i=$(expr $i + 1);done
watchで1秒毎にコマンドを実行する
watch -n 1 date

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
76