0% found this document useful (0 votes)
39 views1 page

Maulana Azad National Institute of Technology, Bhopal Department of Cse End Term Exam, 19 June 2020 (Supplementary Exam)

This document appears to be an exam for a Unix Internal & Shell Programming course. It contains 6 questions assessing various Unix/Linux and shell programming skills. Question 1 has 5 sub-parts asking about commands like listing only file counts, using regular expressions, and catching error messages. Question 2 asks about the etc/passwd file format and designing a filter. Question 3 provides a multi-line text file and asks to write an awk script to extract and print certain lines. Question 4 asks about the relationship between process sleep/awake states and buffer locking. Question 5 calculates maximum file sizes in memory units based on file system parameters. Question 6 analyzes the output of a fork example program using getpid and getppid system calls

Uploaded by

Anuj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views1 page

Maulana Azad National Institute of Technology, Bhopal Department of Cse End Term Exam, 19 June 2020 (Supplementary Exam)

This document appears to be an exam for a Unix Internal & Shell Programming course. It contains 6 questions assessing various Unix/Linux and shell programming skills. Question 1 has 5 sub-parts asking about commands like listing only file counts, using regular expressions, and catching error messages. Question 2 asks about the etc/passwd file format and designing a filter. Question 3 provides a multi-line text file and asks to write an awk script to extract and print certain lines. Question 4 asks about the relationship between process sleep/awake states and buffer locking. Question 5 calculates maximum file sizes in memory units based on file system parameters. Question 6 analyzes the output of a fork example program using getpid and getppid system calls

Uploaded by

Anuj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Name of the Student: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Scholar No.:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY, BHOPAL


DEPARTMENT OF CSE
End Term Exam, 19 June 2020 (Supplementary Exam)
Course: B.Tech Semester: VI Branch: CSE-I/CSE-II
Subject Name: Unix Internal & Shell Programming Subject Code: CSE 354
Time: 03:00 PM– 05:00 PM Max. Marks: 30

Note: i. Attempt all questions.


ii. Draw suitable diagram or take example, if required for explanation.

S.NO Questions Marks

Q1 Write proper commands for following cases: 5


a) How print only count of files in current directories?
b) Write basic regular expression to string of exact 5 characters including “P” or “p” in mid place?
c) For any file, how to revoke all permissions from all users in absolute manner?
d) For command ls –l <file name> , if file doesn’t exists then how to catch error message in a other
file?
e) Write symbols of extended regular expression which are not available in basic regular
expression, also write their definition.
Q2 a) Explain field wise information stored in etc/passwd file? 2

b) Design a filter to print file name, size, number of links, inode number of all files present in 3
current directory. (must follow the sequence for print as mentioned)
Q3 File named as “sample.txt” contains following data, column wise (name of students, subject, 5
marks), Data inside file:
Amit:Unix:50
Ruchi:Unix:40
Sumit:DBMS:45
Rupa:OS:67
Write awk script to print marks of students whose name starts with “R” and subject is “Unix”,
print all rows in following manner:

<subject> passed by <student name> with <marks> out of 100.

Also describe how to execute the above script.


Q4 Explain how sleep and awake state of processes are dependent to lock and unlock status of 5
buffers? Create a well defined scenario with multiple processes for explanation.

Q5 Calculate the maximum file size in exact memory units (MB), write all the steps 5
of calculations
i) Block size = 128 byte, address size = 16 bit, number of direct block = 2, number of single
indirect block = 2, number of double indirect =2
ii) Block size = 256 byte, address size = 16 bit, number of direct block = 2, number of single
indirect block = 1, number of double indirect =1, number of triple indirect =2

Q6 Explain in details output of program and also explain in detail each system call used. (Take 5
assumptions if required),
#include<stdio.h>
int main( )
{
for(int i=0; i<3; i++)
{
if(fork( ) == 0)
{
printf(" %d %d\n", getpid( ), getppid( ));
}
}
}
---***End***---

You might also like