Quiz Space

System Commands OPPE 2: September 2025 (September 2025 term)

Question 1

+20 marksProgramming

A file has multiple lines, each being a phone number, credit card number, or employee ID:

phone:NNN-NNN-NNNN credit:NNNN-NNNN-NNNN-NNNN employee:EMP-NNNN

Print all lines where the value (excluding dashes, and the EMP prefix for employees) is a palindrome.

Instructions

  • Write your solution in script.sh.
  • Read from standard input, write to standard output.
  • Ignore EMP prefix for employee IDs when checking palindromes.

Sample Input

phone:123-455-4321
phone:111-222-3333
credit:1234-5678-8765-4321
credit:1221-4334-4334-1221
credit:1111-2222-3333-4444
employee:EMP-1221
employee:EMP-4334

Sample Output

phone:123-455-4321
credit:1234-5678-8765-4321
credit:1221-4334-4334-1221
employee:EMP-1221
employee:EMP-4334

Constraints

  • Values follow the specified formats strictly.
  • Palindrome check excludes dashes; for employee IDs exclude EMP prefix too.

Question 2

+20 marksProgramming

Given t numbers, compute the running XOR of all inputs so far and print it. Stop as soon as the running XOR is composite.

Instructions

  • Write your solution in script.sh.
  • First line of input is t; next t lines are positive integers.
  • For each integer (in order), print the running XOR so far.
  • Stop processing as soon as the running XOR is composite.

Sample Input

10
97
12
16
62
25
16
28
84
83
23

Sample Output

97
109
125

Explanation

  • After 97: XOR = 97 (prime) -> print.
  • After 12: XOR = 97 ^ 12 = 109 (prime) -> print.
  • After 16: XOR = 109 ^ 16 = 125 (composite: 5^3) -> print, stop.

Constraints

  • 1 <= t <= 100, 1 <= n <= 100

Question 3

+20 marksProgramming

Each line has the format case:text where case is low or up.

If case is low and text has no lowercase letters, convert to lowercase. If case is up and text has no uppercase letters, convert to uppercase. Otherwise leave text as-is. Always remove the case: prefix. Print only the text part.

Instructions

  • Write your solution in script.sed.
  • Run as: sed -Ef script.sed < input.log

Sample Input

low:THIS IS A LOW CASE MESSAGE
up:This is an Up Case Message

Sample Output

this is a low case message
This is an Up Case Message

Constraints

  • Text contains only [a-zA-Z ].

One more question 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 Sept 2025 paper

The IIT Madras BS System Commands (System Commands) OPPE 2 paper sat on Sept 2025, in the September 2025 term: 4 questions for 80 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 Sept 2025 at a glance
TermSeptember 2025 term
SubjectSystem Commands
Course codeBSSE2001
Questions4
Marks80
Duration180 min
Programming4
Official paperOPPE 2, Sep 2025
Negative markingNo negative marking.
Updated

More System Commands