home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 26.ddi / root.3 / usr / ucblib / makewhatis < prev    next >
Encoding:
Text File  |  1990-12-20  |  1.7 KB  |  60 lines

  1. #!/sbin/sh
  2. #    Copyright (c) 1990 UNIX System Laboratories, Inc.
  3. #    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
  4. #      All Rights Reserved
  5.  
  6. #    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF
  7. #    UNIX System Laboratories, Inc.
  8. #    The copyright notice above does not evidence any
  9. #    actual or intended publication of such source code.
  10.  
  11. #ident    "@(#)//usr/ucblib/makewhatis.sl 1.1 4.0 12/08/90 6210 AT&T-USL"
  12. #        PROPRIETARY NOTICE (Combined)
  13. #
  14. #This source code is unpublished proprietary information
  15. #constituting, or derived under license from AT&T's UNIX(r) System V.
  16. #In addition, portions of such source code were derived from Berkeley
  17. #4.3 BSD under license from the Regents of the University of
  18. #California.
  19. #
  20. #
  21. #
  22. #        Copyright Notice 
  23. #
  24. #Notice of copyright on this source code product does not indicate 
  25. #publication.
  26. #
  27. #    (c) 1986,1987,1988.1989  Sun Microsystems, Inc
  28. #    (c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
  29. #              All rights reserved.
  30.  
  31. trap "rm -f /tmp/whatisx.$$ /tmp/whatis$$; exit 1" 1 2 13 15
  32. MANDIR=${1-/usr/share/man}
  33. rm -f /tmp/whatisx.$$ /tmp/whatis$$
  34. if test ! -d $MANDIR ; then exit 0 ; fi
  35. cd $MANDIR
  36. top=`pwd`
  37. for i in man1 man2 man3 man4 man5 man6 man7 man8 mann manl
  38. do
  39.     if [ -d $i ] ; then
  40.         cd $i
  41.          if test "`echo *.*`" != "*.*" ; then
  42.             /usr/ucblib/getNAME *.*
  43.         fi
  44.         cd $top
  45.     fi
  46. done >/tmp/whatisx.$$
  47. sed  </tmp/whatisx.$$ >/tmp/whatis$$ \
  48.     -e 's/\\-/-/' \
  49.     -e 's/\\\*-/-/' \
  50.     -e 's/ VAX-11//' \
  51.     -e 's/\\f[PRIB0123]//g' \
  52.     -e 's/\\s[-+0-9]*//g' \
  53.     -e 's/.TH [^ ]* \([^     ]*\).*    \([^-]*\)/\2(\1)    /' \
  54.     -e 's/     /    /g'
  55. /usr/ucb/expand -24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100 \
  56.     /tmp/whatis$$ | sort | /usr/ucb/unexpand -a > whatis
  57. chmod 644 whatis >/dev/null 2>&1
  58. rm -f /tmp/whatisx.$$ /tmp/whatis$$
  59. exit 0
  60.