The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-18-2008
prashanth.spl prashanth.spl is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 2
shell script for comparing 2 files

Hi,

how to read the 2 files and compare each other in shell script? i have 2 files test1 and test2, both files contains 20 character records.we have to compare file 1 records with file2, if exists then reject the record else we have to append it to test2 file. in file test1 around 100 single column records are there. and test2 around 50000 single column records.

how can we do in shell script?

ex: test1
burningburning21sstt
ex:test2
burningburning21eett

we need to compare only first 16 letters of the record like
if test1.burningburning21 = test2.burningburning21 then reject.


Thanks in advance