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



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk - comparing files dbrundrett Shell Programming and Scripting 6 01-18-2009 10:51 PM
Comparing two files superstar003 Forum Support Area for Unregistered Users & Account Problems 1 05-08-2008 03:34 AM
Comparing two files.. padarthy Shell Programming and Scripting 1 08-29-2007 08:01 AM
Comparing two files... paqman Shell Programming and Scripting 12 08-08-2007 03:45 AM
comparing shadow files with real files terrym UNIX for Advanced & Expert Users 4 02-09-2007 02:38 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-15-2007
hdixon hdixon is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 2
Comparing 2 files

I’m hoping you can help me with this problem (I posted this yesterday but the posting and replies were lost). We just moved from AIX to Solaris. I have a script which is doing a diff on 2 files to get a file of just differences to be applied. The Solaris diff is creating a different 'diff' file than the AIX


For example I took the files and did the same command on both AIX and Solaris machines.
In looking at a portion of the file, this is what is different:


Old file: (FILE1)


NBBAKER BROOK E7A0A1
NBBAKER BROOK E7A0A2
NBBAKER BROOK E7A0A3
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A1
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A2
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A3
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A4
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A5
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A6
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A7
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A8
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A9
QCSHEFFORD J2M0A1
QCSHEFFORD J2M0A2
QCSHEFFORD J2M0A3
QCSHEFFORD J2M0A4
QCSHEFFORD J2M1A1
QCSHEFFORD J2M1A2
QCSHEFFORD J2M1A3
QCSHEFFORD J2M1A4
QCSHEFFORD J2M1A5
QCSHEFFORD J2M1A6
QCSHEFFORD J2M1A7
QCSHEFFORD J2M1A8
QCSHEFFORD J2M1A9



new File: (FILE2)


NBBAKER BROOK E7A0A1
NBBAKER BROOK E7A0A2
NBBAKER BROOK E7A0A3
NBLAC BAKER E7A0A4
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A1
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A2
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A3
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A4
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A5
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A6
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A7
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A8
NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A9
QCSHEFFORD J2M0A1
QCSHEFFORD J2M0A2
QCSHEFFORD J2M0A3
QCSHEFFORD J2M0A4
QCSHEFFORD J2M0A5
QCSHEFFORD J2M0A6
QCSHEFFORD J2M1A1
QCSHEFFORD J2M1A2
QCSHEFFORD J2M1A3
QCSHEFFORD J2M1A4
QCSHEFFORD J2M1A5
QCSHEFFORD J2M1A6
QCSHEFFORD J2M1A7
QCSHEFFORD J2M1A8
QCSHEFFORD J2M1A9



So the differences should be to add the records: E7A0A4
J2M0A5
J2M0A6 to file1



Diff statement on AIX:


85035a85072
> NBLAC BAKER E7A0A4
233803a233943,233944
> QCSHEFFORD J2M0A5
> QCSHEFFORD J2M0A6


Diff statement on Solaris:

85035a85072
> NBLAC BAKER E7A0A4
233804,233805c233943,233946
< QCSHEFFORD J2M1A1
< QCSHEFFORD J2M1A2
---
> QCSHEFFORD J2M0A5
> QCSHEFFORD J2M0A6
> QCSHEFFORD J2M1A1
> QCSHEFFORD J2M1A2


I tried using the bdiff, diff -h commands to see if that made any difference
but it doesn’t. Any idea what is causing the file to be created differently?
I just want to see the same layout as the AIX file. I don't understand why
it shows the records to be added on Solaris as sometimes just the record as in E7A0A4 and sometimes showing what records were in both files as in J2M1A1.

Thanks,

Helen
  #2 (permalink)  
Old 06-15-2007
solfreak's Avatar
solfreak solfreak is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 35
hdixon,

Both the diff's are correct -- if you apply the editing commands (ed) in the diff to the 2nd file it will produce the first file.
  #3 (permalink)  
Old 08-01-2007
rafisha rafisha is offline
Registered User
  
 

Join Date: Jul 2007
Location: Monterrey, Mexico
Posts: 4
try with comm it worked for me, i had to find the diferences between two files, here is the url of my problem's post, good luck

http://www.unix.com/shell-programmin...t-of-data.html
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:05 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0