0% found this document useful (0 votes)
200 views14 pages

Government Polytechnic, Amravati: Shell Script Program To Copy Contents of One File To Another

This document provides a micro-project report on developing a shell script program to copy the contents of one file to another. It includes an introduction, aim, actual procedure followed, resources used, outputs, skills developed, and an assessment by faculty. The student team installed Linux, created a logic for the program, implemented it with a case statement to handle different operations like copying, removing, and moving files, then tested and got feedback on the program.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
200 views14 pages

Government Polytechnic, Amravati: Shell Script Program To Copy Contents of One File To Another

This document provides a micro-project report on developing a shell script program to copy the contents of one file to another. It includes an introduction, aim, actual procedure followed, resources used, outputs, skills developed, and an assessment by faculty. The student team installed Linux, created a logic for the program, implemented it with a case statement to handle different operations like copying, removing, and moving files, then tested and got feedback on the program.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

MICRO-PROJECT REPORT

ON
Shell script program to copy contents of one file to another.

In Partial fulfillment of Diploma in Computer Engineering

(Sixth Semester)
In the subject of
Computer Graphics CM5460
By

Mr. Umesh K. Bagade – 18CM002


Ms. Dipali R. Chandele – 18CM010
Mr.Vinay S. Chopade – 18CM012
Mr. Kartik R. Dhoran– 18CM014
Ms. Samiksha S. Gedam – 18CM018
Submitted To

Government Polytechnic, Amravati


(An Autonomous Institute of Govt. of Maharashtra)

Under the guidance of

Prof. S. R. Patil Madam


Lecturer in Computer Engineering
Department Computer Engineering

Government Polytechnic, Amravati

1
(2020-2021)

Government Polytechnic, Amravati


(An Autonomous Institute Of Govt. of Maharashtra)

Department of Computer Engineering

Certificate
This is to certify that Mr. Umesh K. Bagade, Ms. Dipali R. Chandele, Mr.
Vinay S. Chpade, Mr. Kartik R. Dhoran, Ms. Samiksha S. Gedam Identity
Code. 18CM002, 18CM010, 18CM012, 18CM014, 18CM018 of Sixth Semester
Diploma in Computer Engineering has satisfactorily completed the micro-project
entitled “Shell script program to copy contents of one file to another.” in
“Linux Operating System” for the academic year 2020-2021 as prescribed in
the curriculum.

Place: Amravati Lecturer in Computer


Engineering
Date: 28/05 /2021

2
Annexure-I

PART A- Plan (About 1-2 pages)


Micro-Project Proposal

Title of Micro Project: Shell script program to copy contents of one file to another.

1.0 Brief Introduction


In this micro project we have to developed a shell script program to perform operations on file
such as copying contents of one file to another file , removing file from the directory, moving
the file using Unix commands.

2.0 Aim of the Micro-Project (in about 4 to 5 sentences)


This Micro-Project aims at:
1) Designing a shell script program.
2) Understanding the concepts shell script programming.
3) Using basic concepts to perform operations on file.

3.0 Action Plan (Sequence and time required for major activities for 8 weeks)

S.N. Details of activity Planned start Planned ID .Code & Name of Team
date Finish date Members
1 Discuss and Decide the topic. 12/05/2021 12/05/2021 All Members
2 Install linux operating system 14/05/2021 16/05/2021 18CM002 (Umesh Bagade)
to run shell script program.
3 Implemented the logic for 16/05/2021 20/05/2021 18CM012 (Vinay Chopade)
case..esac statement.
4 Implemented the logic for 16/05/2021 20/05/2021 18CM018 (Samiksha Gedam)
option 1)To copy contents
from one file to another.
5 Implemented logic for option 20/05/2021 22/05/2021 18CM014 (Kartik Dhoran)
2) To remove a file
6 Implemented logic for option 22/05/2021 26/05/2021 18CM010 (Deepali Chandele)
3) To move a file and 4)Exit
7. Implemented a logic for option 27/05/2021 30/05/2021 18CM002 (Umesh Bagade)
4) Exit , combined program

3
and run the program.

4.0 Resources Required (major resources such as raw material, some machining facility, software etc)

S.N. Name of Resource/material Specifications Qty Remarks


1 Computer/ laptop Laptop/Computer with 1
minimum i3 processor and 2
GB RAM
2 Operating System Linux 1

Guideline for Assessment of Micro-Project


Evaluation as per suggested Rubric for Assessment of Micro-Project

Assessment Characteristic to be assessed Average Good Excellent


Parameter (1 mark) (1.5 mark) (2 mark)
Process Relevance of the courses & proposals
Assessment Literature survey/market
(06) survey/information collection
Analysis of data & completion of the
target as per proposal/
Product Report Preparation/Quality of
Assessment Prototype/model
(04) Presentation / Viva

4
Annexure-II
PART B- (Outcomes after Execution)
Micro-Project Report

Title of Micro Project: Shell script program to copy contents of one file to another.

1.0 Brief Introduction


. In this micro project we have to developed a shell script program to perform operations on
file such as copying contents of one file to another file, removing file from the directory,
moving the file using Unix commands.

2.0 Aim of the Micro-Project (in about 4 to 5 sentences)


This Micro-Project aims at:
1. Designing a shell script program.
2. Understanding the concepts shell script programming.
3. Using basic concepts to perform operations on file

3.0 Course Outcomes Integrated


1. Install Linux operating system
2. Evaluate the basic Linux command and its utilities.
3. Develop shell program for solving different problems.

4.0 Actual Procedure Followed


Firstly, we discussed and decided the topic. Then installed the Linux operating system and created a
logic for program. After that we implemented a logic and created a program.

5.0 Actual Resources used (Mention the actual resources used)

S.N. Name of Resource/material Specifications Qty Remarks


1 Computer/ laptop Laptop/Computer with 1
minimum i3 processor and 2
GB RAM
2 Operating system Linux 1

6.0 Output
Output is attached at the last of report.

5
7.0 Skills Developed/learning out of this Micro-Project
We learned about shell scripting program to perform different operations and got
knowledge about basic commands of shell scripting.
8.0 Application of this Micro-Project

Signature of Student

9.0 Assessment by Faculty as per Rubrics

Student Id Process Product Total Marks Signature of Faculty


Assessment (06) Assessment (04) (10)
18CM002
18CM010
18CM012
18CM014
18CM018

6
Department Vision

Computer Department
VISION

Provide skilled professionals in Computer Engineering to contribute towards the


advancement of technology useful for society and industrial environment.

MISSION

1. Impart need based and value based education by providing exposure of latest
tools and technologies in the area of Computer Engineering to satisfy the
stakeholders.

2. Upgrade and maintain facilities for quality technical education with continuous
effort for excellence in Computer Engineering.
3. Train students with Computer Engineering knowledge to apply it in the general
disciplines of design, deployment of software and integration of existing
technologies for E-governance and for benefit of society.
4. Provide a learning ambience to enhance innovations, problem solving skills,
leadership qualities, team spirit and ethical responsibilities.
5. Provide an academic environment and consultancy services to the industry and
society in the area of Computer Engineering

7
Theory:

1) case…esac statement:

The basic syntax of the case...esac statement is to give an expression to evaluate and
to execute several different statements based on the value of the expression.
The interpreter checks each case against the value of the expression until a match is
found. If nothing matches, a default condition will be used.

Syntax:
case word in
pattern1)
Statement(s) to be executed if pattern1 matches
;;
pattern2)
Statement(s) to be executed if pattern2 matches
;;
pattern3)
Statement(s) to be executed if pattern3 matches
;;
*)
Default condition to be executed
;;
Esac

Here the string word is compared against every pattern until a match is found. The
statement(s) following the matching pattern executes. If no matches are found, the
case statement exits without performing any action.
There is no maximum number of patterns, but the minimum is one.

8
When statement(s) part executes, the command ;; indicates that the program flow
should jump to the end of the entire case statement. This is similar to break in the C
programming language.

2) if...else...fi

The if...else...fi statement is the next form of control statement that allows Shell to
execute statements in a controlled way and make the right choice.

Syntax:

if [ expression ]
then
Statement(s) to be executed if expression is true
else
Statement(s) to be executed if expression is not true
fi

The Shell expression is evaluated in the above syntax. If the resulting value is true,
given statement(s) are executed. If the expression is false, then else block statement
will be executed.

3) copy contents of file to another file.


To copy files and directories, the cp command is used under a Linux, UNIX-like,
and BSD like operating systems. cp is the command entered in a Unix and Linux
shell to copy a file from one place to another. The original file remains unchanged,
and the new file may have the same or a different name.

Syntax:
cp source_file_name dest_file_name

4) Moving a file

9
To move files, use the mv command, which is similar to the cp command, except
that with mv the file is physically moved from one place to another, instead of being
duplicated, as with cp.

Syntax:
mv source_file dest_file

5) Removing a file

To remove (or delete) a file in Linux from the command line, use either the rm
(remove) or unlink command.
The unlink command allows you to remove only a single file, while with rm you
can remove multiple files at once.

Syntax:
rm file_name

10
Program:

#! \bin\sh
echo "1. To copy contents of file"
echo "2. To remove a File"
echo "3. To move a file"
echo "4. Quit"
echo "Enter your choice"
read choice
case "$choice" in
1) echo "Enter a file name to copy contents:"
read file
echo "Enter a another file name:"
read file1
if [-f $file]
then
cp $file $file1
echo "Contents of $file are copied successfully to $file1"
else
echo "$file does not exist"
fi;;
2) echo "Enter a file name to be removed: "
read file
if [-f $file]
then
rm -i $file
echo "$file successfully removed"
else
echo "$file does not exist"
fi;;
3) echo "Enter a 1st file name: "
read file

11
echo "Enter a 2nd file name: "
read file1
if [-f $file]
then
mv $file $file1
echo "Contents of $file are moved to $file1"
else
echo "$file does not exist"
fi;;
4) echo "Exit"
exit ;;
esac
:wq

Output:

12
13
Conclusion: Thus, we successfully executed a project of Shell script program to
copy contents of one file to another file.

14

You might also like