From: utzoo!decvax!ucbvax!ucbcad:tektronix!zehntel!sytek!menlo70!hao!seismo!uwvax!solomon Newsgroups: net.sources Title: fixhist.sh - fix the B news history file - see mkhistory.c Article-I.D.: crystal.174 Posted: Fri Mar 25 16:10:42 1983 Received: Sun Mar 27 07:17:08 1983 #!/bin/sh # Fix /usr/lib/news/history to truncate names in it to 14 characters, so # that it will be directly comparable to the output of mkhistory for # the sake of comparison. Also sort the list of file names on each line. awk ' BEGIN { FS = "\t" } { nfiles = split($3,fnames," ") printf "%s\t%s\t", $1, $2 for (i=1;i<=nfiles;i++) { slash = index(fnames[i],"/") if (slash <= 14) name[i] = fnames[i] else name[i] = substr(fnames[i],1,14) substr(fnames[i],slash) } if (nfiles==1) printf "%s ",name[1] # special case for efficiency else while (nfiles > 0) { pos = 1 for (i=2;i<=nfiles;i++) if (name[i]