1.

The command wc < sample.txt will count data from the file sample.txt.(a) True(b) FalseI have been asked this question in examination.My enquiry is from Redirection and Pipes in portion The Shell of Unix

Answer»

The correct option is (a) True

To EXPLAIN I would say: When WC is used WITHOUT any arguments it will read the DATA from the default source which is a keyboard. In the above COMMAND, redirection symbol < is present. The following steps are performed:

1. On seeing the <, the shell opens the disk file, sample.txt for reading.

2. wc performs its execution and displays the output.



Discussion

No Comment Found

Related InterviewSolutions