watch command line utility for alternative for Mac OS X

I recently purchased the book Practical Ruby for System Administration by Ben Hamou and one of the cool Ruby one-liner command line expressions is one that mimics the watch command.
ruby -e 'system "clear; df -h" while sleep 1'

Just like the author, for quite a while I’ve been kind of annoyed by the fact that Apple doesn’t include this really useful command line utility. So inspired by the one-liner script, I hacked a small watch command line alternative for OS X.

Download watch.rb
sudo cp watch.rb /usr/local/bin
wacht.rb ‘UNIX command

Leave a Reply

Your email address will not be published. Required fields are marked *