Bash Scripting - String Operations
What will be the output of this script?
unset user
user=""
echo "Current user: ${user:-guest}"unset user
user=""
echo "Current user: ${user:-guest}"user is unset then set to an empty string.${user:-guest} returns guest only if user is unset or null. Since user is set to empty string (which is set but null), it returns empty string.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions