Improve 2019/diels-grabsch1/try.sh
This commit is contained in:
1 parent
6285cfd883
commit
19afcc9d45
1 file changed
+17
-8
@@ -15,34 +15,43 @@ 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 "$ dd bs=1024 count=2048 < /dev/zero | compress > ref.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: dd bs=1024 count=2048 < /dev/zero | compress > ref.Z: "
|
||||||
|
echo 1>&2
|
||||||
dd bs=1024 count=2048 < /dev/zero | compress > ref.Z
|
dd bs=1024 count=2048 < /dev/zero | compress > ref.Z
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ dd bs=1024 count=2048 < /dev/zero | ./prog > dg1.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: dd bs=1024 count=2048 < /dev/zero | ./prog > dg1.Z: "
|
||||||
|
echo 1>&2
|
||||||
dd bs=1024 count=2048 < /dev/zero | ./prog > dg1.Z
|
dd bs=1024 count=2048 < /dev/zero | ./prog > dg1.Z
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ cmp ref.Z dg1.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: cmp ref.Z dg1.Z: "
|
||||||
|
echo 1>&2
|
||||||
cmp ref.Z dg1.Z
|
cmp ref.Z dg1.Z
|
||||||
echo "Exit code of: cmp ref.Z dg1.Z: $?" 1>&2
|
echo "Exit code of: cmp ref.Z dg1.Z: $?" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ compress < Shakespeare.txt > ref.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: compress < Shakespeare.txt > ref.Z: "
|
||||||
|
echo 1>&2
|
||||||
compress < Shakespeare.txt > ref.Z
|
compress < Shakespeare.txt > ref.Z
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./prog < Shakespeare.txt > dg1.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog < Shakespeare.txt > dg1.Z: "
|
||||||
|
echo 1>&2
|
||||||
./prog < Shakespeare.txt > dg1.Z
|
./prog < Shakespeare.txt > dg1.Z
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "Notice how the files differ:" 1>&2
|
echo "Notice how the two files differ:" 1>&2
|
||||||
echo "$ cmp ref.Z dg1.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: cmp ref.Z dg1.Z: "
|
||||||
|
echo 1>&2
|
||||||
cmp ref.Z dg1.Z # Oops, the files differ
|
cmp ref.Z dg1.Z # Oops, the files differ
|
||||||
echo "Exit code of: cmp ref.Z dg1.Z: $?" 1>&2
|
echo "Exit code of: cmp ref.Z dg1.Z: $?" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "... and notice how this works fine:" 1>&2
|
echo "... and notice how this works fine:" 1>&2
|
||||||
echo "$ zcat < dg1.Z | cmp - Shakespeare.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: zcat < dg1.Z | cmp - Shakespeare.txt: "
|
||||||
|
echo 1>&2
|
||||||
zcat < dg1.Z | cmp - Shakespeare.txt
|
zcat < dg1.Z | cmp - Shakespeare.txt
|
||||||
|
echo "Exit code of zcat < dg1.Z | cmp - Shakespeare.txt: ${PIPESTATUS[1]}"
|
||||||
|
echo 1>&2
|
||||||
echo "What happened?"
|
echo "What happened?"
|
||||||
Reference in new issue
Block a user