LoginSignup
2
2

More than 5 years have passed since last update.

watchコマンドに満足できなかったのでwatcherコマンド作った。

Last updated at Posted at 2013-07-09
  • フルスクリーン動作しないwatchコマンドが欲しかったが、毎回whileとsleep書くの面倒だったので・・・。
~/.bashrcに以下追記してください。
watcher() {
    if [ "$#" -lt 1 ];then
        echo "usage: watch <command>"
        return 1
    fi
    while true
    do
        echo `date +"[%Y-%m-%d %H:%I:%S]"` $ $@
        $@
        sleep 3
        echo
    done
}

使い方:

$ watcher ls -l

watcher.png

2
2
2

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
2
2