Quiz Space

System Commands OPPE 2: May 2022 (May 2022 term)

Question 1

+15 marksProgramming

Write a sed script to

  • Swap the first and second fields in the given input having field separator as a colon :.

  • Replace every occurrence of the character ? if found at the end of a line to !.

Note: complete partial tasks for partial marking. Test case description: The input is the input file. And output is the output of running your sed script.

Question 2

+15 marksProgramming

Write a sed script to

  • Replace every three letter abbreviation of day of week to the respective number as given in the table. The abbreviation can be in any case or mixed case

    Abbreviation(case insensitive match)Replace with
    sun1
    mon2
    tue3
    wed4
    thu5
    fri6
    Sat7
  • Change the first and third occurrences of the character ! to ., on each line.

Note: complete partial tasks for partial marking. Test case description: Input is the input file to sed. Output is the output printed on running your sed script.

Question 3

+20 marksProgramming

Given a file that contains current years board exam scores of students in all the schools in an area. Each line in the file contains four comma-separated fields: school code, roll number of the student, name of the student, and marks in the below format.

School_code,Student_Roll_no,Name,Marks

All the fields could be alphanumeric values except the last field Marks which is a number less than 500, as the maximum marks of the exam is out of 500.

Write an AWK script to print the roll numbers of the toppers of each school. For example if there is marks details of students of 11 schools of an area in the file, then your output should contain 11 roll numbers in any order, one for each school.

Test case description: Input is the contents of the input file. Your script does not need to read any input. Output is the expected output from your script. Your script may print expected roll numbers in any order, evaluation script sorts the input before printing.

5 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the System Commands OPPE 2 May 2022 paper

The IIT Madras BS System Commands (System Commands) OPPE 2 paper sat on May 2022, in the May 2022 term: 8 questions for 135 marks in 180 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureSystem Commands OPPE 2 May 2022 at a glance
TermMay 2022 term
SubjectSystem Commands
Course codeBSSE2001
Questions8
Marks135
Duration180 min
Programming8
Official paperOPPE 2, May 2022
Negative markingNo negative marking.
Updated

More System Commands