[GRASS-dev] preexec()/precmd() possibilities
William Kyngesburye
woklist at kyngchaos.com
Fri Oct 19 11:37:26 EDT 2007
This complex shell programming is a bit much for me, but I found this
interesting hack for bash that looks useful.
http://glyf.livejournal.com/63106.html
Summary - zsh has a feature called preexec() to intercept the start
of any shell command. This 'glyf' person worked out a way to get
that feature in bash (I don't know if it could work in other shells).
The reference I found, that I thought would be nice in GRASS, is to
use that feature to track a command and fire off a system
notification event when it finishes (in the OSX case, with the Growl
notification tool), including the elapsed time. Nice for those long-
running GRASS commands.
http://www.macosxhints.com/article.php?story=20071009124425468
The hint as it is set up only works at the top level of the bash
shell, so it doesn't work inside the GRASS shell. It would have to
be added to init.sh. There is currently no author/license info in
the preexec script, so we'd have to ask about that.
There's Growl (3rd-party extension) on OSX. To be useful on other
platforms, some system notification mechanism would be needed.
Possibly make it configurable, if there are multiple choices of
notification extensions. And definitely make it optional.
I'll see if I can get the OSX/Growl preexec working, but I wonder if
there is already a similar feature in init.sh that could be used?
-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/
"This is a question about the past, is it? ... How can I tell that
the past isn't a fiction designed to account for the discrepancy
between my immediate physical sensations and my state of mind?"
- The Ruler of the Universe
More information about the grass-dev
mailing list