From 78fdf606f266b0275d2f9d0d6bed2ee9a917df0c Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:51:10 -0800 Subject: [PATCH] Improve 1995/garry try scripts They now show the garry.data file and also show a bit more of what is being done (in the script). In the thanks file I removed the details as to why there are two scripts, one for the main version and one for the alt, as that was only there as at one point using environmental variables was the way it was being done, but that is no longer important or useful to know. --- 1995/garry/garry.data | 3 +++ 1995/garry/try.alt.sh | 23 +++++++++++++++++------ 1995/garry/try.sh | 15 ++++++++++++--- thanks-for-help.md | 14 ++++++-------- 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/1995/garry/garry.data b/1995/garry/garry.data index bcabb6b16..cfc94e2db 100644 --- a/1995/garry/garry.data +++ b/1995/garry/garry.data @@ -1,3 +1,6 @@ + + + This is a short example to demonstrate the use of the garry program ... Your Home-directory is $HOME$, while you search diff --git a/1995/garry/try.alt.sh b/1995/garry/try.alt.sh index 252663e7f..29d812912 100755 --- a/1995/garry/try.alt.sh +++ b/1995/garry/try.alt.sh @@ -19,12 +19,23 @@ echo "$ EXAMPLEON=\"\33\133\61\73\67\155\"; EXAMPLEOFF=\"\33\133\155\"; DOLLAR=\ EXAMPLEON="\33\133\61\73\67\155" EXAMPLEOFF="\33\133\155" DOLLAR="$" +echo "$ export EXAMPLEON EXAMPLEOFF DOLLAR" 1>&2 export EXAMPLEON EXAMPLEOFF DOLLAR - -read -r -n 1 -p "Press any key to run: ./garry.alt < garry.data | less (q = quit, space = next page): " - -./garry.alt &2 +echo "As you continue with the script, consider why the above was necessary." 1>&2 echo 1>&2 -read -r -n 1 -p "Press any key to run: ./garry.alt < README.md | less (q = quit, space = next page): " -./garry.alt < README.md | less -X +read -r -n 1 -p "Press any key to show garry.data (space = next page, q = quit): " +echo 1>&2 +less -rEXF garry.data +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./garry.alt < garry.data | less (space = next page, q = quit): " +echo 1>&2 +./garry.alt &2 + +read -r -n 1 -p "Press any key to run: ./garry.alt < README.md | less (space = next page, q = quit): " +echo 1>&2 +./garry.alt < README.md | less -rEXF +echo 1>&2 diff --git a/1995/garry/try.sh b/1995/garry/try.sh index 18f6d2476..1d3175889 100755 --- a/1995/garry/try.sh +++ b/1995/garry/try.sh @@ -20,12 +20,21 @@ echo "$ EXAMPLEON=\"\33\133\61\73\67\155\"; EXAMPLEOFF=\"\33\133\155\"; DOLLAR=\ EXAMPLEON="\33\133\61\73\67\155" EXAMPLEOFF="\33\133\155" DOLLAR="$" +echo "$ export EXAMPLEON EXAMPLEOFF DOLLAR" 1>&2 export EXAMPLEON EXAMPLEOFF DOLLAR +echo 1>&2 +echo "As you continue with the script, consider why the above was necessary." 1>&2 +echo 1>&2 -read -r -n 1 -p "Press any key to run: ./garry < garry.data | less (q = quit, space = next page): " +read -r -n 1 -p "Press any key to show garry.data (space = next page, q = quit): " +echo 1>&2 +less -rEXF garry.data +echo 1>&2 -./garry &2 +./garry &2 read -r -n 1 -p "Press any key to run: ./garry < README.md | less (q = quit, space = next page): " -./garry < README.md | less -X +./garry < README.md | less -rEXF diff --git a/thanks-for-help.md b/thanks-for-help.md index d20396b85..4978c4e7a 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -2042,14 +2042,12 @@ important that it works because the layout does indeed look to him like a rat is dropping core :-), something that the judges suggested. Cody also renamed `garry.test.sh` to [try.sh](/1995/garrytry.sh) and improved it -to to make sure the program is compiled before trying to use it and he also -added the [try.alt.sh](/1995/garry/try.alt.sh) script to use the alt version, -though the alt version is not as important as alt code in other entries. - -The reason the alt script was added rather than using an environmental variable -to specify which one to use is to make it easier on the user as typing -`GARRY=garry.alt ./try.sh` is not as simple (even though simple) as just -running `./try.alt.sh`. +to to make sure the program is compiled before trying to use it as well as +adding a few enhancements. For the alt version he also added the +[try.alt.sh](/1995/garry/try.alt.sh) script to use the alt version, though the +alt version is not as important as alt code in other entries. In order to get +the paging to work right for the `garry.data` file leading blank lines had to be +added. ## [1995/heathbar](/1995/heathbar/heathbar.c) ([README.md](/1995/heathbar/README.md]))