Slip 1:


Slip 2:



Slip 3:

count c

filename

: To print number of characters in the file.

 count w

filename

: To print number of words in the file.

count l

filename

: To print number of lines in the file.


Slip 5: 




Slip 6: 

Reference String :    8, 5, 7, 8, 5, 7, 2, 3, 7, 3, 5, 9, 4, 6, 2



Slip 7:




Slip 8:



Slip 9:




Slip 10:


Reference String :    2, 4, 5, 6, 9, 4, 7, 3, 4, 5, 6, 7, 2, 4, 7, 1


Slip 11:

typeline -a      filename : To print all lines in the file.

Reference String : 3, 4, 5, 6, 3, 4, 7, 3, 4, 5, 6, 7, 2, 4, 6


Slip 12:




Slip 13: 


Reference String : 3, 4, 5, 4, 3, 4, 7, 2, 4, 5, 6, 7, 2, 4, 6


Slip 14:




Slip 15:


count w filename: To print number of words in the file.


Slip 16:




Slip 17: 




Slip 18:

1. Write a C program to simulate Non preemptive priority scheduling. The arrival time and first CPU-burst of different jobs should be input to the system. Accept no. of Processes, arrival time and burst time. The output should give Gantt chart, turnaround time and waiting time for each process. Also find the average waiting time and turnaround time.


2. Write a C program that demonstrates the use of nice() system call. After a child          Process is started using fork (), assign higher priority to the child using nice () system call.


Slip 19:

1. Write a C program to illustrate the concept of orphan process. Parent process creates a child and terminates before child has finished its task. So child process becomes orphan process. (Use fork(), sleep(), getpid(), getppid()).

2. Write the simulation program for demand paging and show the page scheduling and total number of page faults according the Optimal page replacement algorithm. Assume the memory of n frames.
Reference String :          7, 5, 4, 8, 5, 7, 2, 3, 1, 3, 5, 9, 4, 6


Slip 20:

1. Write a C program to simulate FCFS CPU-scheduling. The arrival time and first CPU-burst of different jobs should be input to the system. Accept no. of Processes, arrival time and burst time. The output should give turnaround time and waiting time for each process. Also find the average waiting time and turnaround time.

2. Write a program to implement the toy shell. It should display the command prompt “myshell$”. Tokenize the command line and execute the given command by creating the child process. Additionally it should interpret the following commands.
count c filename:- To print number of characters in the file.
count w filename:- To print number of words in the file.


Slip 21:

1. Write a C Program to create a child process using fork (), display parent and child process id. Child process will display the message “I am Child Process” and the parent process should display “I am Parent Process”.

2. Write a C program to simulate Non-preemptive Shortest Job First (SJF) – scheduling. The arrival time and first CPU-burst of different jobs should be input to the system. Accept no. of Processes, arrival time and burst time. The output should give turnaround time and waiting time for each process. Also find the average waiting time and turnaround time.


Slip 22:

1. Write the simulation program for Round Robin scheduling for given time quantum. The arrival time and first CPU-burst of different jobs should be input to the system. Accept no. of Processes, arrival time and burst time. The output should give the Gantt chart, turnaround time and waiting time for each process. Also display the average turnaround time and average waiting time.

2. Write a program to implement the shell. It should display the command prompt “myshell$”. Tokenize the command line and execute the given command by creating the child process. Additionally it should interpret the following commands.
myshell$ search a filename pattern : To search all the occurrence of pattern in the file.
myshell$ search c filename pattern To count the number of occurrence of pattern in the file.


Slip 23: 

1. Write a C program to implement the shell which displays the command prompt “myshell$”. It accepts the command, tokenize the command line and execute it by creating the child process. Also implement the additional command ‘typeline’ as
typeline +n filename:- To print first n lines in the file.
typeline -a  filename :- To print all lines in the file.


2. Write a C program to illustrate the concept of orphan process. Parent process creates a child and terminates before child has finished its task. So child process becomes orphan process. (Use fork(), sleep(), getpid(), getppid()).