'schedule': small improvements.

This commit is contained in:
vonavi 2013-10-20 14:08:46 +03:00
parent 91c0bb76ab
commit 356311c217

View File

@ -49,16 +49,16 @@ shift
# Generate the sequence of tours to search in # Generate the sequence of tours to search in
if [[ -z "$@" ]]; then if [[ -z "$@" ]]; then
tours=$(seq -f "%02g" 1 99) seq=$(seq -f "%02g" 1 99)
else else
# Change tour numbers: '1' -> '01', '2' -> '02', and so on # 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 fi
for tour in $tours; do for num in $seq; do
# Store 'tour_info' in an array of lines # 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=() lines=()
while read line; do while read line; do
lines+=("$line") lines+=("$line")
@ -79,7 +79,7 @@ for tour in $tours; do
# In addition, if the player was passed as an # In addition, if the player was passed as an
# argument, check if this is his game or not # 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" unskip="yes"
# Complete player's name # Complete player's name
player=$(grep -o "[^ ]*${name}[^ ]*" <<< "$line") player=$(grep -o "[^ ]*${name}[^ ]*" <<< "$line")