A simple word definition script25 Aug 2015
Have you ever come across a difficulty to find a definition of a word that you are looking for. Well I find it bit difficult for me.
I normally use Google search to find definitions of words. For example to get the definition of the word “replenish” I use definition replenish on search bar
But this approach is still bit clumsy though, since you need a browser and if you are already opened multiple tabs then it is sometimes get messy around to switch around tabs.
So I found out this simple script from the book Linux Shell Scripting Cookbook, 2nd Edition that will query your word and get the definition of it.
Let’s see how to get it to work (I have altered the original script from the book to make is more convenient)
- First you need an account in dictionaryapi.com - http://www.dictionaryapi.com/register/index.htm
- API key for the learners API would be enough for the time being
- Get the script from here
- Assign your API key to the variable apikey
- Make it executable
chmod +x define
- Optional: if you want to make it available system wide add the script to
- Finally you can run it as
The outcome would be:-