1.

Which file descriptor is used to represent standard error stream?(a) 0(b) 1(c) 2(d) 3I got this question during an online exam.This question is from Redirection and Pipes topic in chapter The Shell of Unix

Answer» RIGHT answer is (c) 2

The best EXPLANATION: Each of the three standard files is represented by a number called as a file descriptor. A file is opened using its pathname, but subsequent read and write operations identify the file by this file descriptor. Whenever we ENTER an incorrect command or try to OPEN a non-existent file, certain diagnostic messages are displayed onto the terminal. This is the standard error stream whose DEFAULT destination is the terminal.


Discussion

No Comment Found

Related InterviewSolutions