[GRASS5] Wish: wildcards in command line

Bernhard Reiter bernhard at intevation.de
Thu Sep 21 13:32:30 EDT 2000


On Thu, Sep 21, 2000 at 06:28:45PM +0100, Markus Neteler wrote:
> a "problem" I regularly face (and my students...) is that you
> can't use wildcards in GRASS/cmd line.
> 
> Suppose you want to patch 20 adjacent images or DEMs, you
> have to specify all the names on command line. It would
> be great to have:
> 
> r.patch in="dem*" out=mybigdem
> 
> Or:
> g.remove rast="*"
> 
> I am dreaming of such a feature since years... :-)
> Do you consider this is feasible (Obviously the parser would
> need to be modified).

Hmm I do not think it is a good idea to add this capabiltiy to
each grass command. Actually, this only works with unix commands,
because they already can accept mutliple arguments (like rm).
A start would be to add wildcards to g.list and maybe a flag
to produce a comma seperated list.


r=`g.list -l type=r dem*`
echo $r
dem1 dem2 dem3
r.patch in=$r out=mybigdem

In the case of r.patch and g.remove, we could add the functions,
reading the files from a file, making it even simpler.

g.list type=r dem* | r.patch inlist=- out=mybigdem

This would be unix tradition.

I would be interested to know how many commands actually do
need more than one or two map parameters from the same type.

	Bernhard

-- 
Professional Service around Free Software                (intevation.net)  
The FreeGIS Project				            (freegis.org)
Association for a Free Informational Infrastructure            (ffii.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 236 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20000921/3f1e2c8a/attachment.bin


More information about the grass-dev mailing list