Add 2004/newbern/try.sh

One of the features the author noted is also in the script. It was
documented by Yusuke but I chose to use the letters IOCCC instead (it
seemed more fitting). This is noted in the thanks file.
This commit is contained in:
Cody Boone Ferguson committed 2024-01-20 10:23:30 -08:00
1 parent 4016ba673e
commit 4bab6df670
3 files changed
+36 -2

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2004/newbern
#
# 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
read -r -n 1 -p "Press any key to run: ./newbern newbern.dat \"IOCCC 2004\" (space = next page, q = quit): "
echo 1>&2
./newbern newbern.dat "IOCCC 2004" | less -rEXF
echo 1>&2
read -r -n 1 -p "Press any key to run: echo SOS | ./newbern: "
echo 1>&2
echo SOS | ./newbern
echo 1>&2
read -r -n 1 -p "Press any key to run: ./newbern newbern.dat IOCCC x (space = next page, q = quit): "
echo 1>&2
./newbern newbern.dat IOCCC x | less -rEXF
echo 1>&2