Hi,
I have 2 files:
file 1 contains:
x
y
z
file 2 contains:
x
y
z
1
2
3
I am using the diff command to compare the 2 files so that I can get the differences between the 2 files. File 2 will always have extra data appended to it so the difference will always be the last few lines. In the case above the difference is:
1
2
3
My command is:
diff $location/file1.txt $location/file2.txt > $location/diff.txt
This seems to work some of the time but not all of the time. I have setup a cron job to compare these files 24x7 and I have noticed that the result of the diff is not always consistent.
Should I be using some options in the command? Or am I doing something incorrectly?
Any ideas or suggestions would be much appreciated.