From d34236e105bd9f0bc71a2742b7a8c107681572b8 Mon Sep 17 00:00:00 2001 From: vonavi Date: Mon, 23 Sep 2013 15:04:10 +0300 Subject: [PATCH] Highlight score. --- schedule.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/schedule.sh b/schedule.sh index 8d023c3..53e3a83 100755 --- a/schedule.sh +++ b/schedule.sh @@ -4,6 +4,9 @@ myname=iVS repo=fat0troll/lorchess tournament=autumn2013 +# Variables +score='\(0\|1\|0\.5\):\(0\|1\|0\.5\)' + # Colors green='\\033[01;32m' red='\\033[01;31m' @@ -34,8 +37,9 @@ for tour in $@; do echo ">>>" curl -q --silent $url | egrep "Тур|Время|$name" | while read line;do - # Colorize the player name - output=$(echo $line | sed "s/${name}/${red}${name}${restore}/g") - echo -e $output + # Colorize output + line=$(echo $line | sed "s/${score}/${green}\0${restore}/g") + line=$(echo $line | sed "s/${name}/${red}\0${restore}/g") + echo -e $line done done