From 061c86ebf89123f5ff96516ec14d3f587409b5c5 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 28 Jan 2024 12:11:34 -0800 Subject: [PATCH] Fix shellcheck for 2014/maffiodo2/try.sh --- 2014/maffiodo2/try.sh | 49 +++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/2014/maffiodo2/try.sh b/2014/maffiodo2/try.sh index bad1431ef..5685ad202 100755 --- a/2014/maffiodo2/try.sh +++ b/2014/maffiodo2/try.sh @@ -15,44 +15,33 @@ make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear -echo "$ cat image.rgb | ./prog ' .,:;!$#@'" 1>&2 -read -r -n 1 -p "Press any key to run command (space = next page, q = quit): " +echo "$ ./prog ' .,:;!$#@' < image.rgb" 1>&2 +read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " +echo 1>&2 +./prog ' .,:;!$#@' < image.rgb | less -rEXFK echo 1>&2 -# ^-------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. -# shellcheck disable=SC2002 -cat image.rgb | ./prog ' .,:;!$#@' | less -EXF -echo "$ cat image.rgb | ./prog ' .:;Y0'" 1>&2 -read -r -n 1 -p "Press any key to run command (space = next page, q = quit): " +echo "$ ./prog \" .:;Y0\" < image.rgb" 1>&2 +read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " echo 1>&2 -# ^-------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. -# shellcheck disable=SC2002 -cat image.rgb | ./prog " .:;Y0" | less -EXF +./prog " .:;Y0" < image.rgb | less -rEXFK -echo "$ cat image.rgb | ./prog ' :1'" 1>&2 -read -r -n 1 -p "Press any key to run command (space = next page, q = quit): " +echo "$ ./prog ' :1' < image.rgb" 1>&2 +read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " echo 1>&2 -# ^-------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. -# shellcheck disable=SC2002 -cat image.rgb | ./prog ' :1' | less -EXF +./prog ' :1' < image.rgb | less -rEXFK -echo "$ cat image.rgb | ./prog ' .:;Y0'" 1>&2 -read -r -n 1 -p "Press any key to run command (space = next page, q = quit): " +echo "$ ./prog ' .:;Y0' < image.rgb" 1>&2 +read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " echo 1>&2 -# ^-------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. -# shellcheck disable=SC2002 -cat image.rgb | ./prog ' .:;Y0' | less -EXF +./prog ' .:;Y0' < image.rgb | less -rEXFK -echo "$ cat image.rgb | ./prog ' .:-=+*#%@'" 1>&2 -read -r -n 1 -p "Press any key to run command (space = next page, q = quit): " +echo "$ ./prog ' .:-=+*#%@' < image.rgb" 1>&2 +read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " echo 1>&2 -# ^-------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. -# shellcheck disable=SC2002 -cat image.rgb | ./prog ' .:-=+*#%@' | less -EXF +./prog ' .:-=+*#%@' < image.rgb | less -rEXFK -echo "$ cat image.rgb | ./prog ' .,:!-iots&8%#@$'" 1>&2 -read -r -n 1 -p "Press any key to run command (space = next page, q = quit): " +echo "$ ./prog ' .,:!-iots&8%#@$' < image.rgb" 1>&2 +read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " echo 1>&2 -# ^-------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. -# shellcheck disable=SC2002 -cat image.rgb | ./prog ' .,:!-iots&8%#@$' | less -EXF +./prog ' .,:!-iots&8%#@$' < image.rgb | less -rEXFK