[GRASS5] r.in.wms

Hamish hamish_nospam at yahoo.com
Sun Jan 15 22:00:46 EST 2006

> For every body, who is using this script: it could destroy your .*
> files!  I'm really sorry, for annoucing this. 
> If the variable $IMAGEFILE is not set, the script could start to
> remove all '.*' files in current directory -- see line 67 of the
> script. It should not happen. But it could, I'm not by the linux
> machine now, to test the conditions...
> I'm working on new version, which is able to pool avaliable layers
> from the server first (GetCapabilities) and in this version, I will
> take more care about it.

If it is possible, it is good to create, cd, and install files into a TMP
grass directory using the g.tempfile module. This makes it harder to make 
these sorts of mistakes and if the script is aborted any left over files 
are automatically cleaned when you leave grass.

see the v.in.garmin and r.in.srtm scripts for examples.

> If you are using the script, pleace, change the line 67 for example to
> if [ "${IMAGEFILE}" != "" ]; then
>           rm -iv ${IMAGEFILE}.*
> fi

better for cross-platform portability:

if [ -n "${IMAGEFILE}" ]; then

(-n means non-zero,  == "" is -z)

[SUBMITTING_SCRIPTS file updated in 6.1 CVS]


More information about the grass-dev mailing list