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

Daniel Victoria daniel.victoria at gmail.com
Wed Sep 24 11:04:39 EDT 2008


I've bumped into this problem before, with the same error, but outside
GRASS. Which shows that this is not a GRASS bug but a limitation of
the operating system.

As for dividing the raster groups, probably your model output has some
sort of logic at how it names the raster (time period for example).
Use that to divide the groups. The starting with a was just a
suggestion...

Daniel

On Wed, Sep 24, 2008 at 11:50 AM, Rainer M Krug <r.m.krug at gmail.com> wrote:
> 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