#! /bin/sh # WTF - What the Fuck? script (the WTF of the Day) # Copyright (C) 2010 Matous J. Fialka, # Released under the terms of The MIT License # Prerequisities: the CONTEXT script for contextual searching found # at http://vger.cz/hacks/shell/sh/context address. # # You also need POSIX compliant shell and the SED(1) stream editor. # # Download for instance the FOLDOC dictionary file and store it under # in your home directory as .wtf.foldoc file. # # :wget -qO ~/.wtf.foldoc http://foldoc.org/Dictionary # # The script searches for ~/.wtf.* to get it's data. You may or may # not like it. If you do not like it, just change it the way you like! # # Now use the WTF script for contextual searching the dictionary data. # # :wtf ^Berkeley | more # :wtf ^Berkeley | wtf UNIX | more # # Enjoy! if [ -t 0 ] then cat ~/.wtf.* | context ${*:-'.*'} else context ${*:-'.*'} fi