Add 1986/stein/stein.sh
This script runs the two commands suggested in order to get it to output cleanly. It is suggested other systems might need another set of characters but one can also get away with just using ./stein so this is also done but at the end of the script to not cause any problems (it doesn't show a newline at output).
This commit is contained in:
1 parent
8c4fe6dbdd
commit
1920ca72d8
3 files changed
+29
-1
No files matched your search
@@ -19,7 +19,7 @@ into 3 lines. Join all lines into a single line to recreate
|
||||
the original file.
|
||||
|
||||
|
||||
The 015 in the above printf command produces a control-N.
|
||||
The `\015` in the above `printf(1)` command produces a control-N.
|
||||
|
||||
One some machines, a control-M control-N arg is needed
|
||||
to get the command to output cleanly:
|
||||
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 1986/stein
|
||||
#
|
||||
|
||||
# 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 "$ ./stein \$(printf \"\\015\\015\"); echo" 1>&2
|
||||
./stein $(printf "\015\015"); echo
|
||||
|
||||
echo "$ ./stein \$(printf \"\\014\\015\"); echo" 1>&2
|
||||
./stein $(printf "\014\015"); echo
|
||||
|
||||
echo "$ ./stein" 1>&2
|
||||
./stein
|
||||
Reference in new issue
Block a user