3 DAY=`date +%d|sed 's/ //g'`
4 test -n "$1" && DAY="$1"
5 FILE="$((2*DAY - 1))in.txt"
10 STARTSEC=`date -d "$START" "+%s"`
12 WAITSEC=`expr $STARTSEC - $NOW`
14 if [ $WAITSEC -gt 0 -a $WAITSEC -lt $MAXWAIT ]
16 echo "Waiting for $WAITSEC seconds till $START for getting $FILE ..."
20 URL="https://adventofcode.com/2015/day/$DAY/input"
22 echo "Downloading $URL to $FILE"
23 curl -s -b "$COOKIE" "$URL" --output "$FILE"
24 echo ========================================================================
26 echo ========================================================================
27 echo "lines words chars"