home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / cmds / root.3 / usr / bin / diff3 / diff3~
Text File  |  1998-08-19  |  1KB  |  49 lines

  1. #!/sbin/sh
  2.  
  3. # Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  4. #                                                                         
  5. #        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  6. #                   SANTA CRUZ OPERATION INC.                             
  7. #                                                                         
  8. #   The copyright notice above does not evidence any actual or intended   
  9. #   publication of such source code.                                      
  10.  
  11. #    copyright    "%c%"
  12.  
  13. #ident    "@(#)diff3:diff3.sh    1.4.3.3"
  14.  
  15. e=
  16. case "$1" in
  17. -*)
  18.     e="$1"
  19.     shift;;
  20. esac
  21. if test $# = 3 -a \( -f "$1" -o -c "$1" \) -a \( -f "$2" -o -c "$2" \) -a \( -f "$3" -o -c "$3" \)
  22. then
  23.     :
  24. else
  25.     pfmt -l UX:diff3 -s action -g uxdfm:75 "Usage: diff3 file1 file2 file3\n"
  26.     exit
  27. fi
  28. f1="$1" f2="$2" f3="$3"
  29. if [ -c $f1 ]
  30. then
  31.     /usr/bin/cat $f1 >/tmp/d3c$$
  32.     f1=/tmp/d3c$$
  33. fi
  34. if [ -c $f2 ]
  35. then
  36.     /usr/bin/cat $f2 >/tmp/d3d$$
  37.     f2=/tmp/d3d$$
  38. fi
  39. if [ -c $f3 ]
  40. then
  41.     /usr/bin/cat $f3 >/tmp/d3e$$
  42.     f3=/tmp/d3e$$
  43. fi
  44.  
  45. trap "/usr/bin/rm -f /tmp/d3[a-e]$$" 0 1 2 13 15
  46. /usr/bin/diff $f1 $f3 >/tmp/d3a$$
  47. /usr/bin/diff $f2 $f3 >/tmp/d3b$$
  48. /usr/lib/diff3prog $e /tmp/d3[ab]$$ $f1 $f2 $f3
  49.