Software & Stuff

a blog by Daniel Lubarov

Simple "watch" script for OSX

Here's a fork of this watch script with some improvements:

#!/usr/bin/env bash
# usage: watch [command] [sleep duration]
while :; do 
  clear
  date
  bash -c "$1"
  sleep ${2:-1}
done

Example usage:

watch 'fortune | cowsay' 5