Quiz Space

System Commands OPPE 2: January 2023, Set 1 (January 2023 term)

Question 1

+15 marksProgramming

Write a SED script to add a new column in the beginning with entry "S1" or "S2". "S1" occurs periodically every 3rd line starting from first line, while rest is "S2"

Sample Input

Ajay,Chennai,Sales,40
Mona,Mumbai,Sales,60
Rajan,Patna,Buisness,50
Narayanan,Kochi,Sales,30
Anuj,Pune,Sales,70
Mohan,Jaipur,Buisness,70
Naga,Vizag,Sales,45
Chaitrali,Nagpur,Sales,90
Sanjana,Delhi,Buisness,80
Maitreyi,Bhopal,Sales,30
Sreni,Bangaluru,Sales,20

Sample Output

S1,Ajay,Chennai,Sales,40
S2,Mona,Mumbai,Sales,60
S2,Rajan,Patna,Buisness,50
S1,Narayanan,Kochi,Sales,30
S2,Anuj,Pune,Sales,70
S2,Mohan,Jaipur,Buisness,70
S1,Naga,Vizag,Sales,45
S2,Chaitrali,Nagpur,Sales,90
S2,Sanjana,Delhi,Buisness,80
S1,Maitreyi,Bhopal,Sales,30
S2,Sreni,Bangaluru,Sales,20

Question 2

+15 marksProgramming

Write a bash script to add serial number as first column to the CSV file data.csv and do a in-place replacement (overwrite) the file data.csv. The serial number starts with 1 on the first line.

Question 3

+15 marksProgramming

Write a SED script to mask the first 6 digits of the phone numbers with asterisks, such that only last four digits of phone number of ten digits are visible.

4 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 Jan 2023 Set 1 paper

The IIT Madras BS System Commands (System Commands) OPPE 2 paper sat on Jan 2023, in the January 2023 term, set 1: 7 questions for 105 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 Jan 2023 Set 1 at a glance
TermJanuary 2023 term
SubjectSystem Commands
Course codeBSSE2001
Questions7
Marks105
Duration180 min
Programming7
Official paperOPPE 2, Jan 2023 Set 1
Negative markingNo negative marking.
Updated

Other sets that day

More System Commands