diff --git a/2015/burton/try.sh b/2015/burton/try.sh index e57857cdb..528f8307b 100755 --- a/2015/burton/try.sh +++ b/2015/burton/try.sh @@ -15,41 +15,52 @@ make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear -echo "$ ./calc '?0x3343<<2'" 1>&2 +read -r -n 1 -p "Press any key to run: ./calc '?0x3343<<2': " +echo 1>&2 ./calc '?0x3343<<2' +echo 1>&2 -echo "$ echo '?0x3343<<2' | ./ecalc" 1>&2 +read -r -n 1 -p "Press any key to run: echo '?0x3343<<2' | ./ecalc: " +echo 1>&2 echo '?0x3343<<2' | ./ecalc - - -echo "$ grep '[0-9]' prog.c" 1>&2 -read -r -n 1 -p "Press any key to continue (notice how there are no digits!): " -echo 1>&2 -grep -c '[0-9]' prog.c - -read -r -n 1 -p "Press any key to run: ./calc < test.in: " -echo 1>&2 -./calc < test.in echo 1>&2 -read -r -n 1 -p "Press any key to show try.this.txt: " + +read -r -n 1 -p "Press any key to run: grep '[0-9]' prog.c || echo \"no digits in prog.c!\": " echo 1>&2 -cat try.this.txt +grep -q '[0-9]' prog.c || echo "no digits in prog.c!" +echo 1>&2 + +read -r -n 1 -p "Press any key to show calc.in (space = next page, q = quit): " +echo 1>&2 +less -rEXFK test.in +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./calc < test.in (space = next page, q = quit): " +echo 1>&2 +./calc < test.in | less -rEXFK +echo 1>&2 + +read -r -n 1 -p "Press any key to show try.this.txt (space = next page, q = quit): " +echo 1>&2 +less -rEXFK try.this.txt echo 1>&2 read -r -n 1 -p "Press any key to run: ./calc < try.this.txt: " echo 1>&2 ./calc < try.this.txt -read -r -n 1 -p "Press any key to show the hex value of 42: " +read -r -n 1 -p "Press any key to run: ./calc 42 # show hex value of 42: " echo 1>&2 -echo "$ ./calc 42" 1>&2 ./calc 42 +echo 1>&2 -read -r -n 1 -p "Press any key to run: ./calc '1<<22-1' (show mask value for 22 bits): " +read -r -n 1 -p "Press any key to run: ./calc '1<<22-1' # show mask value for 22 bits: " echo 1>&2 ./calc '1<<22-1' +echo 1>&2 -read -r -n 1 -p "Press any key to run: ./calc ?0x11223344 (byte-swapped value of 0x11223344): " +read -r -n 1 -p "Press any key to run: ./calc ?0x11223344 # byte-swapped value of 0x11223344: " echo 1>&2 ./calc ?0x11223344 +echo 1>&2 diff --git a/thanks-for-help.md b/thanks-for-help.md index 3c3d2c855..73ff69c70 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -4229,9 +4229,9 @@ This was done for both the [prog.c](/2015/burton/prog.c) and [prog.alt.c](/2015/burton/prog.alt.c). The Makefile was also updated to build `eprog` and `eprog.alt` to make use of the feature more easily. Each is a new target (first in `TARGET` and second in `ALT_TARGET`) which have a prerequisite -of `${PROG}` and `${PROG}.alt` respectively and which copies `prog` and -`prog.alt` to `eprog` and `eprog.alt` respectively. With these changes now one -can easily use the echo feature the author implemented. +of `${PROG}` and `${PROG}.alt` respectively both of which also copy the `prog` +(`prog` or `eprog`) to the respective `eprog` (`eprog` or `eprog.alt`). With +these changes now one can easily use the echo feature the author implemented. Cody also added the [try.sh](/2015/burton/try.sh) script. This involved adding a text file, [try.this.txt](/2015/burton/try.this.txt).