From 66308ecd7c79e12c1a0d0fc447474309884b6897 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 12 Jan 2024 08:19:11 -0800 Subject: [PATCH] Improve 1989/jar.2/try.sh Now it will cat each file before running jar.2 on it, prompting for both cat and the command itself. Spaces are added in between commands to help let things stand out better. --- 1989/jar.2/README.md | 2 -- 1989/jar.2/try.sh | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/1989/jar.2/README.md b/1989/jar.2/README.md index f562a1e9e..7310f9c8e 100644 --- a/1989/jar.2/README.md +++ b/1989/jar.2/README.md @@ -22,8 +22,6 @@ NOTE: this entry will likely segfault on invalid input. ```sh ./try.sh -cat chocolate_cake.lisp ; ./jar.2 < chocolate_cake.lisp - ./try.sh chocolate_cake.lisp ./try.sh try.txt diff --git a/1989/jar.2/try.sh b/1989/jar.2/try.sh index ae89cb042..9b66f5242 100755 --- a/1989/jar.2/try.sh +++ b/1989/jar.2/try.sh @@ -19,8 +19,13 @@ fi for f in $FILES; do if [[ -e "$f" && -r "$f" ]]; then + read -r -n 1 -p "Press any key to run: cat $f: " + echo 1>&2 + cat "$f" + echo 1>&2 read -r -n 1 -p "Press any key to run: ./jar.2 < $f: " echo 1>&2 ./jar.2 < "$f" + echo 1>&2 fi done