[GRASS-user] Copying from a mapset in another data directory

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Wed May 26 01:07:03 EDT 2010


Jonathan Greenberg wrote:
> This ALMOST works, except "from" needs to take the form
> rastername at mapset and "to" needs the form rastername.  I can get the
> "from" setup properly by appending "-m" to the gmlist call, but how do
> I subsequently strip the @comet part for the "to" statement?

With the following (untested though):

for X in `g.mlist rast pat=ned_ca_masked_epsg3310_* mapset=comet -m` ; do
    g.copy rast="${X}",`echo "${X}"|cut -d "@" -f1`
done

Nikos

> Thanks!
> 
> Incidentally, this would be a good feature to add to g.copy.
> 
> --j

-----
> On Mon, May 24, 2010 at 8:40 PM, Nikos Alexandris
> 
> <nikos.alexandris at felis.uni-freiburg.de> wrote:
> > Jonathan Greenberg wrote:
> >> Excellent -- symlinking is working properly -- now on to my next
> >> question -- is there a way to do some level of "batch" g.copy using a
> >> wildcard, e.g.:
> >> 
> >> g.copy rast=ned_ca_masked_epsg3310_*@comet
> >> 
> >> Or do I have to specific each raster individually, along with its
> >> target file name?
> > 
> > Jonathan, would a for loop + g.mlist + g.copy get the job done? For
> > example:
> > 
> >  for X in `g.mlist rast pat=ned_ca_masked_epsg3310_* mapset=comet` ; do
> > g.copy rast="${X}","${X}" ; done
> > 
> > Nikos
> > 
> > [...]


More information about the grass-user mailing list