How I can hide variable from using when it is not defined with bash command with this situation:
EXCLUDE_PORTS="--exclude-ports $2"
if [ "${EXCLUDE_PORTS:-}" == "" ]; then
EXCLUDE_PORTS=''
fi
I need to hide also --exclude-ports, when $2 it is not specified. Actually when I don't specified $2 at script startup, script take only first part empty "--exclude-ports", and this is ruining my script.