Created
August 6, 2013 21:57
-
-
Save thetristan/6169113 to your computer and use it in GitHub Desktop.
Compare two URLs (headers and response body) with curl: $ diff_url http://foobar.com http://bazqux.com
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
#!/bin/bash | |
# Diff the headers and response body of two different urls with curl | |
NAME=`basename $0` | |
COMMAND="diff <(curl -is '$1') <(curl -is '$2')" | |
if [ $# -ne 2 ] | |
then | |
echo "Usage: $NAME <http://foobar.com> <http://bazqux.com>" 1>&2 | |
exit 1 | |
fi | |
echo "Comparing '$1' to '$2'..." | |
echo $COMMAND | |
bash -c "$COMMAND" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment