System - Programming (Lab) (BCM456C)
System - Programming (Lab) (BCM456C)
Course objectives:
● Introduce Unix Shell Programming and familiarize scripting
1 a)Write a Non-recursive shell script that accepts any number of argument and prints them in the Reverse
order, (For example, if the script is named rargs, then executing rargs A B C should produce C B A on the
standard output).
2 Write a Shell script that accepts two file names as arguments, checks if the permissions for these files are
identical and if the permissions are identical, outputs the common permissions, otherwise outputs each
file name followed by its permissions.
3 Design a Shell function that takes a valid directory names as an argument and recursively descends all the
subdirectories, finds the maximum length of any file in that hierarchy and writes this maximum value to
the standard output.
4 Write a Shell script that accepts file names specified as arguments and creates a shell script that contains
this file as well as the code to recreate these files. Thus if the script generated by your script is executed,
it would recreate the original files (This is same as the “bundle” script described by Brain W. Kernighan
and Rob Pike in “The Unix Programming Environment”, Prentice – Hall India).
5 Write a shell script that accepts a string and a substring from the user (use read command). Then check if
the string contains that substring and print a message accordingly.
6 Write a shell script that accepts a number greater than 3 and prints the Fibonacci sequence up to that
term.
PART- B
7 Consider the last 100 bytes as a region. Write a C/C++ program to check whether the region is locked or
not. If the region is locked, print pid of the process which has locked. If the region is not locked, lock the
region with an exclusive lock, read the last 50 bytes and unlock the region.
8 a) Write a C program to illustrate the race condition and modify the same program to avoid race
condition.
b) Write a C program to set up a real-time clock interval timer using the alarm API.
9 a) Write C/C++ programs to emulate mv command
b) Write C/C++ programs to emulate ln command to create hard links and symbolic links
Course objectives:
● Introduce Unix Shell Programming and familiarize scripting
● Demonstrate the different concepts on Process control, Signal Handling and other system features
● Department shall conduct a test of 100 marks after the completion of all the experiments
listed in the syllabus.
● In a test, test write-up, conduction of experiment, acceptable result, and procedural
knowledge will carry a weightage of 60% and the rest 40% for viva-voce.
SYSTEM PROGRAMMING (LABORATORY) Semester 4
Course Code BCM456C CIE Marks 50
Teaching Hours/Week (L:T:P: S) 0:0:2:0 SEE Marks 50
Credits 01 Exam Hours 2
Examination type (SEE) Practical
Course objectives:
● Introduce Unix Shell Programming and familiarize scripting
● The suitable rubrics can be designed to evaluate each student’s performance and learning
ability.
● The marks scored shall be scaled down to 20 marks (40% of the maximum marks).
The Sum of scaled-down marks scored in the report write-up/journal and marks of a test is the
total CIE marks scored by the student.
Semester End Evaluation (SEE):
● SEE marks for the practical course are 50 Marks.
● SEE shall be conducted jointly by the two examiners of the same institute, examiners are
appointed by the Head of the Institute.
● The examination schedule and names of examiners are informed to the university before
the conduction of the examination. These practical examinations are to be conducted
between the schedule mentioned in the academic calendar of the University.
● All laboratory experiments are to be included for practical examination.
● (Rubrics) Breakup of marks and the instructions printed on the cover page of the answer
script to be strictly adhered to by the examiners. OR based on the course requirement
evaluation rubrics shall be decided jointly by examiners.
● Students can pick one question (experiment) from the questions lot prepared by the
examiners jointly.
● Evaluation of test write-up/ conduction procedure and result/viva will be conducted
jointly by examiners.
● General rubrics suggested for SEE are mentioned here, writeup-20%, Conduction procedure
and result in -60%, Viva-voce 20% of maximum marks. SEE for practical shall be evaluated
for 100 marks and scored marks shall be scaled down to 50 marks (however, based on
course type, rubrics shall be decided by the examiners)
● Change of experiment is allowed only once and 15% of Marks allotted to the procedure part
are to be made zero.
The minimum duration of SEE is 02 hours
Suggested Learning Resources:
SYSTEM PROGRAMMING (LABORATORY) Semester 4
Course Code BCM456C CIE Marks 50
Teaching Hours/Week (L:T:P: S) 0:0:2:0 SEE Marks 50
Credits 01 Exam Hours 2
Examination type (SEE) Practical
Course objectives:
● Introduce Unix Shell Programming and familiarize scripting