home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume27 / clc / part01 / fixman next >
Encoding:
Text File  |  1993-11-28  |  768 b   |  33 lines

  1. #!/bin/sh
  2.  
  3. script_name=`basename $0`
  4.  
  5. usage="Usage: $script_name manpage manpage ..."
  6.  
  7. if test $# -eq 0 ; then echo $usage ; exit 1 ; fi
  8.  
  9. catch_sigs="2 15"
  10.  
  11. #
  12. # We can't take any interrupts while processing the manpages
  13. #
  14. trap 'interrupt_occured=yes' $catch_sigs
  15.  
  16. temp_file=/tmp/tmp.$$
  17.  
  18. for i in $*
  19. do
  20.     rm -f $temp_file
  21.     sed 's/[.]SB/.B/' $i > $temp_file         # do the replacement
  22.     cmp -s $i $temp_file                      # and compare
  23.     if test $? -ne 0 ; then                   # if not equal, then
  24.         mv $i $i.orig && mv $temp_file $i      # save original, and move
  25.     fi                                        # the other one in its place
  26.     rm -f $temp_file
  27.     if test "$interrupt_occured" = "yes" ; then
  28.         echo "$script_name: Interrupt: quiting"
  29.         exit 1
  30.     fi
  31. done
  32.  
  33.