Improve 2004/sds/try.sh
This commit is contained in:
1 parent
b622a68af8
commit
8ce3247921
1 file changed
+37
-18
+37
-18
@@ -15,41 +15,60 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "$ ./sds < sds.c > encoder.c" 1>&2
|
read -r -n 1 -p "Press any key to show sds.c (space = next page, q = quit): "
|
||||||
./sds < sds.c > encoder.c
|
echo 1>&2
|
||||||
|
less -rEXF sds.c
|
||||||
echo 1>&2
|
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
|
make encoder 2>/dev/null
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./encoder README.md <sds.c >sds_msg.c"
|
echo "$ ./encoder README.md <sds.c | tee sds_msg.c" 1>&2
|
||||||
./encoder README.md <sds.c >sds_msg.c
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
./encoder README.md <sds.c | tee sds_msg.c | less -rEXF
|
||||||
|
|
||||||
echo "$ make sds_msg 2>/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
|
make sds_msg 2>/dev/null
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./sds_msg < sds.c > sds2_msg.c" 1>&2
|
echo "$ ./sds_msg < sds.c | tee sds2_msg.c | less -rEXF" 1>&2
|
||||||
./sds_msg < sds.c > sds2_msg.c
|
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
|
read -r -n 1 -p "Press any key to run: diff -s sds2_msg.c encoder.c: "
|
||||||
diff 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 'Hello, World!' > message
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./encoder message < README.md > remarks.md" 1>&2
|
echo "$ ./encoder message < README.md | tee remarks.md" 1>&2
|
||||||
./encoder message < README.md > remarks.md
|
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: "
|
read -r -n 1 -p "Press any key to run: diff remarks.md README.md: "
|
||||||
echo "$ diff remarks.md README.md" 1>&2
|
echo 1>&2
|
||||||
diff remarks.md README.md # notice how similar they are
|
diff remarks.md README.md # notice how similar they are
|
||||||
echo "Did you notice how similar they are?" 1>&2
|
echo "Did you notice how similar they are?" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
|
|
||||||
echo 1>&2
|
|
||||||
# and then observe:
|
# 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
|
./sds < remarks.md
|
||||||
|
echo 1>&2
|
||||||
Reference in new issue
Block a user