exit with error message in bash (oneline)
You can use a helper function:
function fail { printf '%s\n' "$1" >&2 ## Send message to stderr. Exclude >&2 if you don't want it that way. exit "${2-1}" ## Return a code specified by $2 or 1 by default.}[[ $TRESHOLD =~ ^[0-9]+$ ]] || fail "Threshold must be an integer value!"
Function name can be different.