#!/bin/bash set -eu -o pipefail curl -fsS https://adventofcode.com/2024/day/"$1" | awk '/
/ {sub("
", ""); CODE=1; IDX+=1} /<\/code>/ {CODE=0} CODE {print > sprintf("sample%d.in", IDX)}'