Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

diff showing difference when there is none [closed]

Tags:

linux

diff

These two files show as different when compared with

diff d_out.txt D_out.txt

I'm using Ubuntu (12.10) terminal.

The content of d_out.txt

ABCADBACDABCADBACDAB
ABCABCABCABCABCABCAB
CRASH
CRASH
CRASH
ABCDCABADCDBABCDCABA
ABCDBACBDABCDBACBDAB
ABCCABBCAABCCABBCAAB
ABCDDCBAABCDDCBAABCD
CRASH
CRASH
ABCDEEDABCCBEDAADCBE
ABCCAABCCAABCCAABCCA
ABBCCABBCCABBCCABBCC
ABCDEFFABCDEEFABCDDE
AABCDEFFABCDEEFABCDD
ABBCDEFAABCDEFFABCDE
ABBCCDDEDDCCBBABBCCD
CRASH
CRASH
ABCDEFGBADCFEBGDAFCB
ABCDEBADCBEDABCDEBAD
ABCDBADCABCDBADCABCD
ABCDEFGHIABCDEFGHIAB
ABCDEFGHIJABCDEFGHIJ
ABCDEFGHIJKABCDEFGHI
ABCDEFGHIJKLMNOPQRSA
CRASH
AABBCCDCCBBAAEAABBCC
AABBCCDCCBBAAEAABBCC

The contents of D_out.txt

ABCADBACDABCADBACDAB
ABCABCABCABCABCABCAB
CRASH
CRASH
CRASH
ABCDCABADCDBABCDCABA
ABCDBACBDABCDBACBDAB
ABCCABBCAABCCABBCAAB
ABCDDCBAABCDDCBAABCD
CRASH
CRASH
ABCDEEDABCCBEDAADCBE
ABCCAABCCAABCCAABCCA
ABBCCABBCCABBCCABBCC
ABCDEFFABCDEEFABCDDE
AABCDEFFABCDEEFABCDD
ABBCDEFAABCDEFFABCDE
ABBCCDDEDDCCBBABBCCD
CRASH
CRASH
ABCDEFGBADCFEBGDAFCB
ABCDEBADCBEDABCDEBAD
ABCDBADCABCDBADCABCD
ABCDEFGHIABCDEFGHIAB
ABCDEFGHIJABCDEFGHIJ
ABCDEFGHIJKABCDEFGHI
ABCDEFGHIJKLMNOPQRSA
CRASH
AABBCCDCCBBAAEAABBCC
AABBCCDCCBBAAEAABBCC

The text is originally from a program that was done to solve a contest problem. The D_out.txt file is the original judge output and d_out.txt is my output from the program that I've coded to solve that problem. I tried to find small differences but got none.

like image 845
Unrealist Avatar asked Dec 25 '12 18:12

Unrealist


1 Answers

These texts are equal.

What does diff outputs? you might have some extra white spaces there.

try

diff -w -B d_out.txt D_out.txt

-w Ignore all white space.

-B Ignore changes whose lines are all blank.

Check out the different diff options.

like image 118
Ofiris Avatar answered Sep 20 '22 17:09

Ofiris