1.

What is the exit status of cmp command if both the files are identical?(a) 0(b) 1(c) 2(d) undefinedI got this question in a national level competition.I'm obligated to ask this question of Comparing Files:comm, cmp and diff Command in division Handling Ordinary Files of Unix

Answer»

The CORRECT answer is (a) 0

For explanation I WOULD SAY: The exit status of cmp COMMAND is 0 if both the files are identical and 1 if both the files are different. The exit status is 2 if the program encounters a problem.



Discussion

No Comment Found

Related InterviewSolutions