diff --git a/2004/sds/try.sh b/2004/sds/try.sh index 86c50994c..80fde7233 100755 --- a/2004/sds/try.sh +++ b/2004/sds/try.sh @@ -15,41 +15,60 @@ make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear -echo "$ ./sds < sds.c > encoder.c" 1>&2 -./sds < sds.c > encoder.c +read -r -n 1 -p "Press any key to show sds.c (space = next page, q = quit): " +echo 1>&2 +less -rEXF sds.c echo 1>&2 -echo "$ make encoder 2>/dev/null" 1>&2 +read -r -n 1 -p "Press any key to run: ./sds < sds.c | tee encoder.c (space = next page, q = quit): " +echo 1>&2 +./sds < sds.c | tee encoder.c | less -rEXF +echo 1>&2 + +read -r -n 1 -p "Press any key to run: make encoder 2>/dev/null: " +echo 1>&2 make encoder 2>/dev/null echo 1>&2 -echo "$ ./encoder README.md sds_msg.c" -./encoder README.md sds_msg.c +echo "$ ./encoder README.md &2 +read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " +echo 1>&2 +./encoder README.md /dev/null" 1>&2 +read -r -n 1 -p "Press any key to run: make sds_msg 2>/dev/null: " +echo 1>&2 make sds_msg 2>/dev/null echo 1>&2 -echo "$ ./sds_msg < sds.c > sds2_msg.c" 1>&2 -./sds_msg < sds.c > sds2_msg.c +echo "$ ./sds_msg < sds.c | tee sds2_msg.c | less -rEXF" 1>&2 +read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " +echo 1>&2 +./sds_msg < sds.c | tee sds2_msg.c | less -rEXF -echo "$ diff sds2_msg.c encoder.c" 1>&2 -diff sds2_msg.c encoder.c +read -r -n 1 -p "Press any key to run: diff -s sds2_msg.c encoder.c: " +echo 1>&2 +diff -s sds2_msg.c encoder.c +echo 1>&2 -echo "$ echo 'Hello, World!' > message" 1>&2 +read -r -n 1 -p "Press any key to run: echo 'Hello, World!' > message: " +echo 1>&2 echo 'Hello, World!' > message +echo 1>&2 -echo "$ ./encoder message < README.md > remarks.md" 1>&2 -./encoder message < README.md > remarks.md +echo "$ ./encoder message < README.md | tee remarks.md" 1>&2 +read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " +echo 1>&2 +./encoder message < README.md | tee remarks.md | less -rEXF +echo 1>&2 -read -r -n 1 -p "Press any key to show diff remarks.md README.md: " -echo "$ diff remarks.md README.md" 1>&2 +read -r -n 1 -p "Press any key to run: diff remarks.md README.md: " +echo 1>&2 diff remarks.md README.md # notice how similar they are echo "Did you notice how similar they are?" 1>&2 echo 1>&2 -read -r -n 1 -p "Press any key to continue: " -echo 1>&2 # and then observe: -echo "$ ./sds < remarks.md" 1>&2 +read -r -n 1 -p "Press any key to run: ./sds < remarks.md: " +echo 1>&2 ./sds < remarks.md +echo 1>&2