[GRASS-user] g.mlist with logical operators?
JRadinger at gmx.at
Wed Feb 15 05:01:19 EST 2012
Thank you all,
I'll have a look into regular expressions... sound very promissing
-------- Original-Nachricht --------
> Datum: Tue, 14 Feb 2012 20:01:44 +0000
> Von: Glynn Clements <glynn at gclements.plus.com>
> An: "Johannes Radinger" <JRadinger at gmx.at>
> CC: GraSS user list <grass-user at lists.osgeo.org>
> Betreff: Re: [GRASS-user] g.mlist with logical operators?
> Johannes Radinger wrote:
> > I'd like to list (using g.list) all raster maps
> > that start with rast_* but not those which start with
> > rast_A_* OR rast_B_* OR rast_C_*. I tried to use the
> > OR operator and | but without success so far.
> > Are such logical operators generally applicable with g.mlist?
> No. You may be able to achieve what you want with regexps. Otherwise,
> you can process the output from g.mlist with additional programs.
> Writing a regexp which matches the union of multiple patterns
> (A OR B OR C) is straightforward enough; just use "(A|B|C)" with
> extended regexps or '\(A\|B\|C\)' with basic regexps (care needs to be
> taken to ensure that backslashes are passed verbatim rather than being
> interpreted by the shell). There isn't an equivalent operator for
> intersection or difference, but you can achieve the same result by
> filtering the output with "grep" or "grep -v" respectively.
> Glynn Clements <glynn at gclements.plus.com>
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!
Jetzt informieren: http://www.gmx.net/de/go/freephone/
More information about the grass-user