From 2959e1ede0ebc6fdffd7b8660f43c2ce14c9696f Mon Sep 17 00:00:00 2001 From: Taru Karttunen Date: Wed, 30 Mar 2011 17:14:36 +0300 Subject: Import sources from 2011-03-30 iso image - rc --- rc/bin/thesaurus | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 rc/bin/thesaurus (limited to 'rc/bin/thesaurus') diff --git a/rc/bin/thesaurus b/rc/bin/thesaurus new file mode 100755 index 000000000..1f4707c5d --- /dev/null +++ b/rc/bin/thesaurus @@ -0,0 +1,29 @@ +#!/bin/rc + +hget 'http://thesaurus.reference.com/search?q='^$1 | + htmlfmt -l 1000 | + sed -n '/^Main Entry:/,/^Source/ { + /^Source/ q + /^[A-Z].*:/ { + N + s/\n/ /g + } + p + }' | awk -F', ' '{ + if(length($0)<=70){ + print + next + } + l = 0 + for(i = 1; i < NF; i++){ + printf "%s ", $i + l += length($i)+1 + if(l > 70){ + printf "\n\t\t" + l = 2*ENVIRON["tabstop"] + } + } + if(l>0) + printf "\n" + next + }' -- cgit v1.2.3