written 8.7 years ago by |
Unix and Shell Programming - Jun 2015
Computer Science Engg. (Semester 4)
TOTAL MARKS: 100
TOTAL TIME: 3 HOURS
(1) Question 1 is compulsory.
(2) Attempt any four from the remaining questions.
(3) Assume data wherever required.
(4) Figures to the right indicate full marks.
1 (a) Explain be architecture of UNIX operating system with a neat diagram(8 marks)
1 (b) Illustrate with a diagram, the typical UNIX file and explain different types of files supported in UNIX(8 marks)
1 (c) Explain internal and external commands with example(4 marks)
2 (a) Which command is used for listing file attributes? Briefly describe the significance of each filed of the output(8 marks)
2 (b) A file's current permissions are rq-r-xr--, specify the chmod expression required to change them for the following: i) r w x r w x r w x
ii) r - - r - - - -
iii) - - - - - -
Using both the relative and absolute methods of assigning permissions(6 marks)
2 (c) What are the different modes of vt editor ? Explain with a diagram(6 marks)
3 (a) Explain the three standard files with respect to UNIX operating system(6 marks)
3 (b) Explain the mechanism of process creation using system calls in UNIX(6 marks)
3 (c) Explain the following environment variables with example :
i)SHELL
ii) LOGNAME
iii) PATH
iv) PS2(8 marks)
4 (a) Distinguish between hard links and soft links with suitable example(6 marks)
4 (b) Explain the following filter with options: i) pe
ii)sort(6 marks)
4 (c) Use find command to locate from your home firectory
i) All files with the extension-html
ii) All files having mode number 9076
iii)All directories having permission 666
iv) All files not accessed for more than a year
v) All but the C program files
vi) All files named a- out and all 'C' source files and remove them interactively(6 marks)
5 (a) Explain grep command with all options(8 marks)
5 (b) Briefly explain the different ways of addressing used in sed with example(6 marks)
5 (c) Explain BRE (Basic regular Expression ) character subset used for constructing regular expression(4 marks)
5 (d) Write the command for the following
i) Use sed to delete all blank lines from a file named sample
ii) Use sed to replace all occurrences of the word : 'UNIX' with 'LINUX' in a file named sample(2 marks)
6 (a) What is shell programming ? Write a menu-driven shell script to perform the following
i) List of users who are logged in
ii) List of files in the current directory
iii) Today's date
iv) Quit to UNIX(8 marks)
6 (b) Explain with an example 'while' and 'for' loop in shell programming(6 marks)
6 (c) Briefly explain set and shift commands in UNIX to manipulate positional parameters with example(6 marks)
7 (a) What is AWK? Explain any three built-in functions in WK(7 marks)
7 (b) Explain associative arrays in AWK(6 marks)
7 (c) Explain built- in variables in AWK(7 marks)
8 (a) Explain the string handling function supported by PERL and also write a PERL script to convert a given decimal number to binary equivalent(12 marks)
8 (b) Explain the following in PERL with example
i) split
ii) join(8 marks)