LoginSignup
97
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
97
76
0

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
  3. You can use dark theme
What you can do with signing up
97
76