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

Re: process watching?



Joe Fouche wrote:
>A few times lately, I've had need of a way to watch for a certain process to
>exit. I think it'd be a nice addition to zsh. For example, suppose I want to
>be notified when the process "foo" terminates.  I'd like to be able to do
>
>% watch $(pidof foo)
>
>and continue about my business, and later zsh would say something like
>
>foo exited at 8:10AM.
>%
>
>Is this feasible? :)

Very feasible, in much the same way as the current $WATCH system, and I
for one would find it useful.  Perhaps you'd like to write it as a module?
All the necessary hooks already exist -- look at the sched module to
see how it runs code before each prompt.  (Of course, it could be done
in user code, using $PERIODIC, but that's a rather messy mechanism and
not entirely appropriate.)

(I would implement this tonight, but I'm very busy with real life
right now.)

-zefram



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