From bbed912243bebe28eff70b30a012f7425d90e47b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 31 Jan 2024 09:47:28 -0800 Subject: [PATCH] Improve 2019/karns/try.sh --- 2019/karns/try.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/2019/karns/try.sh b/2019/karns/try.sh index 33cf2aa63..75e4c6089 100755 --- a/2019/karns/try.sh +++ b/2019/karns/try.sh @@ -16,8 +16,9 @@ make CC="$CC" all >/dev/null || exit 1 clear # display prog.c to the user -echo "$ cat prog.c" -cat prog.c +read -r -n 1 -p "Press any key to show prog.c (space = next page, q = quit): " +echo 1>&2 +less -rEXFK prog.c # run the program on its own source code read -r -n 1 -p "Press any key to run: ./prog < prog.c: " @@ -28,7 +29,9 @@ echo 1>&2 reset # display maze -echo "$ cat maze" +read -r -n 1 -p "Press any key to run: cat maze: " +echo 1>&2 +# Role swap: cat in maze instead of mice cat maze # run the program on maze