Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
hget 'http://thesaurus.reference.com/search?q='^$1 |
4
	htmlfmt -l 1000 |
5
	sed -n '/^Main Entry:/,/^Source/ {
6
		/^Source/ q
7
		/^[A-Z].*:/ {
8
			N
9
			s/\n/	/g
10
		}
11
		p
12
	}' | awk -F', ' '{
13
		if(length($0)<=70){
14
			print
15
			next
16
		}
17
		l = 0
18
		for(i = 1; i < NF; i++){
19
			printf "%s ", $i
20
			l += length($i)+1
21
			if(l > 70){
22
				printf "\n\t\t"
23
				l = 2*ENVIRON["tabstop"]
24
			}
25
		}
26
		if(l>0)
27
			printf "\n"
28
		next
29
	}'