search

Wednesday 22 March 2017

Linux programming lab mannual

                 LINUX PROGRAMMING LAB MANUAL 

Course Objectives:
 To implement some standard Unix utilities using system calls.
 To develop shell scripts to solve problems.
 To produce programs in C for network-based applications.
 To implement CPU scheduling algorithms,file allocation methods and page replacement algorithms in C.
Note: Use Bash for Shell scripts.

1. Write a shell script that accepts a file name, starting and ending line numbers as
arguments and displays all the lines between the given line numbers.
2. Write a shell script that deletes all lines containing a specified word in one or more files
supplied as arguments to it.
3. Write a shell script that displays a list of all the files in the current directory to which the
user has read, write and execute permissions.
4. Write a shell script that receives any number of file names as arguments checks if every
argument supplied is a file or a directory and reports accordingly. Whenever the
argument is a file, the number of lines on it is also reported.
5. Write a shell script that accepts a list of file names as its arguments, counts and reports
the occurrence of each word that is present in the first argument file on other argument
files.
6. Write a shell script to list all of the directory files in a directory.
7. Write a shell script to find factorial of a given integer.
8. Write an awk script to count the number of lines in a file that do not contain vowels.
9. Write an awk script to find the number of characters, words and lines in a file.
10. Write a C program that makes a copy of a file using standard I/O and system calls.
11. Implement in C the following Unix commands using System calls
a). cat b) mv
12. Write a C program to list files in a directory.
13. Write a C program to emulate the Unix ls –l command.
14. Write a C program to list for every file in a directory, its inode number and file name.
15. Write a C program that redirects standard output to a file.Ex: ls > f1.
16. Write a C program to create a child process and allow the parent to display “parent” and
the child to display “child” on the screen.
17. Write a C program to create a Zombie process.
(w.e.f 2015-16)
18. Write a C program that illustrates how an orphan is created.
19. Write a C program that illustrates how to execute two commands concurrently with a
command pipe. Ex:- ls –l | sort
20. Write C programs that illustrate communication between two unrelated processes using named pipe.
21.Write a C program in which a parent writes a message to a pipe and the child reads the
message.
22. Write a C program (sender.c) to create a message queue with read and write permissions to write 3 messages to it with different priority numbers.
23. Write a C program (receiver.c) that receives the messages (from the above message queue as specified in (22)) and displays them.
24. Write a C programs to transfer a large amount of data between processes,using
a) a pipe b)a FIFO c)a message queue.
25.Write a C program to allow cooperating processes to lock a resource for exclusive use,
using: a)Semaphores b)flock or lockf system calls.
26.Write a C program that illustrates suspending and resuming processes using signals.
27.Write a C program that implements a producer-consumer system with two processes.
(using Semaphores).
28.Write client and server programs(using c) for interaction between server and client processes using
Unix Domain sockets.
29.Write client and server programs(using c) for interaction between server and client processes using
Internet Domain sockets.
30.Write C programs that illustrate two processes communicating using shared memory.
TEXT BOOKS:
1.Advanced Unix Programming, N.B.Venkateswarulu, BS Publications.
2.Unix and Shell programming, B.A.Forouzan and R.F.Gilberg, Cengage Learning.
3.Unix and Shell Programming, M.G. Venkatesh Murthy, Pearson Education, 2005.
4.Unix Shells by Example, 4th Edition, Elllie Quigley, Pearson Education.
5.Sed and Awk, O.Dougherty&A.Robbins,2nd edition,SPD.

No comments:

Post a Comment