#! /bin/csh -f
#
# script to make a brief index for the pir library in codata format
#

echo "pirtitle.script Version 1.0"
echo ""

set RM = "/bin/rm -f"
set SORT = sort

#
# LIBFILE is the name youve given to the library file
#
set LIBFILE1 = pir1.dat
set LIBFILE2 = pir2.dat
set LIBFILE3 = pir3.dat

pirtitle1 $LIBFILE1 pir1.list
if ( $status ) goto abort
pirtitle1 $LIBFILE2 pir2.list
if ( $status ) goto abort
pirtitle2 $LIBFILE3 pir3.list
if ( $status ) goto abort

${SORT} pir1.list pir2.list pir3.list >! title.sorted
if ( $status ) goto abort
${RM} pir1.list pir2.list pir3.list

title2 title.sorted brief.idx
if ( $status ) goto abort
${RM} title.sorted

echo "Completion successful"
echo ""

exit 0

#
# Abort
#
abort:
echo "pirtitle.script: aborting due to serious error"
exit 2
