Bash Scripting - String Operations
Which bash snippet correctly checks if the variable
input is empty by using string length?input is empty by using string length?${#input} gives the length of the string.${#input} to 0 correctly tests if the string is empty.input is unset. if [ ${input} == "" ]; then echo "Empty"; fi uses string comparison but is less reliable without quotes.input="" outputs "Empty" [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions