目次
同じコマンドを連続で自動実行する方法。
yesコマンドに渡した文字列をshellにパイプで渡すことで、コマンドを実行する。
yes '[実行するコマンド]:sleep [間隔(秒)]' | sh
yes 'cat /proc/drbd ; sleep 1'| sh
whileを使用して、ループするシェルスクリプトを実行する。
while true; do [実行するコマンド] ; sleep [間隔(秒)] ; done
while true; do cat /proc/drbd ; sleep 1 ; done