Created
December 9, 2014 13:44
-
-
Save SahilC/ae4d562279764152775f to your computer and use it in GitHub Desktop.
Use this script to find meanings of words from bash shell. For convenience, make this script executable and add alias to file with the command `alias define='path-to-define.sh-file'`
This file contains hidden or 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 | |
wget -q -O - "http://www.macmillandictionary.com/dictionary/british/$1" | grep -P -o "<span class=\"DEFINITION\">(.*?)</span>" | grep -Po '(?<=href=")[^"]*' | grep -Po '=.*?$' | cut -d = -f 2 | awk '{printf "%s ",$1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment