For some reason, diff is not responding as expected to the -w option; two files, both of which are identical except for a single new line at the end of the XML header.
I’m invoking diff with the -w option, like so:
diff -w old_file.xml new_file.xml
# head -n4 old_file.xml:
<?xml version="1.0" encoding="utf-8"?><survey audio_access_number="" custom="" name="test_conditionFormula" title="" type="CATI"><section id="1" loopover="None" notes="" startrecording="true" title="1">
<page id="1_Q1" loopover="None" notes="" title="1_Q1"><question id="Q1" number="Q1" style="vertical" text="1" uid="94">
<single id="single_409" number_response_columns="1" response_list="Q1_L1"/>
<instructions>Please select one</instructions>
# head -n4 new_file.xml:
<?xml version="1.0" encoding="utf-8"?>
<survey audio_access_number="" custom="" name="test_conditionFormula" title="" type="CATI"><section id="1" loopover="None" notes="" startrecording="true" title="1">
<page id="1_Q1" loopover="None" notes="" title="1_Q1"><question id="Q1" number="Q1" style="vertical" text="1" uid="94">
<single id="single_409" number_response_columns="1" response_list="Q1_L1"/>
Why are these coming up as different, given the flag to diff?
Diff compares line-by-line. So a newline isn’t whitespace within a line
http://linux.die.net/man/1/diff