[GRASSLIST:1042] Re: openstreetmap data import into GRASS

Glynn Clements glynn at gclements.plus.com
Mon May 8 17:41:49 EDT 2006


Hamish wrote:

> problem:
> 
> while [ $ERRORCODE -eq 0 ] ; do
>   read LINE
>   ERRORCODE=$?
>   test $ERRORCODE && continue
>   if `echo $LINE | grep` ; then
>     do_minimal_stuff()
>   fi
> done < 100mb_file.txt
> 
> bash takes 800mb ram (that's ok, I've got lots, no swapping) but runs
> *incredibly* slowly. Like 80486-SX slowly.
> 
> why is that? What's a better way of working through lines containing
> spaces? Set the file as a fd to pass to `read` instead of via redirect?

Spawning one grep process per line isn't particularly efficient.

What is that test meant to do?

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-user mailing list