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:
1 parent
4016ba673e
commit
4bab6df670
3 files changed
+36
-2
No files matched your search
@@ -15,8 +15,7 @@ make
|
|||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./newbern newbern.dat "IOCCC 2004"
|
./try.sh
|
||||||
echo SOS | ./newbern
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Executable
+31
@@ -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
|
||||||
@@ -3063,6 +3063,10 @@ get it to work, that being `kopczynski-10-rev`.
|
|||||||
|
|
||||||
[Cody](#cody) and Landon individually fixed this to work with clang.
|
[Cody](#cody) and Landon individually fixed this to work with clang.
|
||||||
|
|
||||||
|
Cody also added the [try.sh](/2004/newbern/try.sh) script (with a hidden feature
|
||||||
|
that the author referred to and was documented by [Yusuke](#yusuke) though Cody
|
||||||
|
chose the word `IOCCC` instead of `AAA`).
|
||||||
|
|
||||||
|
|
||||||
## <a name="2004_schnitzi"></a>[2004/schnitzi](/2004/schnitzi/schnitzi.c) ([README.md](/2004/schnitzi/README.md]))
|
## <a name="2004_schnitzi"></a>[2004/schnitzi](/2004/schnitzi/schnitzi.c) ([README.md](/2004/schnitzi/README.md]))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user