[GRASS-dev] [bug #4524] (grass) v.clean, v.patch (else?): output to stderr instead of stdout...

Hamish hamish_nospam at yahoo.com
Mon Jul 10 02:44:10 EDT 2006


Maciek Sieczka wrote:

> > still an issue? the fprintf's have been changed in v.patch.
> 
> Yes.
> 
> v.patch still prints to terminal instead of /dev/null. There is no
> difference to before the change you mention, ie.:
> 
>  $ v.patch input=map1,map2 output=map3 >/dev/null
>  Patching file map1
>  Patching file map2
>  Patch complete. 2 files patched.
>  Intersections at borders will have to be snapped.
>  Lines common between files will have to be edited.
>  The header information also may have to be edited.
> 
> The above 6 lines should all go to /dev/null, too. v.clean is even
> worse - *not a single line* is redirected to /dev/null, so each
> v.clean run results in about 40 lines printed to the terminal.


GRASS sends general messages to stderr and parsable output to stdout.

to redirect stderr to /dev/null do:

G61> v.patch input=map1,map2 output=map3 2> /dev/null


note this will send errors and warnings to /dev/null too, which may not
be what you want.

most modules should be quiet by default (I think ESR asks for "only
display output if something surprising happens"), but include a -v
verbose flag if verbose output could be interesting (e.g. long running
modules). Really long running modules may want to send some heartbeat or
status messages.

> G> v.patch input=map1,map2 output=map3 >/dev/null
>  Patching file map1
>  Patching file map2

These look like they might be put behind a -v verbose flag or
G_debug(1,"");

>  Patch complete. 2 files patched.
>  Intersections at borders will have to be snapped.
>  Lines common between files will have to be edited.
>  The header information also may have to be edited.

These look like they should remain with G_message().


Hamish




More information about the grass-dev mailing list