From d1489ed01131f657a22779ebe43e3d6a07ce4995 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 17 Dec 2023 12:37:23 -0800 Subject: [PATCH] Add 1998/dlowe/try.alt.sh, add missing subsections --- 1998/dlowe/README.md | 24 ++++++++++++++++++++++-- 1998/dlowe/try.alt.sh | 36 ++++++++++++++++++++++++++++++++++++ 1998/dlowe/try.sh | 1 + thanks-for-help.md | 2 +- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100755 1998/dlowe/try.alt.sh diff --git a/1998/dlowe/README.md b/1998/dlowe/README.md index d77e5c351..69c8fff0e 100644 --- a/1998/dlowe/README.md +++ b/1998/dlowe/README.md @@ -4,6 +4,9 @@ make all ``` +There is an alternate version available. See [Alternate code](#alternate-code) +below for more details. + ## To use: @@ -42,17 +45,34 @@ Also try: ## Alternate code: -NOTE: The original entry was just a text based pootifier. To build -that version try: +The original entry was just a text based pootifier. This alternate version is +that program. + + +### Alternate build: ```sh make alt +``` + + +### Alternate use: + + +``` ./dlowe.alt < anyfile > pootfile ``` What's the difference between this and `dlowe`? +### Alternate try: + +```sh +./try.alt.sh +``` + + ## Judges' remarks: Why could this this entry be considered a utility? Well because it diff --git a/1998/dlowe/try.alt.sh b/1998/dlowe/try.alt.sh new file mode 100755 index 000000000..05b11df0a --- /dev/null +++ b/1998/dlowe/try.alt.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# +# try.sh - try out 1998/dlowe pootifier alt code +# + +make everything || exit 1 + +CAT="$(type -P cat)" +MAN="$(type -P man)" +COL="$(type -P col)" + +if [[ -z "$CAT" || ! -e "$CAT" ]]; then + echo "$0: no cat found" 1>&2 + exit 1 +elif [[ -z "$COL" || ! -e "$COL" ]]; then + echo "$0: col not found" 1>&2 + exit 1 +elif [[ -z "$MAN" || ! -e "$MAN" ]]; then + echo "$0: can't execute man" 1>&2 + exit 1 +fi + +rm -f make.1 +read -r -n 1 -p "Press any key to pootify make(1): " +"$MAN" make | "$COL" -b | ./dlowe.alt > make.1 +"$MAN" ./make.1 + +read -r -n 1 -p "Press any key to pootify dlowe.c: " +echo 1>&2 +./dlowe.alt < dlowe.c +echo 1>&2 + +read -r -n 1 -p "Press any key to pootify dlowe.alt.c: " +echo 1>&2 +./dlowe.alt < dlowe.alt.c +echo 1>&2 diff --git a/1998/dlowe/try.sh b/1998/dlowe/try.sh index 5dc390a8d..18645fc87 100755 --- a/1998/dlowe/try.sh +++ b/1998/dlowe/try.sh @@ -26,4 +26,5 @@ read -r -n 1 -p "Press any key to pootify make(1): " "$MAN" ./make.1 read -r -n 1 -p "Press any key to pootify dlowe.c: " +echo 1>&2 ./dlowe < dlowe.c diff --git a/thanks-for-help.md b/thanks-for-help.md index 5ff8b82b2..5aed94a63 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -2033,7 +2033,7 @@ be done in modern systems) to be `_int`. to be `int` (in both versions). Cody added the scripts [try.sh](/1998/dlowe/try.sh), -[pootify.sh](/1998/dlowe/pootify.sh) and +[try.alt.sh](/1998/dlowe/try.alt.sh), [pootify.sh](/1998/dlowe/pootify.sh) and [pootify.cgi.sh](/1998/dlowe/pootify.cgi.sh) for a fun example use of the program, a local pootifier of web pages and a CGI pootifier. It should be noted that the CGI version might have an issue with modern systems; see [historical