Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

CS625 Unix Shell Programming Nov 2018

This document outlines the examination structure for a B.Sc. (CS) degree at Sacred Heart College, focusing on UNIX and Shell Programming. It includes sections with various questions on UNIX commands, shell script development, and system calls, along with specific tasks for students to complete. The exam is divided into three sections with a total of 75 marks, covering both theoretical and practical aspects of UNIX programming.

Uploaded by

tonybaskar83
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

CS625 Unix Shell Programming Nov 2018

This document outlines the examination structure for a B.Sc. (CS) degree at Sacred Heart College, focusing on UNIX and Shell Programming. It includes sections with various questions on UNIX commands, shell script development, and system calls, along with specific tasks for students to complete. The exam is divided into three sections with a total of 75 marks, covering both theoretical and practical aspects of UNIX programming.

Uploaded by

tonybaskar83
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

SACRED HEART COLLEGE (AUTONOMOUS), TIRUPATTUR, VELLORE DT.

B.Sc. (CS) Degree VI Semester November 2018

Time: 3Hrs Max. Marks: 75

CS625 – UNIX AND SHELL PROGRAMMING

Section – A (10 x 2 =20 Marks)

Answer ALL the questions.

1. Differentiate the following UNIX commands used with files


cp, mv
2. What is purpose of the ulimitcommand?
3. If the file stuinfo contains the following:
1 ARUL SHC TIRUPATTUR
2 SACHIN SJC DELHI
3 ROHIT SXC PALAYMKOTTAI
Then what is the output for the command:
$cut –f 2, 4 stuinfo
4. Invent the situations where the user wants to kill a process. Name the command used
for the purpose.
5. Develop a shell script to read a number and then determine whether the number is odd
or even.
6. Distinguish between positional parameter and command line arguments.
7. Develop a shell script to create the following pattern where the input ‘n’ denotes the
number of lines. If the input is 4 then the output pattern expected is as follows:
*
* *
* * *
* * * *
8. Develop a shell script to print the command line arguments.
9. Differentiate between getpid() and getppid() system calls.
10. What is the purpose of pipe() system call?
Section – B (5 x 5 = 25 Marks)

Answer ALL the questions.

11. a) Explain the salient features of UNIX operating system.


(OR)
b) What are the various jobs that system administrator has to carry out? Discuss the
different ways by which that administrator can carry out these jobs.
12. a) Illustrate the following UNIX commands related to file: sort, grep
(OR)
b) Illustrate the following UNIX communication commands: write, wall
13. a) Develop shell script to generate first n terms of the Fibonacci sequence. The
Fibonacci sequence of numbers is: 0, 1, 1, 2, 3, 5, …
(OR)
b) Develop shell script to read a string and then determine the reversed string.
14. a) Develop a shell script to read a text file and then output the text file line by line
along with line numbers.
(OR)
b) Develop a shell script to read a list of numbers using command line arguments and
then determine the sum of numbers.
15. a) Develop a C program that create a copy of a file using open(), close(), read(),
write() and create() system calls.
(OR)
b) Explain the exec() family of system calls using segments of C code.
Section – C (3 x 10 =30 Marks)
Answer any THREE questions.
16. a) Explain the following UNIX commands related to mathematics: expr, bc, factor
b) Explain the tasks of a system administrator towards ensuring the system security in
UNIX.
17. a) Explain the process of I/O direction and piping using examples.
b) Explain the following UNIX commands used to view files: head, tail, pg
18. a) Develop a menu driven shell script to determine whether the given input is alphabet
or digit or special symbol.
b) Develop a shell script to copy the file using cp command.
19. a) write a shell script to read a list of values using command line arguments. The
script should terminate the iteration using break script when it encounters a negative
value. The script should also determine the sum of values encountered so far. For an
example if the input data contains the values: 25 38 75 87 97 -34 45 78 then the
program should terminate when it encounters -34 and then it should determine the
sum of the first five values alone and the output expected is 322.
b) Write a shell script to read a list of values using command line arguments. The
script should also determine the sum of values ignoring the negative values by using
continue script. For an example if the input data contains the values: 25 -12 77 17 -47
24 45 78 then the output expected is 266.
20. Develop a C program using the system calls fork() and wait() to create a child
process. The child process should generate the Fibonacci sequence and then return to
the parent process then the parent process should complete its execution to return to
the command prompt.

You might also like