Add 1989/ovdluhe/try.sh and fix Makefile
The try.sh script runs the program on the source file, the README.md and the Makefile in a loop that runs four times. It has one loop so that there is a better chance that it won't show the same output on the same file more than once though it's certainly possible that it will. The optimiser had been left disabled by accident and this has been restored.
This commit is contained in:
1 parent
9c4ca9603b
commit
4e886308f5
4 files changed
+42
-6
No files matched your search
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 1989/ovdluhe
|
||||
#
|
||||
|
||||
# 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
|
||||
|
||||
i=0
|
||||
for ((i=0; i<4; ++i)); do
|
||||
read -r -n 1 -p "Press any key to run: ./ovdluhe < ovdluhe.c: "
|
||||
echo 1>&2
|
||||
./ovdluhe < ovdluhe.c
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./ovdluhe < README.md: "
|
||||
echo 1>&2
|
||||
./ovdluhe < README.md
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./ovdluhe < Makefile: "
|
||||
echo 1>&2
|
||||
./ovdluhe < Makefile
|
||||
echo 1>&2
|
||||
done
|
||||
Reference in new issue
Block a user