Pages

Welcome Fellow Batchmates

Hey Folks ! Welcome to RVCE MCA 2013 homepage exclusively for our batch. I ll be updating the blog with the happening and useful events from class. Hoping for a good response from you guys and make this three years of post-graduation a memorable one ! Just click on "Join this site" to the right corner of this page and you are good to go ! Once you join, "Comment" on the posts :)

Saturday, December 31, 2011

Unix Assignment


R V College of Engineering
Department of Master of Computer Application
I Semester 'A' Section -    ASSIGNMENT
Subject Code    : 10MCA14                                                                                 Date    : 19 -12-2011
Subject Title     : Introduction to UNIX                                     Submission Date : 02-01-2012
Faculty Name   : Sudha M                                                                                       Max. Marks: 10        

Group 1:   Roll No. : 1 – 10

1.       Explain the Mechanism of Process Creation.                                                   2.5 Marks

2.       Device pipeline to :                                                                         0.5x5=2.5 Marks
i.     list the five largest ordinary files in the directory including the dot files.
ii.    display files with all attributes and count the number of files listed.
iii.   search the /etc/passwd file and extract the 1st and 6th field and save it in a file “myetcpwd”
iv.   search the /etc/passwd file and extract the 1st and 6th field display it on the standard output      device and save it in a file “myetcpwd”
v.    list all the ordinary files in the current directory

3.            Write a script that accepts a compressed filename as argumentc(which could be .gz, .bz2 or .zip).  It looks at the extension and decmpresses the file using the correct decompression program, but only if the decompressed file (or one with the same name) does'nt exist. The  script should include proper validation and should not fail under any condition.

Group 2:  Roll No. : 11 - 20

1.       Explain in detail the Shell's Interpretive Cycle                                                2.5 Marks

2.       Device pipeline to :                                                                         0.5x5=2.5 Marks
1.    list the five smallest ordinary files in the directory including the dot files.
2.    display all c files with all attributes and count the number of files listed.
3.    match all lines that do not match the pattern “sales” in the file emp.lst
4.    store the output of the previous pipeline in the file “otherthansales” and display it on the standard output device too.
5.    search the /etc/passwd file and extract the first four fields and save it in a file “myetcpwd”

3.            Write a script that behaves both interactive and non interactive mode.  When no arguments are passed, it picks up each 'C' program from the current directory and lists the first 10 lines. It then prompts for deletion of the file.  It the user supplies arguments with the script, then it works on those files.

Group 3:  Roll No. : 21 - 30

1.       Write a detail note on background processes in UNIX                                    2.5 Marks

2.       Device pipeline to :                                                                         0.5x5=2.5 Marks   1.       list the five largest ordinary files in the directory including the dot files.
          2.       display files with all attributes and count the number of files listed.
          3.       Search for all directors and replace them “managing director”
          4.       search the /etc/passwd file and extract the 1st and 6th field and save it in a file                              “myetcpwd”
          5.       search the /etc/passwd file and extract the 1st and 6th field display it on the standard                     output          device and save it in a file “myetcpwd”


3.            Write a script that looks up every “.c” file in the current directory for the string printf or fprintf.  If found, the script adds the statement #include <stdio.h> at the begining of the file but only if it does not have it included.

Group 4:  Roll No. : 31 - 40

1.       Explain in detail about Proces and its states.                                                         2.5 Marks

2.       Device pipeline to :                                                                         0.5x5=2.5 Marks
vi.   list the all the files in the filesystem and display it on the standard output device  and save it in the file myfilesystem.
vii. Recursively search all files in the path /home/mca with all file attributes and count the number of shell scritps present in the given path
viii.        search all employees working in the marketing department and store them in the file “marketingpersonnel”
ix.   search the /etc/passwd file and extract the 1st and 6th field and save it in a file “myetcpwd”
x.    search the /etc/passwd file and extract the 1st and 6th field display it on the standard output      device and save it in a file “myetcpwd”

3.       Write a shell script that looks at every component of PATH and checks whether the directory           exists and is also accessible.                                                                             5 Marks




Group 5:  Roll No. : 41 - 50


1.       Explain in detail the sed command and the instructions used by sed.               2.5 Marks

2.       Device pipeline to :                                                                         0.5x5=2.5 Marks
xi.   list the five largest ordinary files in the directory including the dot files.
xii. display files with all attributes and count the number of files listed.
xiii.        search all employees working in the marketing department and store them in the file “marketingpersonnel”
xiv.        search the /etc/passwd file and extract the 1st and 6th field and save it in a file “myetcpwd”
xv. search the /etc/passwd file and extract the 1st and 6th field display it on the standard output      device and save it in a file “myetcpwd”

3.       You have two files ,foo1 and foo2 ,copied fom two /etc/passwd files on two machines. How   do you print a list of users who are i) present in foo1 but not in foo2,ii)present in foo2 and    not in foo1,iii)present in both files.     


Group 6:  Roll No. : 51 - 60


1.       Explain in detail the various modes of vi editor and commands in respective modes.
 2.5 Marks

2.       Device pipeline to :                                                                         0.5x5=2.5 Marks
i.     list the five largest ordinary files in the directory including the dot files.
ii.    display files with all attributes and count the number of files listed.
iii.   match all lines that do not match the pattern “sales” in the file emp.lst
iv.   store the output of the previous pipeline in the file “otherthansales” and display it on the standard output device too.
v.    search the /etc/passwd file and extract the first four fields and save it in a file “myetcpwd”

3.       You have a number of 'C' programs that contain comment lines at the begining of each         program.  The lines with the */ followed by the first line of comment, but the terminator line    has */ as the only characters in the line.  Remove these comments from all files.