[GRASS5] r.in.srtm zip check

Hamish hamish_nospam at yahoo.com
Sun Mar 19 20:25:52 EST 2006


r.in.srtm has this check:

if test ! -f $FILE.hgt.zip ; then
 echo "File '$FILE.hgt.zip' not found"
 exit 1
fi

ls -1 "$FILE.hgt.zip" | grep zip > /dev/null
if [ $? -ne 0 ] ; then
  echo "$FILE.hgt.zip is no zip file."
  exit 1
fi


is the second one meant to be a check to see that file is a valid ZIP
file? If so, better to check against `file $FILE.hgt.zip` ?

also it should check that `unzip` exists, ala awk. On Debian at least I
don't think it is installed by default. Currently exits cleanly if not
there.



Hamish




More information about the grass-dev mailing list