EvilZone

Programming and Scripting => Scripting Languages => : 0poitr February 02, 2013, 08:59:27 PM

: [Bash] Google Define in bash
: 0poitr February 02, 2013, 08:59:27 PM
Get word definitions from Google define: searches right in your shell :P
Very simple script. You can also just keep it as a function in your .bashrc
:
#!/bin/bash
## define by 0poitr @ evilzone.org

[[ -z $1 ]] && echo "Define what?" && exit 1
[ ! `which links 2>/dev/null` ] && echo "Can has links?" && exit 1

uagent='Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0'

links -dump https://www.google.com/search?q=define+${1} -http.fake-user-agent "$uagent" |\
sed -n '/Search Results/,/More info/ p'|sed -e '1,4 d' -e 's/^[ ]*//g' -e '$ d'
Screenshot:
(http://i.imgur.com/GsEDLgl.png)
: Re: [Bash] Google Define in bash
: vezzy February 02, 2013, 10:43:59 PM
Nice concept. Good job +1