watch.sh 316 B

1234567891011
  1. #!/bin/sh
  2. command="$1"
  3. interval="$2"; [ -z "$interval" ] && interval=1
  4. if [ -z $command ]; then
  5. echo 'Usage: watch.sh "command [options]" [interval], e.g. watch "ifconfig ath0" 2'
  6. echo 'interval is optional and defaults to 1'
  7. exit 1
  8. fi
  9. while true; do clear; $command; sleep $interval; done