Add 2015/endoh2/try.sh + format/typo checks
This commit is contained in:
1 parent
1aaba20b1a
commit
29903d763b
3 files changed
+45
-6
No files matched your search
@@ -15,9 +15,7 @@ make
|
||||
### Try:
|
||||
|
||||
```sh
|
||||
cat prog.c
|
||||
|
||||
./prog | diff - prog.c
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -42,14 +40,14 @@ more prog.c
|
||||
Where did those underscores come from? Well [RTFS](http://acronyms.thefreedictionary.com/RTFS)!\*\*
|
||||
|
||||
** Read the Freaking Source (polite form)
|
||||
** Read The Freakin' Screen (polite form)
|
||||
** Read The Freaking Screen (polite form)
|
||||
|
||||
If you are still puzzled, look at prog.c with your favorite text editor.
|
||||
If you are still puzzled, look at [prog.c](prog.c) with your favorite text editor.
|
||||
|
||||
|
||||
## Author's remarks:
|
||||
|
||||
**Follow this instruction literally!**
|
||||
**Follow these instructions literally!**
|
||||
|
||||
```sh
|
||||
cat prog.c
|
||||
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 2015/endoh2
|
||||
#
|
||||
|
||||
# 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
|
||||
|
||||
echo "$ cat prog.c" 1>&2
|
||||
cat prog.c
|
||||
echo 1>&2
|
||||
|
||||
echo "$ ./prog | diff -s - prog.c"
|
||||
./prog | diff -s - prog.c
|
||||
echo 1>&2
|
||||
|
||||
echo "$ less -EXF prog.c" 1>&2
|
||||
read -r -n 1 -p "Press any key to continue: "
|
||||
less -EXF prog.c
|
||||
echo 1>&2
|
||||
|
||||
echo "$ wc -c prog.c" 1>&2
|
||||
wc -c prog.c
|
||||
echo 1>&2
|
||||
echo "Can you figure out the inconsistencies?" 1>&2
|
||||
echo "If you can't or you're still confused try" 1>&2
|
||||
echo "opening prog.c in an editor like vim." 1>&2
|
||||
@@ -3807,6 +3807,11 @@ they avoided.
|
||||
[Cody](#cody) added the [try.sh](2015/duble/try.sh) script.
|
||||
|
||||
|
||||
## [2015/endoh2](2015/endoh2/prog.c) ([README.md](2015/endoh2/README.md]))
|
||||
|
||||
[Cody](#cody) added the [try.sh](2015/endoh2/try.sh) script.
|
||||
|
||||
|
||||
## [2015/endoh3](2015/endoh3/prog.c) ([README.md](2015/endoh3/README.md]))
|
||||
|
||||
[Cody](#cody) fixed this to compile with Linux which was having a problem with duplicate
|
||||
|
||||
Reference in new issue
Block a user