From ff56edf8058a9885167e5baaa696f5e1cecdd4a3 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:15:57 -0800 Subject: [PATCH 1/6] Add more strings to 2005/klausler/try.sh Now includes: Dennis Ritchie, Ken Thompson and Linus Torvalds. Fun anagrams, some of which are not shown in the output: DENNIS RITCHIE = INDECENT IRISH = SHIRE INCIDENT KEN THOMPSON = SPOKEN MONTH LINUS TORVALDS = VILLOUS STRAND (VILLOUS is a word of anatomy, medical and botany). --- 2005/klausler/try.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/2005/klausler/try.sh b/2005/klausler/try.sh index 31991126a..d81452ebd 100755 --- a/2005/klausler/try.sh +++ b/2005/klausler/try.sh @@ -74,3 +74,18 @@ read -r -n 1 -p "Press any key to run: ./klausler werewolf vampire | head -n 10: echo 1>&2 ./klausler werewolf vampire | head -n 10 echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./klausler dennis ritchie | head -n 10: " +echo 1>&2 +./klausler dennis ritchie | head -n 10 +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./klausler ken thompson | head -n 10: " +echo 1>&2 +./klausler ken thompson | head -n 10 +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./klausler Linus Torvalds | head -n 10: " +echo 1>&2 +./klausler linus torvalds | head -n 10 +echo 1>&2 From 7013fc901fa09e1eb6c7ad5a24789a18bebc0eed Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:41:38 -0800 Subject: [PATCH 2/6] Fix 2005/mikeash/try.sh (shellcheck and otherwise) --- 2005/mikeash/try.sh | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/2005/mikeash/try.sh b/2005/mikeash/try.sh index 11488cc55..c79e40722 100755 --- a/2005/mikeash/try.sh +++ b/2005/mikeash/try.sh @@ -18,21 +18,19 @@ clear read -r -n 1 -p "Press any key to run: ./mikeash < mikeash.c (space = next page, q = quit): " echo 1>&2 -./mikeash < mikeash.c +./mikeash < mikeash.c | less -rEXFK echo 1>&2 echo 1>&2 -echo "The next command should print nothing." 1>&2 -read -r -n 1 -p "Press any key to run: ./mikeash < mikeash.c | diff - mikeash.c: " +read -r -n 1 -p "Press any key to run: ./mikeash < mikeash.c | diff -s - mikeash.c: " echo 1>&2 -# ShellCheck is incorrect here: -# -# SC2094 (info): Make sure not to read and write the same file in the same pipeline. -# -# so we disable it. + +# We're not reading and writing to the same file at all. # +# SC2094 (info): Make sure not to read and write the same file in the same pipeline. +# https://www.shellcheck.net/wiki/SC2094 # shellcheck disable=SC2094 -./mikeash < mikeash.c | diff - mikeash.c +./mikeash < mikeash.c | diff -s - mikeash.c echo 1>&2 echo "For the next two commands we will add a newline after the command's output" 1>&2 @@ -45,15 +43,7 @@ echo '(format t "~s" (+ 2 2 ))' | ./mikeash echo 1>&2 echo "The next command will evaluate the expression: (2+2) * (5 - 9/3), giving 8\"." 1>&2 - -# ShellCheck warns: -# -# SC2140 (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"? -# -# ShellCheck is wrong. -# -# shellcheck disable=SC2140 -read -r -n 1 -p "Press any key to run: echo '(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash: " +read -r -n 1 -p "Press any key to run: echo '(format t \"~s\" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash: " echo 1>&2 echo '(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash echo 1>&2 From 75f830ee57c755b852a3481a437443e6fbdf11f0 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:44:28 -0800 Subject: [PATCH 3/6] Fix 2005/persano make clobber, .gitignore, try.sh The make clobber fix is important for updating the manifest. The .gitignore left a .gif file out but now it just ignores '*.gif'. The script was updated with some newlines to separate commands. --- 2005/persano/.gitignore | 3 +-- 2005/persano/Makefile | 2 +- 2005/persano/try.sh | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/2005/persano/.gitignore b/2005/persano/.gitignore index e47484bec..a8cd03994 100644 --- a/2005/persano/.gitignore +++ b/2005/persano/.gitignore @@ -1,11 +1,10 @@ # # sort with: ../../bin/sgi *.dSYM -foo.gif +*.gif indent indent.c indent.o persano persano.orig prog.orig -seal.gif diff --git a/2005/persano/Makefile b/2005/persano/Makefile index 8c7302eef..57b5d448b 100644 --- a/2005/persano/Makefile +++ b/2005/persano/Makefile @@ -207,7 +207,7 @@ clean: clobber: clean ${RM} -f ${TARGET} ${ALT_TARGET} - ${RM} -rf *.dSYM + ${RM} -rf *.dSYM *.gif @-if [ -e sandwich ]; then \ ${RM} -f sandwich; \ echo 'ate sandwich'; \ diff --git a/2005/persano/try.sh b/2005/persano/try.sh index f9a45f5ec..7d27d53a7 100755 --- a/2005/persano/try.sh +++ b/2005/persano/try.sh @@ -24,6 +24,7 @@ if [[ -f knot3-16.gif ]]; then echo "Now open the file knot3-16.gif in a GIF viewer capable of viewing animated" 1>&2 echo "GIFs. See the README.md for details on a tool to manipulate it, if you wish." 1>&2 fi +echo 1>&2 read -r -n 1 -p "Press any key to run: ./persano 3 2 1 > foo.gif: " echo 1>&2 @@ -33,6 +34,7 @@ if [[ -f foo.gif ]]; then echo "Now open the file foo.gif in a GIF viewer capable of viewing animated" 1>&2 echo "GIFs. See the README.md for details on a tool to manipulate it, if you wish." 1>&2 fi +echo 1>&2 read -r -n 1 -p "Press any key to run: ./persano 5 2 > seal.gif: " echo 1>&2 @@ -43,3 +45,4 @@ if [[ -f seal.gif ]]; then echo "Now open seal.gif (Solomon's Seal knot) in a GIF viewer capable of viewing" 1>&2 echo "animated GIFs. See the README.md for details on a tool to manipulate it, if you wish." 1>&2 fi +echo 1>&2 From 2caf4e80b5e8bbb9c38e0c3a97d59139063240d1 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:49:46 -0800 Subject: [PATCH 4/6] Minor update to 2005/timwi/try.sh --- 2005/timwi/try.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/2005/timwi/try.sh b/2005/timwi/try.sh index 6a80c397a..21282d7c4 100755 --- a/2005/timwi/try.sh +++ b/2005/timwi/try.sh @@ -3,15 +3,14 @@ # try.sh - demonstrate IOCCC winner 2005/timwi # # This only does one thing and that is from the judges. This is because -# brainfuck has too much potential to knacker the brain. +# brainfuck has too much potential to knacker the brain so we don't try.sh to +# make it worse :-) # # make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it # this way allows us to have the user specify a different compiler in an easy # way. -if [[ -z "$CC" ]]; then - CC="cc" -fi +[[ -z "$CC" ]] && CC="cc" make CC="$CC" all >/dev/null || exit 1 From 890f2bede12259e56491934904e4d552e378da48 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:54:50 -0800 Subject: [PATCH 5/6] Minor improvements to 2006/birken/try.sh --- 2006/birken/try.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/2006/birken/try.sh b/2006/birken/try.sh index 7054b14e7..f891c8f0b 100755 --- a/2006/birken/try.sh +++ b/2006/birken/try.sh @@ -15,67 +15,67 @@ make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear -read -r -n 1 -p "Press any key to run: ./birken < adder.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < adder.tofu: " echo 1>&2 ./birken < adder.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < buffer.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < buffer.tofu: " echo 1>&2 ./birken < buffer.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < computer.tofu 2>/dev/null (space = next page, q = quit): " +read -r -n 1 -p "Press any key to run: ./birken < computer.tofu (space = next page, q = quit): " echo 1>&2 -./birken < computer.tofu 2>/dev/null | less -rEXF +./birken < computer.tofu 2>/dev/null | less -rEXFK echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < counter.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < counter.tofu: " echo 1>&2 ./birken < counter.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < divider.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < divider.tofu: " echo 1>&2 ./birken < divider.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < lfsr.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < lfsr.tofu: " echo 1>&2 ./birken < lfsr.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < memory.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < memory.tofu: " echo 1>&2 ./birken < memory.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < multiplier.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < multiplier.tofu: " echo 1>&2 ./birken < multiplier.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < multiplier2.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < multiplier2.tofu: " echo 1>&2 ./birken < multiplier2.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < oneline.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < oneline.tofu: " echo 1>&2 ./birken < oneline.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < shift.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < shift.tofu: " echo 1>&2 ./birken < shift.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < zuse.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < zuse.tofu: " echo 1>&2 ./birken < zuse.tofu 2>/dev/null echo 1>&2 -read -r -n 1 -p "Press any key to run: ./birken < zuse2.tofu 2>/dev/null: " +read -r -n 1 -p "Press any key to run: ./birken < zuse2.tofu: " echo 1>&2 ./birken < zuse2.tofu 2>/dev/null echo 1>&2 From 12d98ed1bd051a684767ea174fc155fa0d591fc9 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:56:36 -0800 Subject: [PATCH 6/6] Fix display problem in 2006/borsanyi/try.sh --- 2006/borsanyi/try.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/2006/borsanyi/try.sh b/2006/borsanyi/try.sh index 31df8b24f..173e9fe64 100755 --- a/2006/borsanyi/try.sh +++ b/2006/borsanyi/try.sh @@ -41,6 +41,7 @@ while :; do fi fi read -r -n 1 -p "Do you wish to make another one (Y/N)? " + echo 1>&2 if [[ "$REPLY" != "Y" && "$REPLY" != "y" ]]; then break fi