From a2d34d6fcfe08e7cfe87caaf5a75162a26ba7129 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:07:22 -0800 Subject: [PATCH] Improve 1998/tomtorfs/try.sh Get CC, defaulting to cc. --- 1998/tomtorfs/try.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/1998/tomtorfs/try.sh b/1998/tomtorfs/try.sh index b3189d7c0..f68f90c27 100755 --- a/1998/tomtorfs/try.sh +++ b/1998/tomtorfs/try.sh @@ -1,8 +1,20 @@ #!/usr/bin/env bash # -# script to demonstrate 1998/tomtorfs +# try.sh - demonstrate IOCCC winner 1998/tomtorfs # +# 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 + +make CC="$CC" all >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear + rm -f file.A file.B file.C echo "$ echo abscond conferrable > file.A" 1>&2