$ function google { Q="$@"; GOOG_URL='https://www.google.de/search?tbs=li:1&q='; AGENT="Mozilla/4.0"; stream=$(curl -A "$AGENT" -skLm 10 "${GOOG_URL}${Q//\ /+}" | grep -oP '\/url\?q=.+?&' | sed 's|/url?q=||; s|&||'); echo -e "${stream//\%/\x}"; }
Put it in your ~/.bashrc
usage:
google word1 word2 word3...
google '"this search gets quoted"'
by David Winterbottom (codeinthehole.com)
0sem comentários ainda