diff utility exclude option

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • keydrive
    New Member
    • Oct 2007
    • 57

    diff utility exclude option

    I need to exclude a line when using UNIX diff utility. I have 4 files, the first two f1 and f2 work with the command however does not on f3 and f4.

    Suggestions?

    This works
    Code:
    diff -I '^<committed.*' f1 f2
    f1
    <committed:123> </committed>
    <committed_docu ments>4</committed_docum ents>

    f2
    <committed:345> </committed>
    <committed_docu ments>46</committed_docum ents>



    But these don't
    Code:
    diff -I '^<committed.*' f3 f4
    diff -I '^\s<committed.*' f3 f4
    diff -I '^[:punct:]committed.*' f3 f4
    f3
    <committed_docu ments>4</committed_docum ents>
    <terms>880</terms>

    f4
    <committed_docu ments>46</committed_docum ents>
    <terms>80</terms>
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    Code:
    diff -I '^<committed.' -I 'terms' f3 f4

    Comment

    Working...