From a8b8cd28833ea112ff10109f884f6856a046cdc1 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 3 Dec 2023 04:38:53 -0800 Subject: [PATCH] Improve 2013/misaka/try.sh Use both long_cat and same_as_long_cat, redirecting to a text file each, and then using diff -s on them to show they're the same. --- 2013/misaka/.gitignore | 2 ++ 2013/misaka/try.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/2013/misaka/.gitignore b/2013/misaka/.gitignore index 5bf58f7fb..63951fba3 100644 --- a/2013/misaka/.gitignore +++ b/2013/misaka/.gitignore @@ -1,5 +1,6 @@ horizontal_cat long_cat +long_cat.txt long_faat_cat long_fat_cat loong_cat @@ -15,6 +16,7 @@ misaka7.c misaka8.c misaka9.c same_as_long_cat +same_as_long_cat.txt vertical_cat misaka.orig prog.orig diff --git a/2013/misaka/try.sh b/2013/misaka/try.sh index a01157e3e..f65668d71 100755 --- a/2013/misaka/try.sh +++ b/2013/misaka/try.sh @@ -25,6 +25,21 @@ echo 1>&2 ./long_cat echo 1>&2 +rm -f long_cat.txt same_as_long_cat.txt +read -r -n 1 -p "Press any key to run: ./long_cat > long_cat.txt: " +echo 1>&2 +./long_cat > long_cat.txt +echo 1>&2 +read -r -n 1 -p "Press any key to run: ./same_as_long_cat > same_as_long_cat.txt: " +echo 1>&2 +./same_as_long_cat > same_as_long_cat.txt +echo 1>&2 + +read -r -n 1 -p "Press any key to run: diff -s long_cat.txt same_as_long_cat.txt: " +echo 1>&2 +diff -s long_cat.txt same_as_long_cat.txt +echo 1>&2 + read -r -n 1 -p "Press any key to run: ./long_faat_cat: " echo 1>&2 ./long_faat_cat