From 0d9037233145dd936e1853140ab626220707a1cb Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 02:48:47 -0800 Subject: [PATCH] Improve 1992/nathan/try.sh Allow one to specify CC=foo, defaulting to cc. --- 1992/nathan/try.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/1992/nathan/try.sh b/1992/nathan/try.sh index 93319a319..44a7090ee 100755 --- a/1992/nathan/try.sh +++ b/1992/nathan/try.sh @@ -1,5 +1,17 @@ #!/usr/bin/env bash +# +# 1992/nathan/try.sh - show IOCCC winner 1992/nathan +# 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 echo "$ ./nathan obfuscate < nathan.c > foobarf.c" 1>&2 ./nathan obfuscate < nathan.c > foobarf.c