From 9f5964ec1bd667316fd05102ea12c0bb01777a6d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 28 Jan 2024 09:17:01 -0800 Subject: [PATCH] Fix make clobber in 2014/endoh2 Since the try script creates the files hello.c, hello, ioccc.c and ioccc the clobber rule needs to remove those files. The script now uses less(1) for longer output (it's possible there are still small enough displays where it would be useful). --- 2014/endoh2/Makefile | 2 +- 2014/endoh2/try.sh | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/2014/endoh2/Makefile b/2014/endoh2/Makefile index 4befe3606..120097ebf 100644 --- a/2014/endoh2/Makefile +++ b/2014/endoh2/Makefile @@ -201,7 +201,7 @@ clean: fi clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} + ${RM} -f ${TARGET} ${ALT_TARGET} ioccc ioccc.c hello hello.c ${RM} -rf *.dSYM @-if [ -e sandwich ]; then \ ${RM} -f sandwich; \ diff --git a/2014/endoh2/try.sh b/2014/endoh2/try.sh index 0fbfd5a61..42a4cdf7f 100755 --- a/2014/endoh2/try.sh +++ b/2014/endoh2/try.sh @@ -15,14 +15,14 @@ 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: echo Hello | ./prog: " +read -r -n 1 -p "Press any key to run: echo Hello | ./prog (space = next page, q = quit): " echo 1>&2 -echo Hello | ./prog +echo Hello | ./prog | less -rEXFK echo 1>&2 -read -r -n 1 -p "Press any key to run: echo IOCCC | ./prog: " +read -r -n 1 -p "Press any key to run: echo IOCCC | ./prog (space = next page, q = quit): " echo 1>&2 -echo IOCCC | ./prog +echo IOCCC | ./prog | less -rEXFK echo 1>&2 read -r -n 1 -p "Press any key to run: echo Hello | ./prog > hello.c: " @@ -30,6 +30,13 @@ echo 1>&2 echo Hello | ./prog > hello.c echo 1>&2 +# we don't use tee(1) above as it makes the message longer and it's not strictly +# necessary +read -r -n 1 -p "Press any key to show hello.c (space = next page, q = quit): " +echo 1>&2 +less -rEXFK hello.c +echo 1>&2 + read -r -n 1 -p "Press any key to compile hello.c: " echo 1>&2 make hello >/dev/null