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

Use an insertion sort to sort an array, Use an insertion sort to sort an ar...

Use an insertion sort to sort an array (sequence) of long word integers. The size of the list will appear just before the list itself. Use the same labels as in this example: LE

Example problem of modularity, Example problem Imagine that  you  requ...

Example problem Imagine that  you  require  to create  a robot  that  will  roll up  close to a light  lamp  and  stop  a fixed distance from it.  The first question is, how w

Java, how to save bulk entries at a time using collections?

how to save bulk entries at a time using collections?

Sql vb integration, I need an application that will gather data from one SQ...

I need an application that will gather data from one SQL Database and update another. Data is contained in dbo.CallList with following fields: Customer_ID, AlreadyPickedUp, Phone_N

Php parse out custom lines from a file, i want another php script like that...

i want another php script like that one in assignment: EM201484 SA727PHP i want to parse out an urls form log file i will post attachments for a demo

Java packages, Expertsmind brings you unique solution in java assignments ...

Expertsmind brings you unique solution in java assignments Packages A Java packages is a process for planning Java sessions into namespaces just like the segments of Modu

Program for deleting nodes from the binary search tree, Problem: This...

Problem: This assignment is about deleting nodes from the binary search tree. You need to use given sequence to construct a binary search tree and then delete some nodes from

JUnit test, hi, can you help me with testing java classes I have wrote usin...

hi, can you help me with testing java classes I have wrote using java and jsp and servlet in eclipse ? I want to use JUnit for testing

Define a procedure which makes an avl tree with one node, (a) Define a proc...

(a) Define a procedure called make-avl-tree which makes an AVL tree with one node. Also create another constructor build-avl-tree that creates an AVL tree from a root, left subtree

Pseudo code for random numbers, Pseudo code the shows logic for a program ...

Pseudo code the shows logic for a program that generates a random number, then ask the user to think of a number between 1 and 10

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