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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
diff command ariec AIX 3 06-05-2008 03:16 AM
need help in diff command : ali560045 Shell Programming and Scripting 5 05-26-2008 09:22 AM
diff command Vichu Shell Programming and Scripting 1 04-28-2008 07:06 AM
Problem in using diff ragavhere Shell Programming and Scripting 6 04-19-2008 09:56 AM
diff command gilead29 UNIX for Dummies Questions & Answers 7 03-09-2004 09:12 PM

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 09-29-2007
gvsreddy_539 gvsreddy_539 is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 17
Exclamation Diff command problem

Folks,
I am Diff'ing 2 identical files..and the result is, it shows all the lines from 2 files (saying nothing is being matched).

If I copy the content from 1 of the file and paste in a newly created file and then do the diff, it equals.

2 files are xml files.
I've tried many combinations..no clue till now.

I have 1 file as base file and another one comes from a Java Process and on which I do some parsing and substitution of Strings.

Please through some light on this ..

--Venkat.
  #2 (permalink)  
Old 09-29-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Get an md5 checksum of each file. That will tell you if they are different.
  #3 (permalink)  
Old 09-29-2007
gvsreddy_539 gvsreddy_539 is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 17
Thanks Portor.

Yes, I see different "cksum" for 2 files. but still I am not understanding why they r differing though the content is same?

Any more clues?
  #4 (permalink)  
Old 09-29-2007
awk awk is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 134
Quote:
Originally Posted by gvsreddy_539 View Post
Thanks Portor.

Yes, I see different "cksum" for 2 files. but still I am not understanding why they r differing though the content is same?

Any more clues?

Far too much of a guessing game. Try doing a od command on each of the files, say for the first couple of lines of input.

Most likely, a tab will be spaces, or one file will end in a DOS format, and not Unix.

The od command will show you the actual characters in each of the files (not just how they show on a screen), so you shold be able to decipher from there.
  #5 (permalink)  
Old 09-30-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,209
Try a
Code:
cat -vet <filename>
on each file and as awk said look for tabs that have been converted to spaces or ^M chararcters at the end of the lines.
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 04:02 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