Improve 2019/burton/try.sh + shellcheck comments

The shellcheck comments are in cow.sh and check.sh: added the URL for
each supposed problem as per that issue.
This commit is contained in:
Cody Boone Ferguson committed 2024-01-31 09:22:08 -08:00
1 parent 5989b570dd
commit 6285cfd883
3 files changed
+14 -7

No files matched your search

+5 -2
View File
@@ -16,8 +16,11 @@ echo | $x
/bin/echo -n a | $x
echo a | $x
$x < newlines
# ^---^ SC2210 (warning): This is a file redirection. Was it supposed to be a comparison or fd operation?
# Answer: 256 is a file so it is supposed to be file redirection.
# 256 is a file so it is supposed to be file redirection. Thus we have to
# disable this warning:
#
# SC2210 (warning): This is a file redirection. Was it supposed to be a comparison or fd operation?
# https://www.shellcheck.net/wiki/SC2210
# shellcheck disable=SC2210
$x < 256
$x < remarks
+2 -2
View File
@@ -14,8 +14,8 @@ do if test -r "$name"; then
# (or, to use Bart Simpson's advice, make it 'not have a cow.sh'), as we
# actually need this to happen:
#
# ^-- SC2086 (info): Double quote to prevent globbing and word splitting.
#
# SC2086 (info): Double quote to prevent globbing and word splitting.
# https://www.shellcheck.net/wiki/SC2086
# shellcheck disable=SC2086
set -- $s
((a += $1))
+7 -3
View File
@@ -15,15 +15,19 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
echo "$ cat prog.c" 1>&2
read -r -n 1 -p "Press any key to show prog.c: "
echo 1>&2
cat prog.c
echo 1>&2
for i in prog.c Makefile README.md; do
echo "$ ./prog < $i && wc < $i" 1>&2
read -r -n 1 -p "Press any key to run: ./prog < $i && wc < $i: "
echo 1>&2
printf "prog: %s\n%4s: %s\n\n" "$(./prog < "$i"|tr -s ' ')" "wc" "$(wc "$i" | tr -s ' ')"
done
echo 1>&2
echo "$ make test" 1>&2
read -r -n 1 -p "Press any key to run: make test: "
echo 1>&2
make test
echo 1>&2