From de31231a24c1f6348c83c96a53602e87ddb6fb8a Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Sat, 26 Dec 2020 21:29:16 +0100 Subject: [PATCH] printf part 2 --- addons/example.sh | 4 ++-- modules/background.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/example.sh b/addons/example.sh index 3feb6a8..a1e2632 100644 --- a/addons/example.sh +++ b/addons/example.sh @@ -4,7 +4,7 @@ # Addons can register to bashbot events at startup # by providing their name and a callback per event # -#### $$VERSION$$ v1.20-0-g2ab00a2 +#### $$VERSION$$ v1.21-dev-1-g03bdecb # # If an event occurs each registered event function is called. # @@ -109,6 +109,6 @@ if [[ "$1" = "start"* ]]; then # Note: do not call any send message functions from EVENT_SEND! example_log(){ local send="$1"; shift - echo "$(date): Type: ${send} Args: $*" >>"${EXAMPLE_LOG}" + printf "%s: Type: %s Args: %s\n" "$(date)" "${send}" "$*" >>"${EXAMPLE_LOG}" } fi diff --git a/modules/background.sh b/modules/background.sh index e4ea11a..06a680c 100644 --- a/modules/background.sh +++ b/modules/background.sh @@ -5,8 +5,8 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -# shellcheck disable=SC1117 -#### $$VERSION$$ v1.20-0-g2ab00a2 +# shellcheck disable=SC1117,SC2059 +#### $$VERSION$$ v1.21-dev-1-g03bdecb # will be automatically sourced from bashbot @@ -129,7 +129,7 @@ job_control() { ADM="$(getConfigKey "botadmin")" debug_checks "Enter job_control" "${1}" for FILE in "${DATADIR:-.}/"*-back.cmd; do - [ "${FILE}" = "${DATADIR:-.}/*-back.cmd" ] && echo -e "${RED}No background processes.${NC}" && break + [ "${FILE}" = "${DATADIR:-.}/*-back.cmd" ] && printf "${RED}No background processes.${NN}" && break content="$(< "${FILE}")" CHAT="${content%%:*}" job="${content#*:}"