Name of the College : Dasari Jhansi Rani Institute Of Engineering And Technology
University : JNTUK
Department : Computer Science And Engineering
Subject Code/Name : R05320503 – Unix Programming
Year : 2008
Degree : B.Tech
Year: III
Website : djriet.edu.in
Document Type : Model Question Paper
Unix Programming : https://www.pdfquestion.in/uploads/djriet.edu.in/2949-R05320503-UNIX-PROGRAMMING.pdf
DHRIET Unix Programming Question Paper
III B.Tech Semester Supplimentary Examinations, Aug/Sep 2008 :
UNIX PROGRAMMING :
( Common to Computer Science & Engineering and Information Technology )
Time: 3 hours
Max Marks: 80
Answer any FIVE Questions :
Related : Dasari Jhansi Rani Institute Of Engineering & Technology Information Technology & Numerical Methods B.Tech Question Paper : www.pdfquestion.in/2996.html
Set – I
All Questions carry equal marks :
1. What is a process. List and explain various process utilities with suitable examples. [16]
2. (a) Explain the different approach taken by diff command to display file differences.
(b) Describe ‘comm’ command. Explain the output with -1,-2, or -3 options in ‘comm’ command. [8+8]
3. (a) Explain about the usage of multiple commands on the shell command line with example.
(b) Write a menu driven shell script which has following options.
i. Contents of /etc/passwd
ii. List of users who have currently logged in
iii. Present working directory
iv. Exit.
Make use of case statement. The menu should be placed appropriately in the centre of the screen and should be displayed in bold using the tput command. [6+10]
4. (a) Explain about different conditional expressions available in Bourne shell.
(b) Write a shell script which receives two filenames as arguments. It should check whether the two file’s contents are same or not. If they are same then second file should be deleted. Use ‘cmp’ command to compare files. [8+8]
5. Explain the differences between fgets, gets system call. [16]
6. Write a program which used both kill and raise functions. [16]
7. Write in detail about locking regions. [16]
8. (a) What is the data stored by the kernel when a semaphore is created.
(b) What is the system call that is used to create a shared memory segment and explain each field in detail. [8+8]
Set – II
1. Explain basic file attributes. Discuss the appropriate commands associated with these attributes. [16]
2. Which is the command used for ordering a file? Discuss all the options available for this command. For every option explain with an example. [16]
3. (a) While executing a shell script either the LOGNAME or the UID is supplied at the command prompt. Write a shell script to find out at how many terminals has this user logged in?
(b) Write a shell script to display first n numbers of Fibonacci series. [8+8]
4. (a) Explain about different conditional expressions available in Bourne shell.
(b) Write a shell script which receives two filenames as arguments. It should check whether the two file’s contents are same or not. If they are same then second file should be deleted. Use ‘cmp’ command to compare files. [8+8]
5. (a) Write the difference between fgetc and getc system calls.
(b) Write the syntax of fflush system call give an example. [8+8]
6. (a) Write the differences between wait and waitpid system calls.
(b) Explain threads. [8+8]
7. Explain the concept of requesting and releasing a lock. [16]
8. The syntax of msgget system call is int msgget(key t key, int flag)
(a) Explain type of key
(b) Explain what value it returns
(c) What is the use of flag [6+5+5]
Set – III
Answer any FIVE Questions
All Questions carry equal marks
1. “Operating systems like UNIX provide services both for programs and users”. Jus- tify this statement with suitable examples. [16]
2. What is a filter in UNIX? Explain any four filters in detail with examples. [16]
3. (a) If x has the value 5, and you reassign it with x=”expr $x+10”, what is the new value of x? What would have been the value if single quotes were used? What’s wrong with all this anyway?
(b) Devise a script that accept 2 directory names bar1 and bar2, and deletes those files in bar2 whose contents are identical to their namespaces in bar1. [8+8]
4. (a) Write a shell script which gets executed the moment the user logs in. It should display the message “good morning/good afternoon/good evening” depending upon the time at which the user logs in.
(b) Explain about here documents with an example. [8+8]
5. Write syntax of following system calls.
(a) chmod
(b) chown
(c) unlink
(d) link. [4+4+4+4]
6. Write the system calls for process termination in detail. [16]
7. Write in detail about locking regions. [16]
8. Explain the following concepts
(a) Pipes in single process
(b) Pipes in single process, immediately after fork [16]
View Comments (1)
While executing a shell script either the LOGNAME or the UID is supplied at the command prompt. Write a shell script to find out at how many terminals has this user logged in?