1.

Which one of the following option is used for checking that the string is not null?(a) -a(b) -o(c) -z(d) -nI have been asked this question in quiz.Question is from Using test and [ ] to Evaluate Expressions topic in chapter Essential Shell Programming of Unix

Answer»

The correct choice is (d) -n

For EXPLANATION I would say: 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,



Discussion

No Comment Found

Related InterviewSolutions