Commit 8bf37c8f authored by Marcel Huber's avatar Marcel Huber
Browse files

more shellcheck based cleanup

parent c9866fba
......@@ -4,9 +4,6 @@ _MY_DIR="$(cd "$(dirname "${0:-.}")" && pwd)"
_EX_DIR="$(realpath --relative-to=. "$_MY_DIR")"
test -z "$_EX_DIR" && _EX_DIR=.
eo0=""
eo1=""
# shellcheck source=./Queries_common.sh
. $_EX_DIR/Queries_common.sh
# disable globbing for star queries (*)
......@@ -24,7 +21,6 @@ set schema ds2;
set role sysadmin;
--
$(for q in "${queries[@]}"; do
explainopts="$(eval echo $(echo \"\$$(cut -d'|' -f1 <<<"$q")\"))";
aufgabe="$(cut -d'|' -f2 <<<"$q")";
aufgabe_desc="$(cut -d'|' -f3 <<<"$q")";
query="$(cut -d'|' -f4 <<<"$q")";
......@@ -42,8 +38,10 @@ $(for q in "${queries[@]}"; do
echo "select '-- end::${aufgabe}-plan[]';"
echo "select '-- tag::${aufgabe}-timing[]';"
echo "\f trash"
# shellcheck disable=SC2028
echo "\t performance"
echo "$query"
# shellcheck disable=SC2028
echo "\t none"
echo "\f tab"
echo "select '-- end::${aufgabe}-timing[]';"
......
......@@ -6,8 +6,9 @@ test -z "$_EX_DIR" && _EX_DIR=.
db_name=${1:-ds2}
db_user=${2:-$db_name}
# shellcheck disable=SC2034
eo0=""
# shellcheck disable=SC2034
eo1="EXPLAIN (ANALYZE 1,COSTS 0,TIMING 1,BUFFERS 0,VERBOSE 0,FORMAT TEXT)"
# shellcheck source=./Queries_common.sh
......@@ -41,7 +42,7 @@ VACUUM (ANALYZE);
\c $db_name $db_user
$(for q in "${queries[@]}"; do
explainopts="$(eval echo $(echo \"\$$(cut -d'|' -f1 <<<"$q")\"))";
explainopts="$(eval echo \$"$(cut -d'|' -f1 <<<"$q")")";
aufgabe="$(cut -d'|' -f2 <<<"$q")";
aufgabe_desc="$(cut -d'|' -f3 <<<"$q")";
query="$(cut -d'|' -f4 <<<"$q")";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment