Question 1
+8 marksOne or more correct optionsSelect all that apply.
- A
- B
- C
- D
The IIT Madras BS System Commands (System Commands) End Term paper sat on 24 Dec 2023, in the September 2023 term, set ADD3: 15 questions for 105 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
Correct answers
Correct answers
Jun 24,2009
April 4,2010
April 14,2009
April 24,2010
May 4,2010
May 14,2010
May 24,2010
Jun 4,2010
Jun 14,2009
Jun 24,2010
Correct answer
May 4,2010
Correct answer
Correct answer
Correct answer
Correct answer
Correct answer
Correct answer
Correct answer
The output will be the count of all the lines with only one character present.
The output will be the count of all the empty lines present in the file.
The output will be the count of all the non-empty lines.
The output will be the count of the total number of lines present in the file.
Correct answer
The output will be the count of all the non-empty lines.
Correct answer
Case 1 uses the input redirection method to read the file line-by-line.
Case 2 uses the pipe redirection to feed the cat output to the while loop.
The pipe redirection used in case 2 is inefficient compared to input redirection.
Case 3 uses command substitution with the for loop to read the file.
Case 4 is input redirection, which reads each entry in the data.txt file (assuming the file has three columns) into individual variables.
Case 5 reads the entire line of the data file and assigns it to the line variable.
None of the options are correct.
Correct answer
None of the options are correct.
Correct answer
Correct answer: 5