forgot 'updating conf/include_functions.conf' file.

This commit is contained in:
Christoph 2024-04-04 19:22:08 +02:00
parent e6566bafeb
commit b183770b91

View File

@ -65,4 +65,20 @@ containsElement () {
return 1 return 1
} }
is_number() {
return $(test ! -z "${1##*[!0-9]*}" > /dev/null 2>&1);
# - also possible
# -
#[[ ! -z "${1##*[!0-9]*}" ]] && return 0 || return 1
#return $([[ ! -z "${1##*[!0-9]*}" ]])
}
trim() {
local var="$*"
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
echo -n "$var"
}