Here is an essential utility from the *nix world for those of you ‘shooting your foot clean-off‘ developing data-driven, dynamically-generated web content for your church or charity.
As the above definition from the ‘man‘ page describes, diff is a utility that compares to text files. Below is a sample session that shows how diff might be used in combination with wget in a real-World situation:
wget “http://www.csszengarden.com/?cssfile=/002/002.css&page=0” -O test002.html
diff test001.html test002.html > whatsthediff.txt
Here’s a snippet of the output I piped into ‘whatsthediff.txt:’
< @import “/001/001.css”;
> @import “/002/002.css”;
There are a variety of options which can be used to customize the output so the results aren’t as cryptic, but generally the plain vanilla output works fine for me. ‘diff’ is also yet another compelling reason to install the UnxUtils on any Windows-based system on which you develop software.
For those of you who prefer a more ‘GUI-fried‘ interface, Keith Devens has compiled a rather short but sweet list of ‘Differencing Programs‘ including a nice little freebie by the name of “ComponentSoftware Diff for Windows” or “CDiff” for short. Another solution is Microsoft SDK Windiff utility.
Whatever your preference, a differencing program can be a big help when comparing the output from dynamically-generated web pages … or when you need to compare last night’s programming effort against last week’s.