From ead8e902e45327ce477615a5f4f6608a5f36350e Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Tue, 28 Jun 2005 07:56:57 +0000 Subject: [PATCH] bugfix: uses awk instead of cut for splitting query output (no more empty string) --- helm/matita/scripts/crontab.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helm/matita/scripts/crontab.sh b/helm/matita/scripts/crontab.sh index 926a9750c..20bd7b076 100644 --- a/helm/matita/scripts/crontab.sh +++ b/helm/matita/scripts/crontab.sh @@ -1,3 +1,4 @@ +#!/bin/bash MARK=`date +%Y%m%d` LASTMARK=`date -d yesterday +%Y%m%d` TMPDIRNAME=.__${MARK}_crontab @@ -10,8 +11,8 @@ cd $TMPDIRNAME #cvs -d $CVSROOT co helm/matita/scripts 1>/dev/null 2>/dev/null #helm/matita/scripts/profile_cvs.sh 2> LOG -CUR_TIME=`echo "select mark, SUM(TIME_TO_SEC(time)) from bench where mark = \"$MARK\" group by mark;" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1 | cut -f 2` -OLD_TIME=`echo "select mark, SUM(TIME_TO_SEC(time)) from bench where mark = \"$LASTMARK\" group by mark;" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1 | cut -f 2` +CUR_TIME=`echo "select mark, SUM(TIME_TO_SEC(time)) from bench where mark = \"$MARK\" group by mark;" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1 | awk '{print $2}'` +OLD_TIME=`echo "select mark, SUM(TIME_TO_SEC(time)) from bench where mark = \"$LASTMARK\" group by mark;" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1 | awk '{print $2}'` ((DELTA=$CUR_TIME - $OLD_TIME)) if [ $DELTA -lt 0 ]; then ((DELTA=$DELTA * -1)) -- 2.39.2