Files
Cody Boone Ferguson 6285cfd883 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.
2024-01-31 09:22:08 -08:00

28 lines
509 B
Bash
Executable File

#!/usr/bin/env bash
x=$1
: "${x:=./prog}"
if [[ ! -x "$x" ]]; then
x="./prog"
fi
: "${out:="diff - correct"}"
(
/bin/echo -n | $x
$x < /dev/null
echo | $x
/bin/echo -n a | $x
echo a | $x
$x < newlines
# 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
) | $out