From 356311c21796857af2c46a11fa65c00c714972ae Mon Sep 17 00:00:00 2001 From: vonavi Date: Sun, 20 Oct 2013 14:08:46 +0300 Subject: [PATCH] 'schedule': small improvements. --- schedule | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/schedule b/schedule index 3908e8c..20a5b9c 100755 --- a/schedule +++ b/schedule @@ -49,16 +49,16 @@ shift # Generate the sequence of tours to search in if [[ -z "$@" ]]; then - tours=$(seq -f "%02g" 1 99) + seq=$(seq -f "%02g" 1 99) else # Change tour numbers: '1' -> '01', '2' -> '02', and so on - tours=$(for tour in "$@"; do printf "%02g " $tour; done) + seq=$(for num in "$@"; do printf "%02g " "$num"; done) fi -for tour in $tours; do +for num in $seq; do # Store 'tour_info' in an array of lines - url=https://raw.github.com/$REPO/master/$TOURNEY/tour_$tour/tour_info + url="https://raw.github.com/${REPO}/master/${TOURNEY}/tour_${num}/tour_info" lines=() while read line; do lines+=("$line") @@ -79,7 +79,7 @@ for tour in $tours; do # In addition, if the player was passed as an # argument, check if this is his game or not - elif [[ -n $(grep -o "[^ ]*${name}[^ ]*" <<< "$line") ]]; then + elif [[ -n $(grep -o "$name" <<< "$line") ]]; then unskip="yes" # Complete player's name player=$(grep -o "[^ ]*${name}[^ ]*" <<< "$line")