#!/bin/csh -f

if ( -f ./X-ref ) then
  awk -F: '{printf ("%s:%s\n",$2,$1)}' ./X-ref > /tmp/X-ref
  cat ./X-ref >>! /tmp/X-ref && \
  sort /tmp/X-ref | uniq >! ./X-ref

  exit 0
else
  echo "X-ref missing"
  exit 1
endif
