'Windows Batch'에 해당되는 글 1

  1. 2015.06.03 watch.bat

watch.bat

https://gist.github.com/jujhars13/4153770

@echo off

if %1==-n (
  set interval=%2
  shift
  shift
) else (
  set interval=2
)

title Watch %1 %2 %3 %4 %5 %6 %7 %8 %9
:loop
cls
%1 %2 %3 %4 %5 %6 %7 %8 %9

timeout /t %interval%
goto loop


> watch.bat netstat -na ^| findstr LIST

> watch.bat -n 5 netstat -na ^| find /c "LIST" //이런 식의 변화를 보는데 적합한 듯


변화되는 상황을 보기에는 Unix watch의 -d 옵션이 필요하다.

watch1.bat 참고