#!/usr/local/bin/awk -f BEGIN { size = 10 n = 0 } { line[n] = $0 n = (n+1)% size } END{ if(NR<=size) for(i=0; i