St. Ann's College of Engineering & Technology Computer Science & Engineering ASSIGNMENT – 1 SUBJECT: UNIX PROGRAMMING 1. (a). What are the main functions of kernel? Explain each of them indetail? (b). Explain in detail about the Unix programming system structure? 2. Explain the following commands with syntax? a. ln b. mv c. rm d. ulimit 3. Explain the following commands with syntax? a. ftp b.date c. arp d. rlogin 4. Explain the following commands with syntax? a. Uniq b. grep c.tar d.join 5. Explain the following commands with syntax? a. Cat b.tail c.head d. uniq St. Ann's College of Engineering & Technology Computer Science & Engineering ASSIGNMENT – 2 SUBJECT: UNIX PROGRAMMING 1. Define the shell? What are the main features of shell programming language? 2. (a). What is the “here” document? Explain with an example? (b). What is the difference between the use if pipe symbol and redirection symbol? Give example? 3. What are the different type of arithmetic operators used in shell programming? 4. Explain the following. a. Pipes b. Input redirection c. Output redirection 5. Explain the following. a. Shell variables b. Shell meta characters St. Ann's College of Engineering & Technology Computer Science & Engineering ASSIGNMENT – 3 SUBJECT: UNIX PROGRAMMING 1. (a). Write in detail about the Unix file structure ? (b). Explain in detail about the directories? 2. (a). Define file. Explain detail about the various files? (b). Explain in detail about the file sharing? 3. Define system call. Explain in detail about the working and syntax file structure related system call? 4. Explain the fallowing system calls with syntax? a. Stat () b, read () c. open () d. fstat () 5. Explain the following system calls with syntax? a. Fseek () b. fget () c. getc () d. getchar () St. Ann's College of Engineering & Technology Computer Science & Engineering ASSIGNMENT – 4 SUBJECT: UNIX PROGRAMMING 1. What is meant by process? Explain any four process related system calls with syntax? 2. (a). Write in detail about process structure? (b). Write a short note on zombie process? 3. (a). Write short notes in process control? (b). Write short notes on process identifiers? 4. Explain the following system calls with syntax? a. Exec () b. fork () c. system () d. wait () 5. Write a program that calls fork and has the child create a new section. Verify that the child becomes a process group leader and that the child no longer has a controlling terminal. St. Ann's College of Engineering & Technology Computer Science & Engineering ASSIGNMENT – 5 SUBJECT: UNIX PROGRAMMING 1. Write about the signal implementation? Write about “sigpending” and “sigsuspend”. 2. (a).Write about any four signals? (b). What is meant by reinstalling a signal handler? 3. (a). Write about the kill and raise functions? (b).Write in detail about the interrupted system calls? 4. What is signal function? Write and explain about the structure of signal function? 5. (a). What are the phases in signaling process? (b). Explain what is meant by the lifetime of a signal? St. Ann's College of Engineering & Technology Computer Science & Engineering ASSIGNMENT – 6 SUBJECT: UNIX PROGRAMMING 1. (a). Explain “popen” and “pclose” functions? (b). Explain about inter process communication using pipes? 2. Explain how to obtain the list of login names in shorted order into the file “Userinfodat”using pipes? 3. (a). Explain How do you multiplies, multiple writers to the same pipe? (b). What are the named pipes? Explain in detail? 4. Explain about the “ effect of O_NDELAflag on pipes and FIFOs”. 5. Explain about the following functions? a. Semget () b. semctl () c. semop () St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING ASSIGNMENT – 7 1. Write about the timing comparison of “Semaphores Vs Record locking”? 2. Draw and explain about the kernel data structure for a semaphore set”? 3. (a).How can Unix kernel support for semaphores? (b).What is a semaphore? How to synchronize process using semaphores? 4. Explain in detail about the file locking with semaphores? 5. Write about the semaphore adjustment on “exit”. Explain about the importance of SEMUNDO. St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING ASSIGNMENT – 8 1. What are the Unix domain protocols? Give an example? 2. Explain about the socket addresses and give suitable example? 3. Explain about the elementary socket and give example? 4. What are the file system calls used in sockets? Give an example? 5. What is the socket? What are the different types of socket. Give examples for eachone? St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING QUESTION BANK Unit – 1 1. Explain the following commands with syntax. a. Pwd b. mkdir c. cp d. mv 2. Explain the following commands with syntax. a. Wc b. umask c. ulimit d. mount 3. (a). What ate the main functions of kernel? Explain each of them in detail? (b). Explain in detail about the Unix operating system structure? 4. Explain the following commands with syntax. a. Ln b. mv c. rm d. ulimit 5. Explain the following commands with syntax. a. Head b. grep c. cut d. paste 6. (a). Explain the two methods of altering file access permissions of a file. (b). What is the purpose of grep command? Explain the various operations available with the grep command using an example? 7. Explain the following commands with syntax. a. Cat b. tail c. head d. uniq 8. Explain the following commands with syntax. a. Fgrep b. egrep c. paste d. tee 9. (a). what to multiuser and multitasking mean? (b). explain briefly the Unix file system? 10. (a). what is the file permissions? What command is used to view the permissions on a file? (b). Explain the following commands with syntax. a. Talnet b. rlogin c. finger d. arp St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING QUESTION BANK Unit – 2 1. (a). What is a shell? What are the responsibilities of a shell? (b). What are the different types of shell available in Unix? 2. (a). Explain the following. a. Shell variable b. Shell metacharacters 3. Define shell? What are the main features of shell programming language? 4. (a). explain how the shell treat a command line passed to it? (b). Write about expr command with an example? 5. Explain the following/ a. Pipes b. Input redirection c. Output redirection 6. (a). What is the “here” document? Explain with an example? (b). What is the different between the use of pipe symbol and redirection symbol? Give examples? 7. Explain the following? a. Who/sort b. ls/wc-l c. who/wc-l 8. What are the different types of arithmetic operators used in shell programming? 9. What is the exit status of command? What command are used to check the exit status of a command? 10. Explain about the control structures used in shell programming with an example? St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING QUESTION BANK Unit – 3 1. (a). Explain in detail about the directories? (b). Explain in detail about the Unix file structure? 2. (a). define file. Explain in detail about the various files? (b). explain in detail about the file sharing? 3. Write a ‘c’ program to print the type of specified file (Regular, Device, and Directory). 4. Explain the following system calls with syntax. a. Fseek () b. fgetc () c. getc () d. getchar () 5. What is the advantage of having lseek be a separate system call, instead of passing the starting offset to every read or write? What are the draw backs? 6. Explain following system calls with syntax. a. Stat() b. read() c. open d. fstat() 7. Define following system calls? Explain in detail about the working an syntax of the file structure related system calls? 8. (a). Briefly explain the file I/O? (b). write about slandered library functions in Unix? 9. Explain the following system calls with syntax. a. Creat b. loctl c. umask d. dup and dup 2 10. (a). write short notes onformatted I/O? (b).Write short notes on reading and writing a stream? St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING QUESTION BANK Unit – 4 1. (a). write in detail about process structure? (b). Write a short notes on zombie process? 2. What is meant by a process? Explain any four process related system calls with syntax? 3. (a). Write short notes on process control? (b). Write short notes on process identifiers? 4. Explain the following system calls with syntax? a. Exec () b. fork () c. system () d. wait () 5. Suppose a process does not wish to block until its children terminate. How can it ensure that child process is cleaned up when they terminate? 6. What is the problem with returning an error from the exec system call? How can the kernel handle this problem? 7. Explain the following system calls with syntax. a. Vfork () b. exit () c. getrlimit () d. setrlimit () 8. (a). Explain the waitpid () system call with syntax. (b) Write a program that calls fork and has the child create a new session. Verify that the child becomes a process group leader and that the child no longer has a controlling terminal? St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING QUESTION BANK Unit – 5 1. (a). Explain about the any four signals? (b). What is ment by reinstalling a signal handler? 2. Write about the signal implementation? Writeabout “Sig pending” and “Sig suspend”? 3. What is signal handler? Explain how to install a signal handler? 4. (a). Write about the disposition of the signal? (b). Write about phase function? 5. (a). Write about the kill and raise functions? (b). Write in detail about the interrupted system calls? 6. What are reliable signals? Explain about the four primary features of reliable signals? (Or) Explain about the features added to enhance signal reliability? 7. What is signal function? Write and explain about the structure of signal function? 8. What are the phases in signaling process? Explain what is meant by the life time of a signal? 9. (a). Write in detail about “Reliable signal handling”? (b). Explain about “Avoiding Signal races”? 10. (a).Write about the slow system calls? (b).Whatis meant by process termination? Explain the various types of process terminations with an example? St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING QUESTION BANK Unit – 6 1. Explain how to obtain the list of login names in sorted order into the file “userinfo.dat” using pipes? 2. (a). explain “Popen” and ‘Pclose” functions. (b). explain about inter process communication using pipes? 3. (a). Explain about the events occurred, when you call the popen() and pclose () functions? (b). write about system call pipe. Given an example which uses pipe system call. 4. Explain the logic for opening or creating an IPC channel. 5. Explain the following concepts about pipes. a. Pipes between two process. b. Pipes among three process in a shell. 6. (a). Explain how do you multiplex, multiple writers to the same pipe? (b). What are the named pipes? 7. Explain about the following functions. a. Semget () b. semctl () c. semop () 8. Explain about the “Effect O. NDELAY flag on pipes and FIFO’s? 9. Explain the concepts of IPC between two process on a single system. Give example? St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING QUESTION BANK Unit – 7 1. Draw and explain about the kernel data structure for a semaphore set? 2. (a). How can Unix kernel support for semaphores? (b). What is a semaphore? How to synchronize process using semaphores? 3. Explain about the file locking with semaphores? 4. Write about the semaphore adjustment on ‘exit’. Explain about the importance of SEMUNDO. 5. (a). What is the importance of “semctl” system call? Explain in detail? (b). Write about the timing comparisonof “semaphores Vs record locking”? 6. Explain in detail about name spaces. Give suitable example? St. Ann's College of Engineering & Technology Computer Science & Engineering SUBJECT: UNIX PROGRAMMING QUESTION BANK Unit – 8 1. Explain about the Unix domain protocols? Give an example. 2. Write about any four elementary socket system calls? 3. Explain about the socket addresses and give an example? 4. What are the system calls used in sockets? Give suitable example? 5. What is the socket. What are the different types of sockets? Give example for each one?