Diff essentially does what I want, but it adds a bunch of other stuff. I haven't found a set of options to tell to simply the output. Here's an example:
-a.csv- 1,a 2,b 3,c -b.csv- 1,a 2,m 3,c 4,d 5,e 6,f Diff gives me the following: bash-5.1$ diff a.csv b.csv 2c2 < 2,b --- > 2,m 3a4,6 > 4,d > 5,e > 6,f The problem is that I only want to know what lines were added or changed (a change is considered an add for this project). Removals and metadata are not needed. Now that I'm looking at it again I suppose I can just grep for the ">" and use that as my final diff. I'm not seeing any obvious way to simply the output in the manpage. -Ben ------- Original Message ------- On Tuesday, December 27th, 2022 at 1:47 PM, Robert Citek <[email protected]> wrote: > Can you give an example of what you've tried and what you would like the > expected outcome to be? > > Here's a quick sample showing lines 4 and 5 have been added: > > $ diff <( seq 1 3 ) <( seq 1 5 ) > 3a4,5 > > > 4 > > 5 > > > Regards, > - Robert > > > On Tue, Dec 27, 2022 at 2:35 PM Ben Koenig [email protected] > > wrote: > > > Hi all, > > > > I thought there was a command to do this but I'm having trouble finding it > > and diff is doing strange stuff. > > > > I have a csv file that grows over time. What I want to do is take a newer > > version of the file, compare it to the old one, and only print the lines > > that are different. This also needs to be easily automated within a BASH > > script. > > > > Are there options to diff that I'm missing or a different command that can > > quickly print only those lines unique to the first file? I'm resisting the > > urge to read the lines into a python list and compare manually. > > > > -Ben
