[GRASS-dev] running commands in background

Hamish hamish_nospam at yahoo.com
Fri May 26 05:02:41 EDT 2006


> >> OK. I see now that it DOES work. The '&' give me back the prompt.
> >> 
> >> The thing that was confusing me is that pesky percent complete
> >> output that keeps getting sent to the screen. Any way to shut that
> >> off?
> > 
> > No. There probably should be, though.
> > 
> > It would be simple enough to add an environment variable to disable
> > percent output altogether. It would be better to standardise this so
> > that it would disable all unnecessary output; the obvious approach
> > would be to have it disable G_message() as well, and migrate modules
> > to use G_message() instead of [f]printf().
..
> I agree. I can think of instances where it would be useful to disable
> unnecessary output on a particular file but not want to turn it off
> for all of them. But this would entail adding a strict quiet flag to
> all. Maybe a lot of work.

Not much work, make G_message() and G_percent respect GRASS_QUIET=1 or
GRASS_VERBOSE=0 if they exist, then just set & unset the enviro variable
in the script as needed. WARNINGs and ERRORs should only be hidden by
the user with an explicit 2> /dev/null.


Hamish




More information about the grass-dev mailing list