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

Cobol, Need help with a cobol program.

Need help with a cobol program.

COS-101: INTRODUCTION TO COMPUTERS, COS-101: INTRODUCTION TO COMPUTERS PRO...

COS-101: INTRODUCTION TO COMPUTERS PROJECT DESCRIPTION The Computer Fundamentals Project provides you with a chance to apply what you have learned about computer fundamentals to

Fileless document and encryption(stegnography), code for using tree view co...

code for using tree view control and fill it with database

C# xna game project, I need to finish my game project within two weeks usin...

I need to finish my game project within two weeks using XNA. Would you guys can help me to finish it? Thank you

Learning when and how to use a while loop, 1.  A function that produces the...

1.  A function that produces the Collatz sequence and counts the number of terms. 2.  A main function that calculates interesting values about the Collatz sequence. 1.The Col

Triple eigenvalue with 3 linearly independent eigenvectors, 1 Triple Eigenv...

1 Triple Eigenvalue with 3 Linearly Independent Eigenvectors In this case we will have the eigenvalue l with the three linearly independent eigenvectors  ?h 1 , ?h 2 and  ?h

Creates an object and prompt the user to enter the name, Design an object d...

Design an object definition named Pet, which should have the following fields: name: The name field holds the name of a Pet type: The type field holds the type of anima

Built a liner program to manage a staff, A manager at the local Walmart nee...

A manager at the local Walmart needs to determine how many workers to hire to cover a 24-hour period. Each worker must work 9 consecutive hours but may only start work at the begin

Lalr parser - xml table output, LALR Parser: Rule Table - Contains de...

LALR Parser: Rule Table - Contains definitions of production rules within the grammar. Attributes: Count - Number of production rules in the table Child items:

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