VTU Computer Science (Semester 4)
Unix and Shell Programming
December 2012
Total marks: --
Total time: --
INSTRUCTIONS
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary


1 (a) Explain salient feature of UNIX operating system.
7 M
1 (b) Compare internal and external commands in UNIX with suitable example. Explain why cd command cannot be external command.
6 M
1 (c) Illustrate with a diagram typical UNIX file system and explain different types of files supported in UNIX.
7 M

2 (a) Explain the basic file attributes displayed by "ls -l" command.
6 M
2 (b) Discuss relative and absolute methods for changing file permissions.
6 M
2 (c) Explain with a diagram the different modes of Vi editor and list the commands in each mode.
8 M

3 (a) Explain with an example use of single quote, double quote and back quote in a command line.
6 M
3 (b) Explain the following command:
i) cp ????? progs
ii) kill -S KILL 121 122
iii) wc -l iv) ps -e l
6 M
3 (c) Explain the mechanism of process creation using system calls in UNIX.
4 M
3 (d) Explain the following environment variables:
i) PATH
ii) HISTSIZE
iii) PS2
iv) SHELL
4 M

4 (a) Discuss with example hard link and soft link applicable to UNIX files.
6 M
4 (b) Explain the following commands:
i) umask 022
ii) find /! -name "*C" - Print
iii) tr-d '/' < emp.txt
iv) touch ? 0303 10 30 vtu.txt
8 M
4 (c) Explain the following filters with options:
i) Paginate - Pr
ii) Sort - Sort
6 M

5 (a) Explain with example basic regular expressions.
6 M
5 (b) Locate lines longer than 100 and smaller than 150 characters using (i) grep, (ii) sed.
4 M
5 (c) Discuss stream editor - sed with options.
6 M
5 (d) How do these expression differ:
i) [0-9] * and [0-9] [0-9]*
ii) ^[^ ^] and ^^^
4 M

6 (a) What is shell programming? Write a shell program to create a menu and execute a given option based on users choice. Options include (i) list of users, (ii) list of processes, (iii) list of files.
6 M
6 (b) Explain with example set and shift command in UNIX to manupulate positional parameters.
4 M
6 (c) Discuss use of trap statement for interrupting a program in UNIX.
4 M
6 (d) Explain with an example while and for loop in shell programming.
6 M

7 (a) Write a note on awk and explain built in variables in awk.
8 M
7 (b) Explain with example the following awk function:
i) Split() ii) Substr() iii) length() iv) index()
8 M
7 (c) i) Write an awk statement to print odd numbered lines in a file.
ii) Write an awk statement to delete blank lines from a file.
4 M

8 (a) Explain string handling function in perl.
6 M
8 (b) Using command line argument, write a perl program to find whether a given year is a leap year.
7 M
8 (c) Write a perl program to convert a given decimal number to binary equivalent.
7 M



More question papers from Unix and Shell Programming
SPONSORED ADVERTISEMENTS