home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / bin / doc_library next >
Encoding:
Text File  |  1997-07-08  |  874 b   |  53 lines

  1. #! /bin/sh
  2. #
  3. #    $Id: doc_library,v 1.1 1993/04/02 17:23:27 idl Exp $
  4. #
  5. #  Shell script to strip documentation from IDL User's Library procedures.
  6. #
  7. # Usage:
  8. # doclibrary filter multiple f1 f2 ... ... fn
  9. #
  10. # it searches all of the files f1 .... fn for documentation templates.
  11. # when found, it strips the documentation and sends it to filter.
  12. #
  13. # multiple = 0 to only print one file, 1 to print as many as are found.
  14. #
  15.  
  16. #set -x
  17. out=$1
  18. file=/tmp/idl_doc_lib_$$
  19. shift
  20. multi=$1
  21. shift
  22. rm -f $file
  23. while [ "$#" -ne 0 ]
  24. do
  25.     if [ -f "$1" ]
  26.     then
  27.         count=1
  28. #        echo "Documentation for " $1  > $file
  29.         sed "
  30.         1a\\
  31. ----- Documentation for $1 -----
  32.          /^;+/,/^;-/!d
  33.          s/^;+//
  34.          s/^;-/ /
  35.          s/^;//
  36.         " "$1" >> $file
  37.         if [ "$multi" = 0 ]
  38.         then
  39.           break
  40.         fi
  41.     fi
  42.     shift
  43. done
  44.  
  45. if [ X"$count" = X ] 
  46. then
  47.     echo 'Doc_library: Unable to find file.'
  48. else
  49.     eval "$out < $file"
  50.     rm $file
  51. fi
  52.  
  53.