Skip to content

Instantly share code, notes, and snippets.

@robcolburn
Created June 4, 2013 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robcolburn/5708471 to your computer and use it in GitHub Desktop.
Save robcolburn/5708471 to your computer and use it in GitHub Desktop.
Bash function to compare two urls
#urldiff http://www.google.com http://www.yahoo.com
function urldiff () {
local file
local files=""
for url in "$@"
do
file="urldiff-"${url//[^a-zA-Z0-9]/}
files=$files" "$file
echo "downloading $url > $file"
lwp-request -m 'GET' $url > $file
done
echo "diff $files"
diff $files
echo "rm $files"
rm $files
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment