home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 26.ddi / root.3 / usr / ucb / diffmk next >
Encoding:
Text File  |  1990-12-20  |  1.1 KB  |  65 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/ucb/diffmk.sl 1.1 4.0 12/08/90 32385 AT&T-USL"
  12.  
  13. #    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
  14. #      All Rights Reserved
  15.  
  16. #    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
  17. #    The copyright notice above does not evidence any
  18. #    actual or intended publication of such source code.
  19.  
  20.  
  21.  
  22. #     Portions Copyright(c) 1988, Sun Microsystems, Inc.
  23. #     All Rights Reserved
  24.  
  25. #     Makefile for echo
  26.  
  27.  
  28. PATH=/usr/bin
  29. if test -z "$3" -o "$3" = "$1" -o "$3" = "$2"; then
  30.     echo "usage: diffmk name1 name2 name3 -- name3 must be different"
  31.     exit 1
  32. fi
  33. diff -e $1 $2 | (sed -n -e '
  34. /[ac]$/{
  35.     p
  36.     a\
  37. .mc |
  38. : loop
  39.     n
  40.     /^\.$/b done1
  41.     p
  42.     b loop
  43. : done1
  44.     a\
  45. .mc\
  46. .
  47.     b
  48. }
  49.  
  50. /d$/{
  51.     s/d/c/p
  52.     a\
  53. .mc *\
  54. .mc\
  55. .
  56.     b
  57. }'; echo '1,$p') | ed - $1| sed -e '
  58. /^\.TS/,/.*\. *$/b pos
  59. /^\.T&/,/.*\. *$/b pos
  60. p
  61. d
  62. :pos
  63. /^\.mc/d
  64. ' > $3
  65.