Bash: test for undefined variable

echo -n “myvar=${myvar:-notset}”

If myvar is null or unset then it will be set to “notset”.