Created
June 4, 2013 18:54
-
-
Save robcolburn/5708471 to your computer and use it in GitHub Desktop.
Bash function to compare two urls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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