1.

Which one of the following option is used for checking that the string is NULL string?(a) -a(b) -o(c) -z(d) -nI got this question in unit test.Origin of the question is Using test and [ ] to Evaluate Expressions in division Essential Shell Programming of Unix

Answer»

The correct choice is (c) -z

For explanation I WOULD SAY: test can be used to compare STRINGS with another set of OPERATORS. -z is used for checking if the STRING is null. For example,



Discussion

No Comment Found

Related InterviewSolutions