Shell script to compare that given two files are same or not, Programming Languages

Assignment Help:

W.A.S.S to compare that given two files are same or not. If found same then delete the second file.

  echo -e "Enter the 1st File name : \c"

read ffname

echo -e "Enter the 2nd File name : \c"

read sfname

res=`cmp $ffname $sfname|wc -l`

//cmp is used for comparing two files and return where those are different

if [ $res -eq 1 ]

then

         echo "Both files are not same"

else

         echo "Both files are same"

         rm $sfname

fi

 

Output

sh  compare.sh

 

Enter the 1st File name : t1.txt

Enter the 2nd File name : t2.txt

Both files are same

 


Related Discussions:- Shell script to compare that given two files are same or not

Check a file for spelling errors, Normal 0 false false fals...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Game, How to make game in pascal language

How to make game in pascal language

Programming project, Create a visualization (programming project) and demon...

Create a visualization (programming project) and demonstrate it in the class. The project should be related to distributed systems. (A distributed system consists of multiple auton

Create hijara game application, Assignment is to create hijara game on any ...

Assignment is to create hijara game on any plate form, you can use any plate form you like or easy to you. For instance let's say you can use visual studio, game studio (Prefer to

ARM LANGUAGE, I WANT TO MAKE PROJECT IN ARM LANGUAGE CAN YOU HELP ME

I WANT TO MAKE PROJECT IN ARM LANGUAGE CAN YOU HELP ME

Python , Write a script that will list and count all of the images in a giv...

Write a script that will list and count all of the images in a given HTML web page. Each image starts with

Pseudo-code to illustrate the breakpoint in a program, The standard way for...

The standard way for debuggers to plant interactive breakpoints in a program in RAM (whatever the processor instruction set) is to save the break pointed instruction and replace it

Help with c assignment, You will design and implement a program that will •...

You will design and implement a program that will • analyse the various characteristics of a maze, represented by a particular coding of its basic con- stituents into numbers store

Oop, Using OOP,write a sample program to get the factorial of a number ente...

Using OOP,write a sample program to get the factorial of a number entered by a user

Cobol program, need someone to write a simple cobol program for me..urgent

need someone to write a simple cobol program for me..urgent

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd