Add 2019/burton/try.sh and other fixes/updates

The try.sh runs prog and wc side by side but in a way that is formatted
(including alignment) so it's easier to see what line is from which
program and it also runs make test.

The script cow was renamed cow.sh to help browsers with whether or not
to display or download.

The script check was renamed check.sh to help browsers with whether or
not to display or download.

The script check.sh was fixed in case the 'x' (passed in to the script
as an environmental variable) is not executable (it resets it back to
./prog) and also made to satisfy ShellCheck.

The script cow.sh was fixed for ShellCheck moo (or was it too? :-) ).
This commit is contained in:
Cody Boone Ferguson committed 2023-12-15 09:30:14 -08:00
1 parent ae420f7b32
commit 00b9181b11
12 files changed
+136 -55

No files matched your search

+25 -8
View File
@@ -5,17 +5,30 @@ make
```
### Bugs and (Mis)features:
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [2019 burton in bugs.md](/bugs.md#2019-burton).
## To use:
```sh
./prog < prog.c
./prog < file
./cow file
```
### Try:
```sh
echo "Do or do not. There is no try."
./try.sh
```
@@ -30,7 +43,7 @@ unix utilities available as winning entries.
### Synopsis:
Feed it anything on stdin.
Feed it anything on `stdin`.
The output should look familiar.
Compiles cleanly with:
@@ -44,11 +57,11 @@ cc -Wall -Wextra -Weverything -pedantic $WARN -include stdio.h -o prog prog.c
Included is a test script, useful for the corner cases. As in all good Unix
programs, it is silent upon success; any output demonstrates an error. Instead
of checking correctness, the check script can simply output the results: (The
Makefile contains the spoiler):
of checking correctness, the [check.sh](check.sh) script can simply output the
results: (The Makefile contains the spoiler):
```sh
out=cat ./check ./prog
out=cat ./check.sh ./prog
```
Interestingly, and a spoiler here: macOS and FreeBSD implement the common
@@ -60,20 +73,24 @@ on these systems omit these characters from the description.
This program follows FreeBSD and macOS, the arbiters of correct for these purposes.
### Limits:
Requires the C locale and ASCII character set.
Input should be less than ten million octets "toavoidthisproblem".
### See Also:
You can enjoy this code from beginning to end.
No whitespace was harmed in the creation of this program.
All your base belong to us, but the constants seem a bit ... off?
### Bonus
The script `cow` provides a closer analog, and perhaps a more useful interface.
The script [cow.sh](cow.sh) provides a closer analog, and perhaps a more useful
interface.
Included is a version without compilation warnings:
@@ -83,7 +100,7 @@ cc -Wall -Wextra -Weverything -pedantic -include stdio.h -o prog.clean prog.clea
### Bugs
The flags are not supported. Although they could easily be added into `cow`.
The flags are not supported. Although they could easily be added into `cow.sh`.
This exercise left to the reader.