[GRASS5] scripting r.in.gdal

Moritz Lennert mlennert at club.worldonline.be
Wed Jun 30 04:41:55 EDT 2004


>
> Moritz Lennert wrote:
>
>> newname = `echo $file | awk '{print tolower($1)}`
>
> Apart from the syntax errors (there shouldn't be any spaces around the
> equals sign, and the closing single quote is missing), I would expect
> "tr" to be more efficient than awk:
>
> 	newname=`echo $file | tr A-Z a-z`
>
> Although, you could improve efficiency further (particularly on
> Cygwin, where the overhead for spawning commands is substantial) with:
>
> 	ls *.tif | awk '{print "r.in.gdal in=" $1 " out=" tolower($1)}' | sh
>

Don't know about the efficiency question, but I apologize to Kirk for the
careless syntax errors. Didn't take enough time for rereading what I
wrote.

Moritz




More information about the grass-dev mailing list