diff --git a/1996/schweikh2/Makefile b/1996/schweikh2/Makefile index 9f7b36c43..e438813d4 100644 --- a/1996/schweikh2/Makefile +++ b/1996/schweikh2/Makefile @@ -203,6 +203,7 @@ clean: clobber: clean ${RM} -f ${TARGET} ${ALT_TARGET} ${RM} -rf *.dSYM + ${RM} -f obfus.c @-if [ -e sandwich ]; then \ ${RM} -f sandwich; \ echo 'ate sandwich'; \ diff --git a/1996/schweikh2/README.md b/1996/schweikh2/README.md index bf4d88267..339033c75 100644 --- a/1996/schweikh2/README.md +++ b/1996/schweikh2/README.md @@ -57,6 +57,10 @@ appropriately. Try: perl ./hunni.pl < hunni.c ``` +NOTE: the [try.sh](%%REPO_URL%%/1996/schweikh2/try.sh) does this if you have +`perl(1)` installed to show how the output is the same as +[schweikh2.c](%%REPO_URL%%/1996/schweikh2/schweikh2.c) itself. + This entry was another crowd pleaser at the IOCCC BOF. diff --git a/1996/schweikh2/index.html b/1996/schweikh2/index.html index a90f3cffb..be392dbae 100644 --- a/1996/schweikh2/index.html +++ b/1996/schweikh2/index.html @@ -422,6 +422,9 @@ appropriately. Try:
less hunni.c
perl ./hunni.pl < hunni.c
+NOTE: the try.sh does this if you have
+perl(1) installed to show how the output is the same as
+schweikh2.c itself.
This entry was another crowd pleaser at the IOCCC BOF.
Note: the source must be viewed with tabstop 8. To appreciate the diff --git a/1996/schweikh2/try.sh b/1996/schweikh2/try.sh index 6e8fc68da..da7a34f41 100755 --- a/1996/schweikh2/try.sh +++ b/1996/schweikh2/try.sh @@ -29,3 +29,30 @@ read -r -n 1 -p "Press any key to run grep -v '#' schweikh2.c (space = next page echo 1>&2 grep -v '#' schweikh2.c | less -rEXF echo 1>&2 + +PERL="$(type -P perl)" +if [[ -n "$PERL" ]]; then + read -r -n 1 -p "Press any key to run: less hunni.c (space = next page, q = quit): " + echo 1>&2 + less -rEXF hunni.c + echo 1>&2 + + echo "$ perl ./hunni.pl < hunni.c > obfus.c" 1>&2 + read -r -n 1 -p "Press any key to obfuscate hunni.c as obfus.c (space = next page, q = quit): " + echo 1>&2 + perl ./hunni.pl < hunni.c > obfus.c + + read -r -n 1 -p "Press any key to run: diff -s obfus.c schweikh2.c: " + echo 1>&2 + diff -s obfus.c schweikh2.c + rm -f obfus.c +fi + +read -r -p "Do you want to run the author's suggested command (Y/N)? " +if [[ "$REPLY" = "y" || "$REPLY" = "Y" ]]; then + echo "Warning: this command is an infinite loop. Press ctrl-c or whatever your" 1>&2 + echo "intr is to end it." 1>&2 + read -r -n 1 -p "Press any key to continue: " + echo 1>&2 + while :; do grep -v '#' schweikh2.c; sleep 2; echo; done +fi