#!/bin/sh # # usage: mxref infile1 infile2 ... >outfile # # create index lines for all tokens in the given files nawk '{ sub("$"," ") gsub("[^a-zA-Z0-9_]+"," ") sub("^ ","") gsub(" "," " FILENAME " " sprintf("%3d",FNR) "\n") printf "%s",$0 }' ${1+"$@"} | egrep '.....* .* ' | sort -T .