Add 1987/biggar/try.sh
This commit is contained in:
1 parent
7b836f362d
commit
df22315198
3 files changed
+42
-1
No files matched your search
@@ -9,13 +9,15 @@ make all
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
some_command | ./biggar | od -c
|
some_command | ./biggar | od -c
|
||||||
|
|
||||||
|
./biggar < file | od -c
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./biggar < biggar.c | od -c
|
./try.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Executable
+34
@@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 1987/biggar
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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: ./biggar < biggar.c: "
|
||||||
|
echo 1>&2
|
||||||
|
./biggar < biggar.c
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./biggar < biggar.c | od -c: "
|
||||||
|
echo 1>&2
|
||||||
|
./biggar < biggar.c | od -c
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./biggar < Makefile (space = next page, q = quit): "
|
||||||
|
./biggar < Makefile | less -rEXF
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./biggar < Makefile | od -c (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
./biggar < Makefile | od -c | less -rEXF
|
||||||
@@ -500,6 +500,11 @@ There might have been other changes as well.
|
|||||||
# <a name="1987"></a>1987
|
# <a name="1987"></a>1987
|
||||||
|
|
||||||
|
|
||||||
|
## <a name="1987_biggar"></a>[1987/biggar](/1987/biggar/biggar.c) ([README.md](/1987/biggar/README.md))
|
||||||
|
|
||||||
|
[Cody](#cody) added the [try.sh](1987/biggar/try.sh) script.
|
||||||
|
|
||||||
|
|
||||||
## <a name="1987_heckbert"></a>[1987/heckbert](/1987/heckbert/heckbert.c) ([README.md](/1987/heckbert/README.md))
|
## <a name="1987_heckbert"></a>[1987/heckbert](/1987/heckbert/heckbert.c) ([README.md](/1987/heckbert/README.md))
|
||||||
|
|
||||||
[Cody](#cody) made this look more like the original entry by restoring the `#define` of
|
[Cody](#cody) made this look more like the original entry by restoring the `#define` of
|
||||||
|
|||||||
Reference in new issue
Block a user