Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Watcher script - please comment



Hi,

I'd like to start a "daemon" which notifies me if some file
is no longer accessed (e.g. by rsync from a remote host).

My simple minded solution is

#!/bin/zsh

while /bin/true; do
  if ! fuser -s $1; then break; fi
  sleep 5
done
notifier -1 -e5 -tREADY <<< $1


where the file in question is passed as a parameter.

Is there something builtin into ZSH which is more efficient / elegant.

Many thanks for a hint,
Helmut.

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany



Messages sorted by: Reverse Date, Date, Thread, Author