Figuring out if an environment variable is declared in BASH

$ declare -p VARIABLE >/dev/null 2>&1 && echo "$VARIABLE is defined"

Knowledge by @shaiguitar