1 2 3 4 5 6 7 8 9
#!/usr/bin/env bash url='http://web.archive.org/cdx/search/cdx' s='?' for arg in "$@"; do url+="$s${arg%%=*}=$(printf '%s' "${arg#*=}"|urlencode)" s='&' done curl -sfL "$url"