printf part 2

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-12-26 21:29:16 +01:00
parent 03bdecb056
commit de31231a24
2 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
# Addons can register to bashbot events at startup # Addons can register to bashbot events at startup
# by providing their name and a callback per event # 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. # 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! # Note: do not call any send message functions from EVENT_SEND!
example_log(){ example_log(){
local send="$1"; shift local send="$1"; shift
echo "$(date): Type: ${send} Args: $*" >>"${EXAMPLE_LOG}" printf "%s: Type: %s Args: %s\n" "$(date)" "${send}" "$*" >>"${EXAMPLE_LOG}"
} }
fi fi

View File

@ -5,8 +5,8 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
# shellcheck disable=SC1117 # shellcheck disable=SC1117,SC2059
#### $$VERSION$$ v1.20-0-g2ab00a2 #### $$VERSION$$ v1.21-dev-1-g03bdecb
# will be automatically sourced from bashbot # will be automatically sourced from bashbot
@ -129,7 +129,7 @@ job_control() {
ADM="$(getConfigKey "botadmin")" ADM="$(getConfigKey "botadmin")"
debug_checks "Enter job_control" "${1}" debug_checks "Enter job_control" "${1}"
for FILE in "${DATADIR:-.}/"*-back.cmd; do 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}")" content="$(< "${FILE}")"
CHAT="${content%%:*}" CHAT="${content%%:*}"
job="${content#*:}" job="${content#*:}"