1
Fork 0
lorchess/schedule.sh

32 lines
800 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/usr/bin/env bash
mynick=iVS
repo=fat0troll/lorchess
tournament=autumn2013
# Note that we use `"$@"' to let each command-line parameter expand to a
# separate word. The quotes around `$@' are essential!
# We need ARGS as the `eval set --' would nuke the return value of getopt.
args=`getopt --options n: --longoptions nick: -- "$@"`
# Note the quotes around `$ARGS': they are essential!
eval set -- "$args"
if [[ $1 == -n ]] || [[ $1 == --nick ]]; then
name=$2
shift 3
else
name=$mynick
shift
fi
for tour in $@; do
# Change tour numbers: `1' -> `01', `2' -> `02', and so on
tour=0"$tour"
tour=${tour:(-2)}
url=https://raw.github.com/$repo/master/$tournament/tour_$tour/tour_info
curl -q --silent $url | egrep "Тур|Время|$name"
echo " ***"
done