Fixes 2015/howe scripts, format/typo checks etc.
The try.sh script runs the commands that were in the try section. Having this I discovered some errors in the avgtime.sh script which were fixed, partly by having the cc.1 man page added (as not all systems have cc.1 in /usr/share/man/man1), in this case being gcc.1.gz (unzipped) from Rocky Linux, and maybe other things besides. That script, avgtime.sh, has also been updated to make sure at least two args are used and for ShellCheck though some of the things ShellCheck wants to be done will break the script so those warnings are disabled. The README.md file has been format and typo fixed. The war-and-peace.txt file has been added rather than forcing the script (each time, in fact) to try and download it from Project Gutenberg.
This commit is contained in:
1 parent
3adfc9a06a
commit
ff8d406544
6 files changed
+97186
-50
No files matched your search
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 2015/howe
|
||||
#
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
./prog prog.alt.c prog.c
|
||||
|
||||
make test
|
||||
./prog -d ABXYEFCD.tmp ACDBECFD.tmp
|
||||
./prog ABXYEFCD.tmp ACDBECFD.tmp
|
||||
|
||||
rm -f curds.tmp whey.tmp
|
||||
cp -f cc.1 curds.tmp
|
||||
cp -f cc.1 whey.tmp
|
||||
chmod 666 whey.tmp
|
||||
make makeholes
|
||||
./makeholes -n 1000 whey.tmp
|
||||
./prog curds.tmp whey.tmp
|
||||
./avgtime.sh 100 ./prog curds.tmp whey.tmp
|
||||
|
||||
cp -f war-and-peace.txt nuked.tmp
|
||||
./makeholes -c'~' -n 1000 nuked.tmp
|
||||
./prog war-and-peace.txt nuked.tmp
|
||||
./avgtime.sh 100 ./prog war-and-peace.txt nuked.tmp
|
||||
Reference in new issue
Block a user