From 017230874f26804a73058ce7549eb843aa5dd391 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 16 Feb 2023 04:54:55 -0800 Subject: [PATCH] Fix dead links in winning entries in years.html Some of the links had to be manually updated (including by downloading from the IOCCC website some missing files which I'm not even sure how they were missing from the repo) and others were fixed via sgit. To demonstrate its usage the following command removes from years.html the patterns 'hint.html' and '\.hint' with tracing enabled and verbosity of level 2. Notice how in this case the patterns are just deleted but one could substitute it for something else or run other sed commands as well. There was no need to specify sed options or the -I option (which means don't use the -i option to sed). If this change needed to be done in the entire repo 'years.html' could have been instead just '.' (if at the root directory of the repo). One can specify more than one glob just as one can specify more than one command (as of the bug fix in commit 05e83b60ff95279ef652a45f24d9d6eede5bfd69). $ bin/sgit -x -v 2 -e '/hint.html/d' -e '/\.hint/d' years.html + getopts :hVv:xIo:s:e: flag + case "$flag" in + VERBOSITY=2 + getopts :hVv:xIo:s:e: flag + case "$flag" in + SED_COMMANDS+=(-e "$OPTARG") + getopts :hVv:xIo:s:e: flag + case "$flag" in + SED_COMMANDS+=(-e "$OPTARG") + getopts :hVv:xIo:s:e: flag + shift 7 + [[ -z -e /hint.html/d -e /\.hint/d ]] + [[ -z /opt/local/bin/sed ]] + [[ ! -f /opt/local/bin/sed ]] + [[ ! -x /opt/local/bin/sed ]] + [[ 2 -eq 0 ]] + git status + status=0 + [[ 0 -ne 0 ]] + [[ 2 -gt 1 ]] + echo 'debug[2]: sed commands: -e /hint.html/d -e /\.hint/d' debug[2]: sed commands: -e /hint.html/d -e /\.hint/d + [[ 2 -gt 1 ]] + echo 'debug[2]: looping through all globs' debug[2]: looping through all globs + i=0 + [[ 0 -le 2 ]] + [[ 2 -gt 1 ]] + echo 'debug[2]: found glob: README.md' debug[2]: found glob: README.md + [[ 2 -ge 1 ]] + [[ -z '' ]] + [[ -n '' ]] + echo 'debug[1]: about to run: git ls-files README.md | xargs /opt/local/bin/sed -i"" -e /hint.html/d -e /\.hint/d' debug[1]: about to run: git ls-files README.md | xargs /opt/local/bin/sed -i"" -e /hint.html/d -e /\.hint/d + [[ -z '' ]] + [[ -n '' ]] + git ls-files README.md + xargs /opt/local/bin/sed -i -e /hint.html/d -e '/\.hint/d' + (( i++ )) + shift 1 + [[ 1 -le 1 ]] + [[ 2 -gt 1 ]] + echo 'debug[2]: found glob: years.html' debug[2]: found glob: years.html + [[ 2 -ge 1 ]] + [[ -z '' ]] + [[ -n '' ]] + echo 'debug[1]: about to run: git ls-files years.html | xargs /opt/local/bin/sed -i"" -e /hint.html/d -e /\.hint/d' debug[1]: about to run: git ls-files years.html | xargs /opt/local/bin/sed -i"" -e /hint.html/d -e /\.hint/d + [[ -z '' ]] + [[ -n '' ]] + git ls-files years.html + xargs /opt/local/bin/sed -i -e /hint.html/d -e '/\.hint/d' + (( i++ )) + shift 1 + [[ 2 -le 0 ]] --- years.html | 269 ++--------------------------------------------------- 1 file changed, 8 insertions(+), 261 deletions(-) diff --git a/years.html b/years.html index 02d442e6f..a53168074 100644 --- a/years.html +++ b/years.html @@ -273,7 +273,6 @@ Contest @@ -391,7 +382,6 @@ Contest @@ -435,7 +423,6 @@ Contest