#!/bin/bash DAY="${1}" INPUT="${2:-input.txt}" if [ -z "${DAY}" ]; then echo "usage: ${0} [inputfile]" exit 1 fi set -euo pipefail cd "${DAY}" if [ ! -f "${INPUT}" ]; then echo "${INPUT} not found in ${DAY}" exit 1 fi ghc -O2 ../utils.hs main.hs && (cat "${INPUT}" | ./main)