I would like to write a bash script or a few shell commands that solves my problem. I have two files, old.txt, new.txt. I would like to produce a file, diff.txt, that has only the lines that have changed or are new. For instance if I had:
old.txt:
Sierra
Tango
Oscar
Victor
Whiskey
Yankee
new.txt:
Sierra
Tango
Echo
Osc__ar
Victor
Uniform
Whiskey
Yan__kee
I would want a diff.txt that looks like this:
Echo
Osc__ar
Uniform
Yan__kee
For perspective, I am writing this script to help me create a differential Motorolla S2 record for loading programs over serial port to an embedded computer. I know bash fairly well, I just don’t know where to get started.
1 Answer