#! /bin/csh -f
#
# script to create an division index for the pir library in codata format
#

echo "pirdivision.script Version 1.0"
echo ""

set RM = "/bin/rm -f"

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


awk '{printf("%-12.12s %d\n",$1,$2);}' << EOF >! division.list
$LIBFILE1 1
$LIBFILE2 2
$LIBFILE3 3
EOF

division division.list division.lkp
if ( $status ) goto abort
${RM} division.list

echo "Completion successful"
echo ""

exit 0

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