[GRASS-user] g.mremove error: "Argument list too long"

Rainer M Krug r.m.krug at gmail.com
Wed Sep 24 10:50:04 EDT 2008


On Wed, Sep 24, 2008 at 4:01 PM, Daniel Victoria
<daniel.victoria at gmail.com> wrote:
> Hi,
>
> How about separating it in smaller chunks.
> Try 3 comands first
> g.mremove -f rast=*
> g.mremove -f vect=*
> g.mremove -f region=*

That would not help much - all (except of a handfull of layers) are raster
>
> If you still get "argument list to long" you will have to split the
> rast/vect/region list once more. I don't know how your rasters are
> named but, for example, remove all that starts with the letter a
> g.remove -f rast=a*

That would be an option - but as it is used in a simulation, I don't
know for sure that not to many starting with a are created.
I therefore resorted to iterate through them:

for I in `g.mlist type=rast`;do g.remove $I; done

But in general, I would consider it a bug if an operation with
wildcard results in an error when to many are selected. I will file a
bug report for that.

Thanks

Rainer

>
> or some other division
>
> Cheers
> Daniel
>
> On Wed, Sep 24, 2008 at 10:27 AM, Rainer M Krug <r.m.krug at gmail.com> wrote:
>> Hi
>>
>> I am using GRASS for a simulation which generates litrealy thousands
>> of layers. Before I start a new simulation, I want to delete all
>> existing layers, and I run into th following error message:
>>
>>>  g.mremove -f rast=* vect=* region=*
>> Collecting map names for current mapset <simulation>...
>> Forcing ...
>> exec: 218: g.remove: Argument list too long
>>
>> Is there anything I can do? except iterating through all layers and
>> deleting them separately?
>>
>> And if no, How could I do this easily?
>>
>> Thanks
>>
>> Rainer
>>
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
>> Biology, UCT), Dipl. Phys. (Germany)
>>
>> Centre of Excellence for Invasion Biology
>> Faculty of Science
>> Natural Sciences Building
>> Private Bag X1
>> University of Stellenbosch
>> Matieland 7602
>> South Africa
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Faculty of Science
Natural Sciences Building
Private Bag X1
University of Stellenbosch
Matieland 7602
South Africa


More information about the grass-user mailing list