[GRASS-SVN] r53349 - grass-promo/tutorials/batch_processing/earthquakes

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 9 16:20:49 PDT 2012


Author: hamish
Date: 2012-10-09 16:20:48 -0700 (Tue, 09 Oct 2012)
New Revision: 53349

Modified:
   grass-promo/tutorials/batch_processing/earthquakes/do_quakes_latlon.sh
   grass-promo/tutorials/batch_processing/earthquakes/do_quakes_wintri.sh
Log:
USGS changed the datestamp format slightly, adjust to be more flexible

Modified: grass-promo/tutorials/batch_processing/earthquakes/do_quakes_latlon.sh
===================================================================
--- grass-promo/tutorials/batch_processing/earthquakes/do_quakes_latlon.sh	2012-10-09 22:02:55 UTC (rev 53348)
+++ grass-promo/tutorials/batch_processing/earthquakes/do_quakes_latlon.sh	2012-10-09 23:20:48 UTC (rev 53349)
@@ -112,7 +112,7 @@
 
 
 # get the timestamp
-YMD=`head -n 2 "$INPUT" | tail -n 1 | cut -f4 -d'|' | cut -f2-4 -d' '`
+YMD=`head -n 2 "$INPUT" | tail -n 1 | cut -f4 -d'|' | awk '{print $2,$3,$4}'`
 if [ `echo "$YMD" | wc -c` -lt 11 ] ; then
     echo "Bad timestamp ($YMD). Using system date instead." >&2
     YMD=`date +%Y/%m/%d`

Modified: grass-promo/tutorials/batch_processing/earthquakes/do_quakes_wintri.sh
===================================================================
--- grass-promo/tutorials/batch_processing/earthquakes/do_quakes_wintri.sh	2012-10-09 22:02:55 UTC (rev 53348)
+++ grass-promo/tutorials/batch_processing/earthquakes/do_quakes_wintri.sh	2012-10-09 23:20:48 UTC (rev 53349)
@@ -123,7 +123,7 @@
 
 # get the timestamp
 #YMD=20`tail -n 1 "$INPUT"  | cut -f1 -d,`
-YMD=`head -n 2 "$INPUT" | tail -n 1 | cut -f4 -d'|' | cut -f2-4 -d' '`
+YMD=`head -n 2 "$INPUT" | tail -n 1 | cut -f4 -d'|' | awk '{print $2,$3,$4}'`
 if [ `echo "$YMD" | wc -c` -lt 11 ] ; then
     echo "Bad timestamp ($YMD). Using system date instead." >&2
     YMD=`date +%Y/%m/%d`



More information about the grass-commit mailing list