nighthoodie

watch

Apr 23rd, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. #!/bin/bash
  2. #watch a file or all files in a directory
  3. #Mac OS X has no watch command
  4. #this script simulates the watch command
  5.  
  6. clear="/usr/bin/clear"
  7. ls="/bin/ls"
  8. sleep="/bin/sleep"
  9.  
  10. clear
  11. if [ -s "$1" ]
  12.         then
  13.                 while ls -skhTuorc "$1"; do sleep 0.98; clear; done
  14.         else
  15.                 while ls -skhTuorc; do sleep 0.98; clear; done
  16. fi
  17. exit
Add Comment
Please, Sign In to add comment