#!/usr/bin/env bash # e2e/print-log-summary.sh # Usage: ./print-log-summary.sh [N] # Prints the last N entries from e2e/LOG.md (default 5 entries) set -euo pipefail N=${1:-5} LOG_FILE="$(dirname "$0")/LOG.md" if [ ! -f "$LOG_FILE" ]; then echo "LOG.md not found: $LOG_FILE" >&2 exit 1 fi # Collect blocks that start with '## ' awk -v RS="^## " 'NR>1{print "## " $0}' "$LOG_FILE" | awk 'BEGIN{count=0} {blocks[count++]=$0} END{start=(count>='"$N"')?(count-"$N"):"0"; for(i=start;i