3 DAY=`date +%d|sed 's/ //g'`
4 URLDAY=`echo $DAY|sed 's/^0//'`
5 test -n "$1" && DAY="$1"
6 FILE="$((2*URLDAY - 1))in.txt"
8 UA="User-Agent: kas at yenya.net, https://www.fi.muni.cz/~kas/git/aoc.git"
12 STARTSEC=`date -d "$START" "+%s"`
14 WAITSEC=`expr $STARTSEC - $NOW`
16 if [ $WAITSEC -gt 0 -a $WAITSEC -lt $MAXWAIT ]
18 echo "Waiting for $WAITSEC seconds till $START for getting $FILE ..."
22 URL="https://adventofcode.com/2022/day/$URLDAY/input"
24 echo "Downloading $URL to $FILE"
25 curl -s -b "$COOKIE" -A "$UA" "$URL" --output "$FILE"
26 echo ========================================================================
28 echo ========================================================================
29 echo "lines words chars"