home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume16 / narc / roffit.csh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1989-01-17  |  871b  |  41 lines

  1. #!    /bin/csh     -f
  2. # Find something that might be a man page and 'roff it.
  3.  
  4. # Geoffrey Leach
  5. # LatiCorp Inc.    
  6. # {att,bellcore,sun,ames,pyramid}!pacbell!laticorp!geoff
  7.  
  8. set DIR = `pwd`
  9. set DIR = $DIR:t
  10.  
  11. if ( $#argv == 0 ) then
  12.     set DOC = `find . \( -name "*.l" -o -name "*.man" -o -name "*.nro" -o -name "*.[1-8]" \) -print`
  13. else
  14.     set DOC = ( $* )
  15. endif
  16. foreach f ( $DOC )
  17.     if ( $f:h != "./ARCF" ) then
  18.     set D = $ARCHIVE/manl/$f:t 
  19.     if ( $f:t == README ) set $f = ${DIR}.$f
  20. repeat:
  21.     if ( -e $D ) then
  22.         echo -n "Man page $f exists.  Ignore(i), overwrite(o) or new name(n) [i]? "
  23.         set ans = $<
  24.         switch ( $ans )
  25.         case "i":
  26.         default:
  27.             continue
  28.         case "o":
  29.             breaksw
  30.         case "n":
  31.             echo -n "Enter new name: "
  32.             set ans = <$
  33.             set D = $ARCHIVE/manl/$ans
  34.             goto repeat
  35.             breaksw
  36.         endsw
  37.     endif
  38.     nroff -man $f > $D
  39.     endif
  40. end
  41.