From d39aebcb0e8d8465b977947e5f503fd8bbfa9beb Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:28:11 -0800 Subject: [PATCH] Improve 2015/mills2/try.sh --- 2015/mills2/try.sh | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/2015/mills2/try.sh b/2015/mills2/try.sh index f3a820bb8..213be2147 100755 --- a/2015/mills2/try.sh +++ b/2015/mills2/try.sh @@ -15,47 +15,51 @@ make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear - -echo "$ printf '000I\236\f\31H\260\240\301\203' > ioccc.Z" 1>&2 +read -r -n 1 -p "Press any key to run: printf '000I\236\f\31H\260\240\301\203' > ioccc.Z: " +echo 1>&2 printf '000I\236\f\31H\260\240\301\203' > ioccc.Z echo 1>&2 -echo "$ ./prog ioccc.Z" 1>&2 +read -r -n 1 -p "Press any key to run: ./prog ioccc.Z: " +echo 1>&2 ./prog ioccc.Z echo 1>&2 -echo "$ dd bs=512 count=128 < /dev/urandom > test1" 1>&2 +read -r -n 1 -p "Press any key to run: dd bs=512 count=128 < /dev/urandom > test1: " +echo 1>&2 dd bs=512 count=128 < /dev/urandom > test1 echo 1>&2 -echo "$ compress < test1 > test1.Z" 1>&2 +read -r -n 1 -p "Press any key to run: compress < test1 > test1.Z: " +echo 1>&2 compress < test1 > test1.Z echo 1>&2 -echo "$ time ./prog test1.Z | cmp - test1" 1>&2 -time ./prog test1.Z | cmp - test1 +read -r -n 1 -p "Press any key to run: time ./prog test1.Z | diff -s - test1: " +echo 1>&2 +time ./prog test1.Z | diff -s - test1 echo 1>&2 -echo "$ dd bs=512 count=128 < /dev/zero > test2" 1>&2 +read -r -n 1 -p "Press any key to run: dd bs=512 count=128 < /dev/zero > test2: " +echo 1>&2 dd bs=512 count=128 < /dev/zero > test2 echo 1>&2 -echo "$ compress < test2 > test2.Z" 1>&2 +read -r -n 1 -p "Press any key to run: compress < test2 > test2.Z: " +echo 1>&2 compress < test2 > test2.Z echo 1>&2 -echo "$ time ./prog test2.Z | cmp - test2" 1>&2 -time ./prog test2.Z | cmp - test2 +read -r -n 1 -p "Press any key to run: time ./prog test2.Z | diff -s - test2: " +echo 1>&2 +time ./prog test2.Z | diff -s - test2 echo 1>&2 +read -r -n 1 -p "Press any key to run: ./prog ioccc_guidelines.txt.Z (space = next page, q = quit): " +echo 1>&2 +./prog ioccc_guidelines.txt.Z | less -rEXFK +echo 1>&2 -echo "$ ./prog ioccc_guidelines.txt.Z" 1>&2 -read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " +read -r -n 1 -p "Press any key to run: ./prog ioccc_rules.txt.Z (space = next page, q = quit): " echo 1>&2 -./prog ioccc_guidelines.txt.Z | less -EXF - -echo 1>&2 -echo "$ ./prog ioccc_rules.txt.Z" 1>&2 -read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " -echo 1>&2 -./prog ioccc_rules.txt.Z | less -EXF +./prog ioccc_rules.txt.Z | less -rEXFK