File:  [Research Unix] / researchv10no / ipc / mgrs / ns / mkdb / mkindex.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

echo Making index 1>&2
cat $* | awk '
#
#	make index of the form:
#		value,K|D|I|N|T
#
BEGIN { nc = 0; }
{
	for(i = 1; i <= NF; i++) {
		if(match($i,",")) {
			n = RSTART +1;
			if(match($i,"^DK"))
				type = "K";
			else if(match($i,"^SERVICE"))
				continue;
			else 
				type = substr($i, 1, 1);
			printf("%s,%s %d\n",substr($i,n),type,nc);
		} else {
			
			printf("%s %d\n", $i,nc);
		}
	}
	nc = nc + length($0) + 1;
}

' | sort -u

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.