Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Watcher script - please comment
- X-seq: zsh-users 15048
- From: Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Watcher script - please comment
- Date: Wed, 05 May 2010 13:25:21 +0200 (CEST)
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Reply-to: jarausch@xxxxxxxxxxxxxxxxxxx
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