CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

DEPARTMENT OF MCA

COURSE FILE

Progarmme : Master of Computer Application

Semester : V

Course Code : MCA 502

Subject Name : UNIX & Shell Programming

Prepared By:


CONTENTS

1.  SYLLABUS

2.  LIST OF BOOKS

3.  TIME TABLE

4.  LECTURE PLAN

5.  TUTORIAL SHEET

6.  UNIT TEST PAPER

7.  MID SEM PAPER

8.  INSTRUCTIONAL PLAN

9.  TACTICAL PLAN

10.  QUESTION PAPER

11.  ATTENDANCE SHEET

12.  CLASS NOTES

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2007)

Unix & Shell Programming

Tutorial – 1

1.  What are the silent teature of unix operating system.

2.  Discuss several reason for the popularity in unix.

3.  Explain Concept of memory management in unix.

4.  Describe the structure of buffer poll.

5.  Write a algorithm for writing a disk block to a buffer.

6.  How is Unix OS different from Windows OS?

7.  Describe the architecture of Unix OS?

8.  Write an algorithm to manage buffer cache in Unix OS.Give all possible conditions?

9.  Discuss in brief the following:

a.  Process

b.  Sleeping state of a process

c.  Critical region

d.  Super block

e.  File table

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2007)

Unix & Shell Programming

Tutorial – 2

1.  What is the significance of inode?what are the contents of inode and

. incore inode ?

2.  Write a process to access inodes?

3.  Discuss the structure of a regular file .how byte offset can be converted into block number .Discuss it using an algorithm

4.  Write an algorithm to allocate inode?

5.  Write the race condition in assigning inodes?

6.  Write an algorithm for returning an inode that corresponds to a given path name?

7.  Describe the condition where the reference count of an inode can be greater than one?

8.  A file system should never contain a free inode where inode number is less than the rememberedinode used by ialloc.How is it possible for this assertion to be false?

9.  Write an algorithm for allocating disk blocks?

10. Find the physical location of byte offset 265100 in Unix file systemwhen the block size is 2048?

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2007)

Unix & Shell Programming

Tutorial – 3

1.  Brietly discuss Master and hare Process.

2.  Explain Change directory and change root.

3.  Expalin CPU Scheduling in unix

4.  What do you understand by process tracing? What are the drawbacks of using ‘trace’?

5.  Discuss various meta character in shell.

6.  Discuss in brief any five system call

7.  what do u understand by process states and transitions.

8.  Explain the meaning of the context of a process.

9.  what do u understand from interrupts and exceptions.

10. Give the definition and implementation of semaphores.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2007)

Unix & Shell Programming

Tutorial – 4

1.  Discuss Context of a process.

2.  Discuss “process creation “in detail.

3.  Writes down the algorithm for ‘sleep’.

4.  Explain in briet structure of regular file.

5.  Write short notes on any four of the following:

a.  Super block

b.  Pipes in UNIX

c.  Delayed writes of block

d.  Kernel data structures

e.  Multiprocessor system

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2007)

Unix & Shell Programming

Tutorial – 5

1.  Give the comparative study of Bourne and C Shell.

2.  Write a shell program which counts the number of character in a given strin.

3.  What are Awk patterns.

4.  Explain functions of ‘vi’ editor.

5.  Explain the system VIPC.

6.  Write a shell script to find the greatest common divisor for the given number 120 and 9.

7.  Write the script that ask for a word and a filename and then show how many times that word occurred in the file?

8.  Explain the following shell statement taking suitable shell script.

a.  For

b.  Expr

c.  Test

d.  Case

9.  Write a shell script which displays a list of all files in the current directory to which you have read ,write and execute permissions?


CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2007)

Unix & Shell Programming

MCA – 502

Unit Text -I

1.  What is directory layout in Unix file system?

2.  Draw and discuss the block diagram of Unix system Kernel

3.  Discuss silent feature of Unix OS?

4.  Which are the services provided by kernel?

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2007)

Unix & Shell Programming

MCA – 502

Unit Text –II

1.  Explain Butter cache in Detail?

2.  Draw Process State Diagram and explain it.

3.  Give the algo for allocation of In-core inode?

4.  What are the contents of static inode?

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2007)

Unix & Shell Programming

MCA – 502

Unit Text –III

1.  Describe file creation with the algo.

2.  Write short note on mounting system.

3.  Draw PCB and explain it?

4.  Write merits and demerits of buffer cache?

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2007)

Unix & Shell Programming

MCA – 502

Unit Text –IV

1.  What do you understand by ‘context switch’

2.  define Message, semaphore, shared memory,

3.  Difference between Bourn & C shell.

4.  Write a shell program which find largest of three number?

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2007)

Unix & Shell Programming

MCA – 502

Unit Text –V

1.  Write a shell scripts to accept 5 no. and display there squares and cubes.

2.  Write Short note on awk programming.

3.  Compare Linux with Other OS?

4.  Discuss various pattern in awk programming?

5.  Write short note on shall variables?

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MID SEMESTER EXAMINATION (September 2007)

MCA V SEMSTER

Subject: Unix & Shell Programming Max marks: 40

Subject Code : MCA 502 Time: 2 hrs

Note: 1. All question are compulsory

2.  All questions carry equal marks.

Q. 1 Describe briefly the architecture of UNIX Operating System.

Q.2 What is Buffer cache?

Q.3 Explain different shell command with example.

1. rmdir

2. in

3. cp

4. mkdir

5. cat

Q.4 Write down the strengths of UNIX Operating System.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MID SEMESTER EXAMINATION (September 2007)

MCA V SEMSTER

Unix & Shell Programming

Subject: Unix & Shell Programming Max marks: 40

Time: 2 hrs

Note: All question are compulsory, each question carry equal marks.

1.  Describe any five system calls for file system?

2.  Write Down the algorithm for sleep?

3.  Explain the following shell statement taking suitable shell script?

i.  While

ii. Until

iii.  Test

iv.  If else

4.  Write a note on various Linux flavors and explain Linux security features.

TABLE – 5.1 : Instructional Plan for Courses (July to Dec. 2007)

Course Code MCA 502 Course Category III YDC (Regular) Branch & Semester MCA – V SEM

Course Title

Name of Faculty member

Key:- Sem= Seminar; SS = Self Study; P = Lab. Work, min/major Project, T= Tutorial, Asmt = Assignment; OHP = Overhead

Projector; NTS = Notes;

Please Tick Mark in appropriate cells, HOD should Countersign before submission of the Plan.

Unit No. / Topics & sub topics / Instructional Method / Instructional Media / Remarks & core attitudes & Skills
L / T / P / Sem / SS / CB / OHP / As
MT / NTS / Model / LCD Pro

Countersignature of the HOD Signature of the concerned faculty member

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2006)

Unix & Shell Programming

Tutorial – 1

1.  Describe various states and their transitions during the life time of a process.

2.  Write down the algorithm for sleep.

3.  Discuss function of Super block.

4.  Briefly discuss Master and Hare Process.

5.  Explain the ‘case’ control structure.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2006)

Unix & Shell Programming

Tutorial – 2

1.  Explain through a suitable example how ‘awk’ handles array.

2.  Explain Linux / UNIX file system.

3.  Explain CPU Scheduling in unix.

4.  Explain use of wild character in unix.

5.  Discuss various Meta character in shell.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2006)

Unix & Shell Programming

Tutorial – 3

1.  What do you mean by demand paging.

2.  Explain concept of swapping and context switch.

3.  Discuss the advantage and disadvantage of buffer cache.

4.  What are the similarities and differences between header and inode.

5.  Write an algorithm for conversion of path name to an inode.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2006)

Unix & Shell Programming

Tutorial – 4

1.  Discuss the algorithm for assignment for new inodes.

2.  Discuss the algorithm for freeing inode.

3.  Explain Change directory and change root.

4.  Define STAT and FSTAT.

5.  Define DUP system call.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2006)

Unix & Shell Programming

Tutorial – 5

1.  Differentiate between the linking and mounting.

2.  Give the process state transition diagram.

3.  Describe manipulation of the process address space.

4.  What are the communication commands discuss in brief.

5.  Define the break and continue statement.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2006)

Unix & Shell Programming

MCA – 502

Unit Text –1

1.  Define term: Memory Management Interrupts.

2.  Explain Architecture of UNIX OS?

3.  What are the contents of a buffer. Discuss in detail?

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2006)

Unix & Shell Programming

MCA – 502

Unit Text –2

1.  Write an algorithm for returning an inode that corresponds to a given path name

2.  Discuss Super block.

3.  Discuss Pipes system call.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2006)

Unix & Shell Programming

MCA – 502

Unit Text –3

1.  Define network conmunic

2.  Describe layout of system memory.

3.  Short note on IPC?

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2006)

Unix & Shell Programming

MCA – 502

Unit Text –4

1.  Define network communication in UNIX.

2.  Differentiate between multitasking and multiprocessing system.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2006)

Unix & Shell Programming

MCA – 502

Unit Text – 5

1.  Define: Meta Character, Shell Variables.

2.  Discuss array handling in awk programming

3.  Short note on awk built in variables.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2005)

Unix & Shell Programming

Tutorial – 1

1.  Write an algorithm for allocation of a buffer for a block. Trace your algorithm for all the possible variation in input data.

2.  Discuss the structure of a regular file. How byte offset can be converted into a block number; discuss algorithmically.

3.  Define security feature of unix.

4.  What are Pipes? Differentiate between named and unnamed pipes.

5.  What are awk patterns.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2005)

Unix & Shell Programming

Tutorial – 2

1.  Define feature of linux.

2.  Compare Bourne & C – Shell.

3.  Discuss ‘context’ of a process.

4.  What for ‘fork’ system call is used.

5.  Define:- System kernel, Inode table .

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2005)

Unix & Shell Programming

Tutorial – 3

1.  Write a shell script to redirect the output of date command without time in it to a file.

2.  Describe in brief any one technique of process synchronization used in unix.

3.  Write short note on device driver.

4.  Define mounting of a file system.

5.  Explain IPC.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2005)

Unix & Shell Programming

Tutorial – 4

1.  What are the advantages of delayed write mechanism.

2.  Define user file description.

3.  Write limitation of multiprocessor.

4.  Give the layout of unix system memory.

5.  How ‘write’ system call works. What are its input parameter and return information.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

MCA V Semester (2005)

Unix & Shell Programming

Tutorial – 5

1.  Describe the architecture of unix operating system.

2.  Write down the strength of unix operating system.

3.  Explain in brief structure of regular file.

4.  Describe any five system calls for the file system.

5.  Describe PCB.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2001)

Unix & Shell Programming

MCA – 502

Unit Text – 1

1.  Explain Buffer cache in Detail?

2.  Discuss silent feature of Unix OS?

3.  Explain Process State Diagram.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2001)

Unix & Shell Programming

MCA – 502

Unit Text – 2

1.  What are the similarities and differences between buffer header and inode.

2.  Define : chrot, chdir, chown, chmod.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2001)

Unix & Shell Programming

MCA – 502

Unit Text – 3

1.  What are the contents of process table.

2.  Discuss sleeping state of a process.

3.  Describe the manipulation of address space.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2001)

Unix & Shell Programming

MCA – 502

Unit Text – 4

1.  Explain the system VIPC.

2.  Write down problem of multiprocessor system.

3.  Define interactive shell script with the help of example.

CLGNAME COLLEGE OF TECHNOLOGY, BHOPAL

Department of MCA

MCA V Semester (2001)

Unix & Shell Programming

MCA – 502

Unit Text – 5

1.  Discuss structure of Linux.

2.  Write short note on system administration.

3.  What are awk patterns. Describe Begin and End pattern.