File: dr_watch

package info (click to toggle)
draai 20100511-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 496 kB
  • ctags: 16
  • sloc: sh: 741; perl: 221; makefile: 33
file content (22 lines) | stat: -rwxr-xr-x 408 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# This file is maintained at http://git.mdcc.cx/draai

# joostvb@hille:~% while sleep 2; do cat /tmp/c; ( clear; draai peek ) >/tmp/c; done
# joostvb@hille:~/arch/draai-wd/script% DR_SLEEP=5 ./dr_watch draai peek

set -e

command=$@

tmpfile=$(mktemp -t dr_watch.XXXXXXXX)
trap 'rm $tmpfile' EXIT

sleep=${DR_SLEEP:-2}

while sleep $sleep
do
    (clear; $command) >$tmpfile
    cat $tmpfile
done