SACRED HEART COLLEGE(AUTONOMMOUS), TIRUPATTUR, VELLORE DT .
B.Sc .(CS)Degree VI Semester November 2017
Time : 3Hrs Max.Marks : 75
CS622A-ELECTIVE-II:UNIX AND SHELL PROGRAMMING
Section –A (10 X 2 =20 Marks)
Answer ALL the questions.
1. What are the different types of shell in Unix?
2. How will you change the file permission?
3. Define Touch command.
4. What is the difference between the commands compress and pack?
5. Define read and echo statement.
6. List out the logical operators used in shell programming.
7. Develop a shell script for printing the command line arguments.
8. State the uses of break and continue keywords in Unix shell programming.
9. Define Unix system call.
10. What is the purpose of using the lseek() System call?
Section –B (5 x 5 =25 Marks)
Answer all the questions.
11.a) Explain the following three types of terminals connected to the host machine.
• Dumb Terminal
• Terminal Emulation
• Dial-in Terminal
(Or)
b) Describe all the directory related commands with example.
12.a)Write a detailed note on I/O Redirection and piping.
13.a) Describe the Unix communication commands write and wall with an example.
(Or)
b)Develop a shell script to obtain the division obtained by the student. The marks obtained by the
students in 5 different subjects are input through the keyboard. The student gets division as per the
following rules.
Percentage above or equal to 60 : First Division
Percentage between 50 to 59 : Second Division
Percentage between 50 to 59 : Second Division
Percentage Less than 40 : Fail
14.a) Explain while and until looping statements with its flowcharts.
(Or)
b) Write a shell program to find out the factorial of given numbers.
15. a)Describe the fork() system call with suitable example.
(Or)
b) Write a c program to generate the Fibonacci sequence in the child processing using fork() system
call.
Section –C (3 x 10 =30 Marks)
Answer any THREE questions.
16. Describe the salient features of Unix operating system.
17. Explain the following process scheduling commands with example.
a ) wc b ) sort c ) cut d) grep
18. Write a shell program to generate the pay bill. The user gets basic salary as input and calculates the
Allowance, Deduction, Gross and Net Salary. (Allowance : DA=65% HRA=15%, MA=5%. Deduction:
PF=12% and IT=5%)
19. Write a Shell script to check whether the inputted string is palindrome or not.
20. Explain the following fie structure related system calls with its prototype.
a) creat()
b) open()
c) close()
d)read()
e)write()
=*=