From 8c43300b455c1a864bb41edf4dea2d704f6d5a49 Mon Sep 17 00:00:00 2001 From: Strykar Date: Fri, 21 Oct 2022 05:25:40 +0200 Subject: [PATCH] Double quote to prevent globbing https://www.shellcheck.net/wiki/SC2086 Signed-off-by: Strykar --- extra/examples/get-systemd-stats.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extra/examples/get-systemd-stats.sh b/extra/examples/get-systemd-stats.sh index bb7fcba..5b59c03 100755 --- a/extra/examples/get-systemd-stats.sh +++ b/extra/examples/get-systemd-stats.sh @@ -6,10 +6,10 @@ CRIT=${1:-SYSLOG_IDENTIFIER} shift { - printf '%s\tTotal\tP7\tP6\tP5\tP4\tP3\tP2\tP1\tP0\n' $CRIT - sudo journalctl "$@" -o json-pretty --output-fields=${CRIT},PRIORITY \ + printf '%s\tTotal\tP7\tP6\tP5\tP4\tP3\tP2\tP1\tP0\n' "$CRIT" + sudo journalctl "$@" -o json-pretty --output-fields="${CRIT}",PRIORITY \ | tr -d $'"\t, ' \ - | awk -F: -vOFS=: -vCRIT=$CRIT ' + | awk -F: -vOFS=: -vCRIT="$CRIT" ' /^\{/ { u = "" p = -1