Several improvements made in 2011/hou/try.sh

This commit is contained in:
Cody Boone Ferguson committed 2024-02-17 08:04:27 -08:00
1 parent 7ecc0a3b4d
commit 3e047f29fb
1 file changed
+14 -5
+14 -5
View File
@@ -6,20 +6,28 @@
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
if [[ -z "$CC" ]]; then
CC="cc"
fi
[[ -z "$CC" ]] && CC="cc"
make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
echo "Observe how this one is in the code, both the equation and the answer: " 1>&2
read -r -n 1 -p "Press any key to run: grep #define calculator hou.c|cut -f3 -d' ': "
echo 1>&2
grep '#define calculator' hou.c|cut -f3 -d' '
echo 1>&2
read -r -n 1 -p "Press any key to run: grep '11/26+222/31' hou.c: "
echo 1>&2
grep '11/26+222/31' hou.c
echo 1>&2
read -r -n 1 -p "Press any key to run: ./hou '11/26+222/31': "
echo 1>&2
./hou '11/26+222/31'
echo 1>&2
echo "What relation does the equation in the code have to do with the above" 1>&2
echo "command?" 1>&2
echo 1>&2
read -r -n 1 -p "Press any key to run: ./hou 'log((21701-19937)-(23209-21701))/log(2)': "
echo 1>&2
@@ -45,4 +53,5 @@ echo 1>&2
read -r -n 1 -p "Press any key to run: ./hou 'a calculator expression -- see the C Code for details': "
echo 1>&2
./hou 'a calculator expression -- see the C Code for details'
echo "Now answer: what does the last one mean? Can you get it to report something else?" 1>&2
echo "Now answer: what does the last one mean? Can you get it to report" 1>&2
echo "something else?" 1>&2