[GRASS-dev] Re: [GRASSLIST:962] Re: GRASS and vector lines: how can I change the direction of digitized lines?

Maciek Sieczka werchowyna at epf.pl
Sun May 21 12:39:14 EDT 2006


On Sun, 21 May 2006 17:55:53 +1200
Hamish <hamish_nospam at yahoo.com> wrote:

> > > > Also I want to send most of the messages into /dev/null.
> > > 
> > > be careful of masking error messages.
> > 
> > Good point. Is there a way to only let warnings and errors get
> > through while masking other messages? My v.flip outputs several
> > terminals full of them.
> 
> all warnings and errors are sent to stderr. So you can redirect stdout
> to "> /dev/null" without masking them. Not a total solution, but
> should help. Noisy modules should consider a change to -v verbose
> mode flag or moving non-interesting messages to G_debug().

Hamish, All,

Thanks, this helped for all modules I use besides v.patch and v.clean.
They must be of this "noisy" kind you mention. Is there a  way to mask
their output letting errors through only?

"&>/dev/null" masks both errors and messages completely - so no good.

But ">&1> /dev/null", as well as ">&2> /dev/null", almost does what I
need - ie. most of the v.patch output is filtered out (compare [1], [2])
and errors *are* let through, but I don't understand what exactly is
happening (though I know 1 is stdout, 2 is stderr) and if I'm not doing
anything "bad". ?



[1] Regular v.patch output:

$ v.patch input=cieki04,cieki05 output=cieki06
Patching file cieki04
Patching file cieki05
Building topology ...
372 primitives registered
Building areas:  100%
0 areas built
0 isles built
Attaching islands:
Attaching centroids:  100%
Topology was built.
Number of nodes     :   207
Number of primitives:   372
Number of points    :   0
Number of lines     :   372
Number of boundaries:   0
Number of centroids :   0
Number of areas     :   0
Number of isles     :   0
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.



[2] same command, output at least partially masked:

$ v.patch input=cieki04,cieki05 output=cieki06 >&1> /dev/null
Patching file cieki04
Patching file cieki05
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.



P.S.
Once I understand this all I'll make a patch for SUBMITTING_SCRIPTS to
include information on how to safely prevent script from being
over-verbose.

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/




More information about the grass-dev mailing list