#!/usr/bin/awk -f # HP20090909 # cat xxx | sort | printdup dup=3 BEGIN { old = ""; dup = 1; cnt = 0; } { if ($0 != old) { cnt = 1; } else { cnt++; } if (cnt == dup) { print $0; } old = $0; }