Davide Brini wrote: > Bob Proulx wrote: > > $ comm -13 /tmp/a /tmp/b > > four > > five > > six > > I think this works by accident, since comm needs sorted files. > I get this: > > $ comm -13 /tmp/a /tmp/b > four > comm: file 2 is not in sorted order > five > six
Oops! Yes, you are right. I had forgotten about that requirement. My bad. > Here's an awk solution, assuming the newer file has previously been > determined (for example with stat as you suggest): > > awk 'NR==FNR{a[$0];next} !($0 in a)' oldfile newfile > > That prints lines in "newfile" that are not in "oldfile". I like it. Bob