Which one of the following option is used for checking that the string is not null?

Kim Trang

New member
Which one of the following option is used for checking that the string is not null?
A. -a
B. -o
C. -z
D. -n
 
Answer: d
Explanation: test can be used to compare strings with another set of operators. -n is used for checking if the string is not null. For example,
Code:
If [ -n “$fname ] ;
then
echo “$fname”
 

Tìm kiếm

Back
Top