From f6188dd4d87e2cead339f73403dbe694fd656476 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 31 Jan 2024 06:13:21 -0800 Subject: [PATCH] Improve 2018/yang/try.sh + fix make clobber The script now compiles generated1.c and runs it. This might actually be one of the others (some of the generated*.c files have the same effect) but it's perhaps interesting to show nonetheless. This is only done if the spoilers option is selected. Update .gitignore with better globs. Fixed make clobber to remove generated* rather than generated*.c. --- 2018/yang/.gitignore | 8 ++------ 2018/yang/Makefile | 2 +- 2018/yang/try.sh | 5 +++++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/2018/yang/.gitignore b/2018/yang/.gitignore index c6778fac1..036a96ef2 100644 --- a/2018/yang/.gitignore +++ b/2018/yang/.gitignore @@ -1,16 +1,12 @@ # # sort with: sort -d -u *.dSYM -generated1.c -generated2.c -generated3.c -generated4.c -generated5.c +generated* indent indent.c indent.o left -msg[0-9] +msg* no_leading_space.txt prog prog.orig diff --git a/2018/yang/Makefile b/2018/yang/Makefile index 69358ef13..796b3104a 100644 --- a/2018/yang/Makefile +++ b/2018/yang/Makefile @@ -324,7 +324,7 @@ clean: clobber: clean ${RM} -f ${TARGET} ${ALT_TARGET} ${RM} -rf *.dSYM - ${RM} -f generated*.c msg* + ${RM} -f generated* msg* @-if [ -e sandwich ]; then \ ${RM} -f sandwich; \ echo 'ate sandwich'; \ diff --git a/2018/yang/try.sh b/2018/yang/try.sh index e0af83658..0c506a83f 100755 --- a/2018/yang/try.sh +++ b/2018/yang/try.sh @@ -80,4 +80,9 @@ if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then read -r -n 1 -p "Press any key to run: ./msg9 < prog.c: " echo 1>&2 ./msg9 < prog.c + + make generated1 1>/dev/null || exit 1 + read -r -n 1 -p "Press any key to run: echo IOCCC | ./generated1: " + echo 1>&2 + echo IOCCC | ./generated1 fi