Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'That's what I did!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
That's what I did!
Authored by: LightYear on Feb 28, '08 01:39:43PM
That's essentially what I used to create XWordLookup the Dashboard Widget. My flags were -a (in case someone selected a binary file as their dictionary) and -i for case insensitivity. I could have used -w (match entire words), but just surround the search string with ^ and $ instead (match start and end of line).

It came about when on holiday with my family, my father had no Internet connection to help him out with a crossword. It occurred to me that a combination of grep and the UNIX dict file ought to help. About 1 minute of hacking produced a script very similar to the one in this tip. My father was so impressed (I wasn't, because it was just too simple compared to the complex shell scripting I had been doing!) that I made a Widget out of it. It has been quite popular. No one needs to know that's it is just one line at the command prompt ;-)

---
* Nothing is foolproof to a sufficiently talented fool *

[ Reply to This | # ]