Quiz Space

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

Question 1

+20 marksProgramming

You are working on a C project and need to scaffold a base project skeleton.

Write a script scaffold.sh that creates the following filesystem structure:

include/
└── my_project/
    └── config.h
src/
├── main.c
└── config/
    ├── config.debug.h
    ├── config.release.h
    └── config.h -> config.release.h
tests/

The script should take one command-line argument, which can be either debug or release. Depending on the argument, the config.h symbolic link should point to the corresponding configuration file:

  • debug → config.debug.h
  • release → config.release.h

For example, ./scaffold.sh debug should result in src/config/config.h -> config.debug.h, and ./scaffold.sh release should result in src/config/config.h -> config.release.h.

The script should create all required directories and files.

Instructions

  • Write your script in scaffold.sh. It will be given the command line argument debug or release and should use it to create the symlink.
  • It should create the files and folders in the current directory.
  • Files can be empty files.
  • If the link is not correctly created, the test fails and no marks are given. There are no partial marks.

Hints

  • Symlinks store the path relative to the link itself.

The test lists what your script created, with -> after each symlink.

Question 2

+20 marksProgramming

Definition

An automorphic number is a number whose square ends in the same digits as the number itself. A number n is called automorphic if

n² (mod 10^d) = n

where d is the number of digits in n.

Problem Statement

Given a number as input, print whether it is automorphic or not.

Output Format

  • 1 if the number is automorphic
  • 0 if the number is not automorphic

Instructions

  • Write your script in script.sh.
  • Read the number from standard input.
  • Print the output to standard output.

Sample Input

25

Sample Output

1

Sample Input

26

Sample Output

0

Constraints

  • The number will always be positive and entered without a leading sign.
  • The number will not have any fractional values.
  • The number may be of any length within bash limits.
  • We are considering base 10 here.

Question 3

+20 marksProgramming

Given a line of text as input, find the longest word whose characters are all distinct.

A word consists only of alphabetic characters (a-z). Words are separated by spaces. If multiple words have the same maximum length, print the first one.

Instructions

  • Create your solution in script.sh.
  • It should read input from standard input.
  • It should output (if any) to standard output.

Sample Input

perhaps one did not want to be loved so much as to be understood

Sample Output

loved

Sample Input

if you want to keep a secret you must also hide it from yourself

Sample Output

yourself

Constraints

  • The input contains at least one word.
  • Words contain only English letters.
  • There may be multiple spaces between words.
  • The input can be arbitrarily long.
  • The words are all in lowercase.
  • The line contains only words and spaces.
  • If no words have unique characters, print nothing.

2 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 2026 paper

The IIT Madras BS System Commands (System Commands) OPPE 2 paper sat on May 2026, in the May 2026 term: 5 questions for 100 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 2026 at a glance
TermMay 2026 term
SubjectSystem Commands
Course codeBSSE2001
Questions5
Marks100
Duration180 min
Programming5
Official paperOPPE 2, May 2026
Negative markingNo negative marking.
Updated

More System Commands