Update 2001/westley/try.sh + bugs.md

The try script was improved slightly.

The bugs.md file now refers to a new status type for this entry.

Updated the todo file removing this item.
This commit is contained in:
Cody Boone Ferguson committed 2024-02-04 09:30:37 -08:00
1 parent 2115b4b58f
commit 106ae0c8e1
4 files changed
+41 -21

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ The current status of this entry is:
```
STATUS: uses gets() - change to fgets() if possible
STATUS: missing files - please provide them
STATUS: main() has only one arg - try and make it have 2 or 3
```
For more detailed information see [2001 westley in bugs.md](/bugs.md#2001-westley).
+10 -15
View File
@@ -15,15 +15,14 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
echo "$ ./westley < westley.c 2>/dev/null | tee westley2.c" 1>&2
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
read -r -n 1 -p "Press any key to run: ./westley < westley.c (space = next page, q = quit): "
echo 1>&2
./westley < westley.c 2>/dev/null | tee westley2.c | less -rEXF
./westley < westley.c 2>/dev/null | tee westley2.c | less -rEXFK
echo "Compiling westley2.c..." 1>&2
make CC="$CC" westley2 2>/dev/null 1>&2
echo 1>&2
echo "$ echo 'Bozos, please deflate shoes before entering the bus!'| ./westley2 2>/dev/null"
echo "$ echo 'Bozos, please deflate shoes before entering the bus!'| ./westley2"
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
echo 'Bozos, please deflate shoes before entering the bus!'| ./westley2 2>/dev/null
@@ -39,43 +38,39 @@ read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
echo 1>&2
# SC2094 (info): Make sure not to read and write the same file in the same pipeline.
# shellcheck disable=SC2094
./westley.sort < westley.c 2>/dev/null | diff -s - westley.c | less -rEXF
./westley.sort < westley.c 2>/dev/null | diff -s - westley.c | less -rEXFK
echo 1>&2
echo "$ ./westley.sort < westley.c 2>/dev/null | diff - westley2.c"
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
echo 1>&2
./westley.sort < westley.c 2>/dev/null | diff -s - westley2.c | less -rEXF
./westley.sort < westley.c 2>/dev/null | diff -s - westley2.c | less -rEXFK
echo 1>&2
echo "$ ./westley.sort < westley.c 2>/dev/null | diff - westley.sort.c"
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
echo 1>&2
./westley.sort < westley.c 2>/dev/null | diff - westley.sort.c | less -rEXF
./westley.sort < westley.c 2>/dev/null | diff - westley.sort.c | less -rEXFK
echo 1>&2
echo "$ ./westley.sort < westley.c 2>/dev/null | diff - westley.punch.c"
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
echo 1>&2
./westley.sort < westley.c 2>/dev/null | diff - westley.punch.c | less -rEXF
./westley.sort < westley.c 2>/dev/null | diff - westley.punch.c | less -rEXFK
echo 1>&2
# SC2028 (info): echo may not expand escape sequences. Use printf.
# shellcheck disable=SC2028
read -r -n 1 -p "Press any key to run: printf \"1\n\4\n5\" | ./westley 2>/dev/null: "
read -r -n 1 -p "Press any key to run: printf \"1\n\4\n5\" | ./westley: "
echo 1>&2
printf "1\n4\n5" | ./westley 2>/dev/null
echo 1>&2
echo 1>&2
# SC2028 (info): echo may not expand escape sequences. Use printf.
# shellcheck disable=SC2028
read -r -n 1 -p "Press any key to run: printf \"1\n4\n5\" | ./westley 2>/dev/null: "
read -r -n 1 -p "Press any key to run: printf \"1\n4\n5\" | ./westley: "
echo 1>&2
printf "1\n4\n5" | ./westley 2>/dev/null
echo 1>&2
echo 1>&2
read -r -n 1 -p "Press any key to run: echo 'Hello, world!' | ./westley.punch 2>/dev/null: "
read -r -n 1 -p "Press any key to run: echo 'Hello, world!' | ./westley.punch: "
echo 1>&2
echo 'Hello, world!' | ./westley.punch 2>/dev/null