R5311902 Unix Programming

  • July 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View R5311902 Unix Programming as PDF for free.

More details

  • Words: 932
  • Pages: 4
1

Code No: R5311902

IV B.Tech I Semester(R05) Regular/Supplementary Examinations, December 2009 UNIX PROGRAMMING (Electronics & Computer Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. Write short notes on: - Unix system services - Shell responsibilities - Inode block.

[16]

2. Explain the following Unix shell commands with examples. cut, paste, egrep, fgrep.

[4×4]

3. Write shell scripts for following: - to calculate sum of digits in a 5 digit number. - To calculate area & perimeter of a square, area & circumference of a circle.

[16]

4. Explain following - Shell metacharecters - Shell types in Unix

[16]

5. (a) What are the different ways to position a standard I/O stream? (b) Write a program to copy standard input to standard output using getc and putc.

[8+8]

6. (a) State the differences between alarm, pause and sleep functions. (b) What is raise function? Write a program to implement a raise function.

[8+8]

7. Write a program to test different sorts of locks on different regions of a file and explain its working. [16] 8. (a) Explain in detail, the message queue structure in the kernel. (b) What are the different attributes of a message. Explain. ?????

[10+6]

2

Code No: R5311902

IV B.Tech I Semester(R05) Regular/Supplementary Examinations, December 2009 UNIX PROGRAMMING (Electronics & Computer Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Unix is a multitasking System. Justify. (b) Differentiate tools and utilities in Unix. Explain them in detail.

[8+8]

2. (a) What will cat abc abc abc will display? (b) How do you copy all directories & files from current directory xyz to its parent abc? (c) Explain about awk command.

[4+4+8]

3. Write shell scripts for following: - to calculate sum of digits in a 5 digit number. - To calculate area & perimeter of a square, area & circumference of a circle.

[16]

4. (a) Define Unix shell. Explain shell environment. (b) Briefly explain Different shells available in Unix.

[8+8]

5. (a) Write a program to open a file and then unlink it. (b) Explain how a file or directory is renamed.

[8+8]

6. (a) What are the tasks performed by fork system call in process creation? (b) What are the different tasks performed by exec system call in invoking a new program. 7. Explain F GETLK, F SETLK and F SETLKW commands in detail.

[8+8] [16]

8. (a) Write a program to create a pipe and to execute it on the client. (b) Mention the rules for writing information into the pipe. ?????

[8+8]

3

Code No: R5311902

IV B.Tech I Semester(R05) Regular/Supplementary Examinations, December 2009 UNIX PROGRAMMING (Electronics & Computer Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. Write short notes on: - Unix system services - Shell responsibilities - Inode block.

[16]

2. Explain the following Unix shell commands with examples. cut, paste, egrep, fgrep. 3. Attempt following: - write a shell script to find factorial of any number entered from keyboard. - Write a shell script to find gcd of 2 integers entered from key board.

[4×4]

[16]

4. (a) Write a shell script to simulate cp command. (b) What is the use of set command? Explain with examples.

[8+8]

5. Write short notes of the following functions: (a) getcwd (b) umask (c) fstat (d) chmod.

[4×4]

6. (a) Explain parent - child processes in detail. (b) What is a signal function? Explain any two signals in detail.

[8+8]

7. (a) Write a short note on competing locks. (b) Explain the usage of read and write functions with locking.

[8+8]

8. (a) Most unix systems allow a process to attach the same shared memory region to more than one location in its address space. Is this a bug or a feature? When would this be useful? What problems could it cause? (b) Explain the effect of O-NDELAY flat in detail. [8+8] ?????

4

Code No: R5311902

IV B.Tech I Semester(R05) Regular/Supplementary Examinations, December 2009 UNIX PROGRAMMING (Electronics & Computer Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) What is the difference between the text editing provided by ‘ed’ & ‘vi’ text editors. (b) What are the two operational modes of vi editor? What is the use of each? [8+8] 2. Briefly explain the commands to be used for performing following: - converting one file to another - displaying the beginning of a file - splitting a file vertically - translating characters.

[16]

3. (a) Write a shell script to copy multiple files without overwriting the destination files. (b) Write a shell script to accept a string from terminal & use expr to echo a suitable message if the string does not have atleast 10 characters. [8+8] 4. Write short notes on the operators used with test for evaluating - numeric data - string data - file data

[16]

5. (a) Explain the various functions used for opening a standard I/O stream. (b) State the differences between getc, fgetc and getchar functions.

[10+6]

6. (a) Write a program to execute the command line arguments using system function. (b) Write a program to illustrate different exit statuses.

[8+8]

7. Write a program to test different sorts of locks on different regions of a file and explain its working. [16] 8. (a) Mention the rules for reading and writing data in a pipe. (b) State the advantages and disadvantages of pipes and FIFOs. ?????

[8+8]

Related Documents