summaryrefslogtreecommitdiffstats
path: root/mantools/find-double
blob: 371663e88e70cb4c2a7bf07f1af15ebdf61d8c9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

sed 's/[^A-Z0-9a-z_][^A-Z0-9a-z_]*/ /g' "$@" | awk '
	{ for (i = 1; i <= NF; i++) {
		if (length($i) > 1 && $(i) == last) {
			if (i == 1)
			    printf("%s ", last)
			print
		}
		last = $(i)
	   }
	}
'