[Dive4elements-commits] [PATCH] be more flexible with river names (e.g. containing white space) in import script

Wald Commits scm-commit at wald.intevation.org
Wed Mar 27 15:26:59 CET 2013


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1364394411 -3600
# Node ID 7c646d4d5103a55a79b335faf0a602f2fb1059cd
# Parent  e667c127b60085a93732e05ffa6599316a30d580
be more flexible with river names (e.g. containing white space) in import script

diff -r e667c127b600 -r 7c646d4d5103 flys-backend/contrib/import_river.sh
--- a/flys-backend/contrib/import_river.sh	Wed Mar 27 13:02:53 2013 +0100
+++ b/flys-backend/contrib/import_river.sh	Wed Mar 27 15:26:51 2013 +0100
@@ -156,9 +156,9 @@
 fi
 
 GEW_FILE="$1"
-RIVER_NAME=$(grep "Gew.sser" "$1" | awk '{print $2}')
+RIVER_NAME=$(grep "Gew.sser" "$1" | sed 's/Gew.sser: //')
 DATE=$(date +%Y.%m.%d_%H%M)
-LOG_DIR=${LOG}/${RIVER_NAME}-$DATE
+LOG_DIR=${LOG}/`basename $GEW_FILE .gew`-$DATE
 mkdir -p ${LOG_DIR}
 
 if [ "$POSTGRES" = "TRUE" ]; then


More information about the Dive4elements-commits mailing list