#!/bin/csh -f
#
# makedoc - make a documentation listing for Process directory
#
# takes the top few comments from each csh script

onintr cleanup
set list=/tmp/makedoc$$

# make a list of shell scripts
grep "^#\!/bin/csh " * | sed -e '/~/d' -e 's/:.*//' > $list

# print the first set of lines that have comments
foreach i (`cat $list`)
   echo --------------------------
   sed -n '2,/^[ ]*$/p' $i
   echo ""
end

cleanup:
rm -f $list
