If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > different result from bdiff vs diff

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-09, 02:47
ymho ymho is offline
Registered User
 
Join Date: Jul 2006
Posts: 109
different result from bdiff vs diff

according to unix help, suppose bdiff return same result as diff's except bdiff handle >2G files ... but

2 files a1 & b1
cat a1
--
1
2
3

cat b1
--
1
3
6

diff a1 b1
--
2d1
< 2
3a3
> 6

bdiff a1 b1 1
--
2c2
< 2
---
> 3
3c3
< 3
---
> 6

pls advise how to make their result is the same..
Reply With Quote
  #2 (permalink)  
Old 01-05-09, 04:00
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The net result of both is the same. 'diff' removes one row and adds another one. 'bdiff' replaces two rows. So I don't quite see the problem...
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 01-05-09, 06:12
ymho ymho is offline
Registered User
 
Join Date: Jul 2006
Posts: 109
Quote:
Originally Posted by stolze
The net result of both is the same. 'diff' removes one row and adds another one. 'bdiff' replaces two rows. So I don't quite see the problem...
i want to get the delta changes between 2 files by grep ">" & "<" from diff result.

but it doesnt work for bdiff.

pls advise any alterative.
Reply With Quote
  #4 (permalink)  
Old 01-06-09, 03:13
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
What doesn't work for 'bdiff'? 'bdiff' produces a regular patch and the output contains all changes.

Also, what are the correct semantics in your case - was row 2 deleted and 6 added - or was 2 changed to 3 and the orginal 3 changed to 6? 'diff' has no clue and it just applies some algorithm to identify changes. And apparently, your 'bdiff' tries less hard to find rows that are the same and just moved in the order of rows.

Maybe it helps if you explain the actual problem you try to solve. Here we are discussing about a specific technical detail only and most probably you do not want to establish such a dependency on the tool's behavior (since this can change with any system update).
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 01-06-09, 10:57
ymho ymho is offline
Registered User
 
Join Date: Jul 2006
Posts: 109
thx a lot ...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On