Add 1986/bright/try.sh
This commit is contained in:
1 parent
9d08b20a5d
commit
8f7fce9fec
3 files changed
+32
-3
No files matched your search
@@ -15,9 +15,7 @@ make all
|
|||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./bright bright.c
|
./try.sh
|
||||||
|
|
||||||
./bright bright
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Executable
+26
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 2000/tomx
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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: ./bright bright.c (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
./bright bright.c | less -rEXF
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./bright bright | tail -n 15: "
|
||||||
|
echo 1>&2
|
||||||
|
./bright bright | tail -n 15
|
||||||
@@ -340,6 +340,11 @@ Cody also added the [try.sh](/1985/sicherman/try.sh) script.
|
|||||||
./applin.c` or `./applin`; they can do either `./applin.c` or `./applin`.
|
./applin.c` or `./applin`; they can do either `./applin.c` or `./applin`.
|
||||||
|
|
||||||
|
|
||||||
|
## <a name="1986_bright"></a>[1986/bright](/1986/bright/bright.c) ([README.md](/1986/bright/README.md]))
|
||||||
|
|
||||||
|
[Cody](#cody) added the [try.sh](1986/bright/try.sh) script.
|
||||||
|
|
||||||
|
|
||||||
## <a name="1986_hague"></a>[1986/hague](/1986/hague/hague.c) ([README.md](/1986/hague/README.md]))
|
## <a name="1986_hague"></a>[1986/hague](/1986/hague/hague.c) ([README.md](/1986/hague/README.md]))
|
||||||
|
|
||||||
[Cody](#cody) made this use `fgets()`.
|
[Cody](#cody) made this use `fgets()`.
|
||||||
|
|||||||
Reference in new issue
Block a user