# usaco list list_by_mtime() { # list subdirs of $1 oldest-first by last modification [[ -d "$1" ]] || return 0 for d in "$1"/*/; do [[ -d "$d" ]] || continue printf '%s\t%s\n' "$(last_touched "${d%/}")" "$(basename "$d")" done | sort -n | cut -f2 | sed 's/^/ /' } echo "== Solving ==" list_by_mtime "$ROOT/solving" echo echo "== Solved ==" list_by_mtime "$ROOT/solved" if [[ -d "$ROOT/skipped" && -n "$(ls -A "$ROOT/skipped" 2>/dev/null)" ]]; then echo echo "== Skipped ==" list_by_mtime "$ROOT/skipped" fi