3 DAY=`date +%e|sed 's/ //g'`
4 FILE="$((2*DAY - 1))in.txt"
9 STARTSEC=`date -d "$START" "+%s"`
11 WAITSEC=`expr $STARTSEC - $NOW`
13 if [ $WAITSEC -gt 0 -a $WAITSEC -lt $MAXWAIT ]
15 echo "Waiting for $WAITSEC seconds till $START for getting $FILE ..."
19 URL="https://adventofcode.com/2021/day/$DAY/input"
21 echo "Downloading $URL to $FILE"
22 curl -s -b "$COOKIE" "$URL" --output "$FILE"
23 echo ========================================================================
25 echo ========================================================================
26 echo "lines words chars"