Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2006
    Posts
    115

    Unanswered: 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..

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  3. #3
    Join Date
    Jul 2006
    Posts
    115
    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.

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  5. #5
    Join Date
    Jul 2006
    Posts
    115
    thx a lot ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •