Unix and Shell Programming - Jun 2012
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) With neat diagram, explain the architecture of UNIX operating system.(6 marks) 1 (b) With the help of a diagram the parent-child relationship. Explain the UNIX file system.(6 marks) 1 (c) Explain the following with examples:
i) Absolute and relative path names
ii) Internal and external commands.(8 marks) 2 (a) A file's current permission are rw_r_xr. Specify the chmod expression required to change them for the following:
i) rwx rwx rwx
ii) r_ _ r_ _ _ _ _
iii) _ _ _ _ _ _ _ _ _
iv) _ _ _ r_ _ r_ _
using both relatives and absolute methods of assigning permissions.(8 marks) 2 (b) Explain briefly the file attributes listed using ls -l command.(6 marks) 2 (c) What are the different modes of Vi editor? Explain with a diagram.(6 marks) 3 (a) Explain the three standard files with respect to UNIX operating systems.(6 marks) 3 (b) Explain the mechanism of process creation.(6 marks) 3 (c) Explain the following command with an example:
i) Running jobs in background
ii) Execute later.(8 marks) 4 (a) Explain the following environment variables with examples:
iii) PATH(6 marks) 4 (b) Different between hard link and soft link in UNIX with examples.(6 marks) 4 (c) Explain the following command with example:
iv) pr(8 marks) 5 (a) With suitable example, explain the grep command and its various options.(8 marks) 5 (b) Explain the line addressing and context addressing in sed with examples.(6 marks) 5 (c) Explain the different ways of using test statements, with examples.(6 marks) 6 (a) What is shell programming? Write a shell program that will do the following tasks in order:
Clear the screen
Print the current directory
Display current login users.(8 marks) 6 (b) Explain the shell features of 'while' and 'for' with syntax.(8 marks) 6 (c) What is the 'exit' status of command and where is it stores?(4 marks) 7 (a) What is AWK? Explain any three built in functions in AWK.(7 marks) 7 (b) Write an AWK sequence to find HRA, DA and Netpay of an employee, where DA is 25% of basic and netpay is the sum of HRA, DA and basic pay.(7 marks) 7 (c) Explain the list and arrays in PERL.(6 marks) 8 (a) Explain the following storing handling functions of PERL with examples:
i) length ii) index iii) substr iv) reverse(8 marks) 8 (b) Write a PERL program to print numbers that are accepted from keyboard using while and array construct.(6 marks) 8 (c) Explain the following in PERL with examples.
i) force each loping construct ii) join(6 marks)