Skip to content

Instantly share code, notes, and snippets.

@mgamba
Created March 22, 2014 20:30
Show Gist options
  • Save mgamba/9713862 to your computer and use it in GitHub Desktop.
Save mgamba/9713862 to your computer and use it in GitHub Desktop.
os x doesn't have watch
function watch {
while sleep 1; do $@; done
}
function watchr {
while sleep 1; do if [ "$d" != "$(stat $1 | cut -d'"' -f4)" ];then echo && date && d=`stat $1 | cut -d'"' -f4` && ruby $1 ; fi; done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment