Add 1992/adrian/try.sh

This script shows the entry itself as well as some of the other tools
that the entry generates. The adwc / wc one uses a pipeline to show the
output (with leading spaces and filename removed along with squeezing
spaces) and also writes each to a text file to use diff on, to show how
they have the same output.

Not all the tools are in the script. The adbasename might have a bug
(in any case it doesn't appear to function exactly like basename(1) in
that it requires two args, not one) so it is not used and adgrep is not
used either. For the latter one the author's remarks might provide some
clues as to why I did not include it.
This commit is contained in:
Cody Boone Ferguson committed 2024-01-14 09:46:54 -08:00
1 parent 85a9066b02
commit 094a4da91a
4 files changed
+76 -11

No files matched your search

+7 -10
View File
@@ -20,7 +20,7 @@ For more detailed information see [1992 adrian in bugs.md](/bugs.md#1992-adrian)
### Try:
```sh
./adrian adrian.grep.try < README.md
./try.sh
```
For the slow minded, try:
@@ -29,9 +29,6 @@ For the slow minded, try:
./adsleep 32767
```
NOTE: if you do not specify an arg some of the programs such as `adsleep` it
will very likely segfault do something funny. This is supposed to happen.
## Judges' remarks:
@@ -160,11 +157,11 @@ Running:
will perform a function similar to that of the unix `from` command.
If no filename is specified on the command line, then `__FILE__` is used
as the specification for the automaton. (Originally `"adgrep.c"` the file was renamed
to `adrian.c` by the judges but for more portability the arg was changed to
`__FILE__`.) In this case, the program will search for
matches to the regular expression:
If no filename is specified on the command line, then `__FILE__` is used as the
specification for the automaton. (Originally this was `"adgrep.c"` but the file
was renamed to `adrian.c` by the judges and for more portability the arg was
changed to `__FILE__`.) In this case, the program will search for matches to
the regular expression:
```
^.[^|C][^w[Q]*(Q|[w[]c).*|^.[C|]$
@@ -219,7 +216,7 @@ you can search for matches to
By some freak happenstance, lines of `adrian.c` which match this regular
expression form a unix `head(1)` command. It prints the first ten lines of
the file specified on the command line or adrian.c if no file is
the file specified on the command line or `adrian.c` if no file is
specified (again this was changed to `__FILE__`).
By setting the first line to