[GRASS5] shape file limit with v.in.org.all

Markus Neteler neteler at itc.it
Thu Jan 12 02:15:16 EST 2006


On Wed, Jan 11, 2006 at 02:02:52PM -0600, Kirk R. Wythers wrote:
> I have an odd script question. I am using a script v.in.ogr.all
> 
> ===============================================
> #!/bin/bash
> 
> #test to see if script is being run from GRASS
> 
> if test "$GISBASE" = ""; then
>         echo "You must be in GRASS to run this program"
>         exit
> fi
> 
> for MAP in `ls ~/projects/mn_dnr/shape_files/forties/county/*.shp`; do
>     v.in.ogr -o dsn=~/projects/mn_dnr/shape_files/forties/county/  
> output=`ba\
> sename $MAP .shp` layer=`basename $MAP .shp`;
> 
> done
> ================================================
> 
> to import a bunch (>100) shape files. When I run the script on the  
> whole directory of shape files, I get the error:
> 
> ERROR 4: Unable to open /Network/Servers/truffula.fr.umn.edu/Volumes/ 
> disk1/home1/kwythers/projects/mn_dnr/shape_files/forties/county/ 
> wrig_forties.shx or /Network/Servers/truffula.fr.umn.edu/Volumes/ 
> disk1/home1/kwythers/projects/mn_dnr/shape_files/forties/county/ 
> wrig_forties.SHX.
> 
> repeated for every shape file. However, if I run the same script on  
> just a few files, the world is cool. So far I have run it on 1 file,  
> 3 files, 6 files, and 20 files. I am about to try 50 or so files. Has  
> anyone see this kind of behavior before?
 
Kirk,

I guess that the parameter length created by `ls *...` is
exceeding a Un*x limit (for the shell or whatever).
You may try to rewrite it to first go into the
directory, then run the loop in that directory.

Markus




More information about the grass-dev mailing list