Exam Details
Subject | unix and shell programming lab | |
Paper | ||
Exam / Course | m.c.a | |
Department | ||
Organization | Alagappa University Distance Education | |
Position | ||
Exam Date | December, 2017 | |
City, State | tamil nadu, karaikudi |
Question Paper
DISTANCE EDUCATION
M.C.A. DEGREE EXAMINATION, DECEMBER 2017.
Second Semester
UNIX AND SHELL PROGRAMMING LAB
(2010 Academic Year Onwards)
Time Three hours Maximum 100 marks
Examiner has to select ONE question and give it to the student
by the lot system.
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.
Write a shell script that deletes all lines containing
a specified word in one or more files supplied asarguments
to it.
2. Write a shell script that computes the gross salary
of a employee according to the following rules:
If basic salary is 1,500 then HRA 10% of
the basic and DA 90% of the basic.
If basic salary is l,500 then HRA Rs. 500
and DA 98% of the basic.
The basic salary is entered interactively through
the key board.
Write a shell program to reverse the given string.
Sub. Code
206
Cut here
DE-9847
2
Sp 6
3. Write a shell script that accepts two integers as its
arguments and computes the value of first number
raised to the power of the second number.
Write an interactive file-handling shell program,
which offers the choice of copying, removing.
renaming, linking files.
4. A school maintains students' details. Write a shell
program to list the following:
Students listed as male and female.
Students marks above 70 and marks below 40.
Students' name, address, phone numbers.
Write a program for four-function calculator by
using yacc command
5. Write a shell script which receives two file names as
arguments. It should check whether the two file
contents are same or not. If they are same then
second file should be deleted.
Write a shell script that takes a command line
argument and reports on whether it is directory, a
file or something else.
Cut here
Cut here
DE-9847
3
Sp 6
6. Write and execute the UNIX Commands for
performing the following:
To create a directory.
To compare two files and show the differences.
To pipe the output of "who" command to the
"sort" command.
To change the ownership of a file
To save the output in a file and display the
same on the VDU.
Write a shell script to display user name, current
directory, current date and time.
7. Write a menu driven shell program for the
following:
To check if a file is writ able.
Exit from Unix.
Write a shell program to accept a number from
0 to 9 and display the same number in words.
8. Write a script which reads a number in units of
seconds and converts it to the units
hours:minutes:seconds and prints the result to
standard output.
Write a shell program to accept a string and check
whether it is palindrome or not.
Cut here
Cut here
DE-9847
4
Sp 6
9. Write a shell program to arrange the names in
alphabetical order with swapping done in a separate
function.
Write a shell program to generate the Fibonacci
series.
10. Write a shell program for the following:
List the files in date order.
Sort the files in descending order.
Write a shell program to check whether given
number is even or odd using positional parameters.
M.C.A. DEGREE EXAMINATION, DECEMBER 2017.
Second Semester
UNIX AND SHELL PROGRAMMING LAB
(2010 Academic Year Onwards)
Time Three hours Maximum 100 marks
Examiner has to select ONE question and give it to the student
by the lot system.
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.
Write a shell script that deletes all lines containing
a specified word in one or more files supplied asarguments
to it.
2. Write a shell script that computes the gross salary
of a employee according to the following rules:
If basic salary is 1,500 then HRA 10% of
the basic and DA 90% of the basic.
If basic salary is l,500 then HRA Rs. 500
and DA 98% of the basic.
The basic salary is entered interactively through
the key board.
Write a shell program to reverse the given string.
Sub. Code
206
Cut here
DE-9847
2
Sp 6
3. Write a shell script that accepts two integers as its
arguments and computes the value of first number
raised to the power of the second number.
Write an interactive file-handling shell program,
which offers the choice of copying, removing.
renaming, linking files.
4. A school maintains students' details. Write a shell
program to list the following:
Students listed as male and female.
Students marks above 70 and marks below 40.
Students' name, address, phone numbers.
Write a program for four-function calculator by
using yacc command
5. Write a shell script which receives two file names as
arguments. It should check whether the two file
contents are same or not. If they are same then
second file should be deleted.
Write a shell script that takes a command line
argument and reports on whether it is directory, a
file or something else.
Cut here
Cut here
DE-9847
3
Sp 6
6. Write and execute the UNIX Commands for
performing the following:
To create a directory.
To compare two files and show the differences.
To pipe the output of "who" command to the
"sort" command.
To change the ownership of a file
To save the output in a file and display the
same on the VDU.
Write a shell script to display user name, current
directory, current date and time.
7. Write a menu driven shell program for the
following:
To check if a file is writ able.
Exit from Unix.
Write a shell program to accept a number from
0 to 9 and display the same number in words.
8. Write a script which reads a number in units of
seconds and converts it to the units
hours:minutes:seconds and prints the result to
standard output.
Write a shell program to accept a string and check
whether it is palindrome or not.
Cut here
Cut here
DE-9847
4
Sp 6
9. Write a shell program to arrange the names in
alphabetical order with swapping done in a separate
function.
Write a shell program to generate the Fibonacci
series.
10. Write a shell program for the following:
List the files in date order.
Sort the files in descending order.
Write a shell program to check whether given
number is even or odd using positional parameters.
Other Question Papers
Subjects
- c and data structures
- c++ and graphics lab
- communication skills
- computer applications
- computer graphics
- computer lab iii –– graphics and c++
- computer lab iv – visual basic
- digital computer organization
- lab ii – ms office and internet
- lab iv — visual basic
- object oriented programming and c++
- office automation
- operating systems
- principles of information technology
- relational database managementsystems
- system analysis and design
- unix and shell programming
- unix and shell programming lab
- visual programming