I'd like to print a list of lines where the first word in two files is identical, and the rest of the words are not. Some complicated mess with
cut would be possible, but hopefully there's a simpler way.
Edit: I've managed to slap together some working code. Example tests:
$ cat file1 a 1 E b 2 F c 3 G $ cat file2 a M X b 2 Y c 3 G $ difff 1 file1 file2 # Differences in fields 2+3 1,2c1,2 < a 1 E < b 2 F --- > a M X > b 2 Y $ difff 1-2 file1 file2 # Differences in field 3 only 1c1 < b 2 F --- > b 2 Y
Edit 2: The speed is now bearable (compares two files of 1800 and 8700 lines in half a second).