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

Write a program to create map function, Given a list of numbers, say my ...

Given a list of numbers, say my @input_numbers = (1, 1, 3, 5, 8, 13, 21, 34, 55, 89, 144); write a program map1.pl that will use the function map (a) to produce a list of

Assignment about prolog, Hi I have an assignment for prolog languagle is ...

Hi I have an assignment for prolog languagle is it possible to get help

System calls, #questiWrite down different system calls for performing diffe...

#questiWrite down different system calls for performing different kinds of tasks.on..

Program to reads a sequence of integer numbers , Task: This assignment...

Task: This assignment is about writing programmes and Web Services in C#: 1) Develop a console programme that reads a sequence of integer numbers from the console and sorts

Fortran function for find and print out all prime number, Write a Fortran L...

Write a Fortran LOGICAL FUNCTION, called "is_prime", which determines if a given integer value is a prime number or not (A prime number is a natural number which has only two disti

Super ascii string cost in c++, Ask question #Minimum 100 A string S is sai...

Ask question #Minimum 100 A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets

Components of dot net framework 3-5, Components of .NET Framework 3.5 .NET ...

Components of .NET Framework 3.5 .NET Framework Conceptual Overview Presents the .NET Structure and its elements. Installing the .NET Framework Provides information about .NET Stru

Pop game application , In this exercise you will develop a small 'Pop Game'...

In this exercise you will develop a small 'Pop Game' in which the user will "pop" shapes that are drawn on the screen. The game will be time based, showing a shot clock at the top

C++, You are to write a program which will answer a pair of questions for s...

You are to write a program which will answer a pair of questions for squares, triangles, circles and ellipses. A square is defined by its lower left corner (SLLx,SLLy), and the len

Small code have missing part, #question. /* * * * * * * * * * * * * * * * *...

#question. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Description: *

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