0% found this document useful (0 votes)
4 views

CSC 3120 UNIX-SHELL PROGRAMMING

This document outlines the examination structure for the CSC 3120: UNIX-SHELL PROGRAMMING course at St. Paul's University for the May-August 2022/2023 semester. It includes compulsory and optional questions covering various aspects of Unix-shell programming, such as commands, scripting, file attributes, and application areas. The exam also requires students to write shell scripts for specific tasks and to discuss theoretical concepts related to Unix and shell scripting.

Uploaded by

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

CSC 3120 UNIX-SHELL PROGRAMMING

This document outlines the examination structure for the CSC 3120: UNIX-SHELL PROGRAMMING course at St. Paul's University for the May-August 2022/2023 semester. It includes compulsory and optional questions covering various aspects of Unix-shell programming, such as commands, scripting, file attributes, and application areas. The exam also requires students to write shell scripts for specific tasks and to discuss theoretical concepts related to Unix and shell scripting.

Uploaded by

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

ST.

PAUL’S UNIVERSITY
. P A U L ’S

UN
I VE R S I TY
Private Bag 00217 Limuru, KENYA
S T

SE R
VANT
S OF GO D AND HUMANI
TY
Tel: 020-2020505/2020510/0728-669000/0736-424440

SCHOOL OF COMMUNICATION AND COMPUTER STUDIES


BACHELOR OF SCIENCE IN COMPUTER SCIENCE
MAY - AUGUST 2022/2023 SEMESTER
CSC 3120: UNIX-SHELL PROGRAMMING

DATE: AUGUST, 2023 TIME: 2 Hours


INSTRUCTIONS: SECTION A IS COMPULSORY. ANSWER ANY OTHER TWO QUESTIONS IN
SECTION B.
SECTION A: COMPULSORY

QUESTION ONE
a) Using examples, define the following commands used in Unix-Shell programming. (6 Marks)

i. grep

ii. sed

iii. awk

b) Explain TWO disadvantages of Unix-shell as an interpreter. (4 Marks)

c) Write a simple shell script that asks the user to enter his name and displays a personalized message
“Welcome to Unix-Shell Programming.” (3 Marks)

d) Distinguish between UNIX operating system and Windows operating system. (3 Marks)

e) Explain TWO advantages of using Functions in shell scripting. (4 Marks)

f) Describe the sort filter and illustrate its usage with -k, -u, -n, -r, and -c options. (5 Marks)

g) Write a menu-driven shell script to perform the following. (5 Marks)


i. List of user who is logged in.
ii. List of files in the current directory.
iii. List of processes of user.
iv. Today’s date.
v. Quit to UNIX
SECTION B: ANSWER ANY TWO QUESTIONS FROM THIS SECTION
QUESTION TWO
a) Describe FOUR reasons why it is necessary to use comments in Shell scripting. (4 marks)

b) Illustrate using simple examples TWO main ways of running a shell script. (4 marks)

c) Discuss THREE attributes of every file that exist in UNIX operating system. (6 marks)

d) Write a simple shell script to find out the unique words in a file. The script should also help to count
the occurrence of each of the unique words. Assume that the file under consideration contains many lines,
and each line has multiple words. (6 marks)

QUESTION THREE
a) Outline FOUR application areas of Unix-shell programming. (4 marks)
b) Discuss THREE different quote characters and their behaviours as used in shell scripting. (6 marks)
c) By use of a simple diagram, illustrate the main concepts that unite all the versions of UNIX operating
systems. (4 marks)
d) Write a menu driven shell script that prints out a 12 by 12 multiplication table. (6 marks)

QUESTION FOUR
a) State FOUR types of UNIX shells that exist in the market today. (4 marks)
b) Distinguish between the TWO main methods used to change file/directory permissions in UNIX operating
system. (4 marks)
c) Discuss THREE types of logic structures supported by shell scripts. (6 marks)
d) Write a menu driven script that prints the average marks of five students in a class. (6 marks)
QUESTION FIVE
a) Describe FOUR advantages of shell scripting. (4 marks)

b) By use of examples, explain THREE different types of variables supported by shell scripting.

(6 marks)

c) Explain the THREE distinct phases of process creation and state how the shell is created. (6 marks)
d) Write a shell script that compares two numbers, and then prints the smallest of the numbers.
(4 marks)

You might also like