From 61aa66443ff7ad1dec3919227c09e21338fc8740 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 21 Jan 2024 05:08:18 -0800 Subject: [PATCH] Deal with shellcheck for 1994/ldb/try.sh --- 1994/ldb/try.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/1994/ldb/try.sh b/1994/ldb/try.sh index e0471b94f..27c6bdf4c 100755 --- a/1994/ldb/try.sh +++ b/1994/ldb/try.sh @@ -26,6 +26,14 @@ ldb_file() ldb_ioccc() { + # This warning from ShellCheck is incorrect: + # + # SC2028 (info): echo may not expand escape sequences. Use printf. + # + # because we deliberately have \\n to show that there will be a newline printed + # WITH printf(1). Thus this does show correct output. + # + # shellcheck disable=SC2028 echo "$ printf \"The International Obfuscated C Code Contest\\nBest One-liner\\nby Laurion Burchall\" | ./ldb" read -r -n 1 -p "Press any key to continue: " echo 1>&2 @@ -33,6 +41,12 @@ ldb_ioccc() echo 1>&2 } +# This warning from ShellCheck is irrelevant as we only use 'i' as an iterator +# to do the commands a number of times: +# +# SC2034 (warning): i appears unused. Verify use (or export if used externally). +# +# shellcheck disable=SC2034 for i in $(seq 1 5); do ldb_file /etc/passwd ldb_ioccc