Print this page
8858 /usr/bin/grep doesn't support -E option
4580 /usr/bin/grep can't handle multibyte characters
8929 8868 tests are not delivered with system/test/utiltest
8860 Example in grep(1) is incorrect
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuripv@gmx.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/diff3/diff3.sh
          +++ new/usr/src/cmd/diff3/diff3.sh
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20  #
  21   21  # CDDL HEADER END
  22   22  #
  23   23  #       Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  24   24  #         All Rights Reserved
  25   25  
  26   26  
  27   27  #       Copyright (c) 1999, 2001 by Sun Microsystems, Inc.
  28   28  #       All rights reserved.
  29   29  
  30      -#ident  "%Z%%M% %I%     %E% SMI"        /* SVr4.0 1.4   */
  31      -
  32   30  usage="usage: diff3 file1 file2 file3"
  33   31  
  34   32  # mktmpdir - Create a private (mode 0700) temporary directory inside of /tmp
  35   33  # for this process's temporary files.  We set up a trap to remove the 
  36   34  # directory on exit (trap 0), and also on SIGHUP, SIGINT, SIGQUIT, SIGPIPE,
  37   35  # and SIGTERM.
  38   36  
  39   37  mktmpdir() {
  40   38          tmpdir=/tmp/diff3.$$
  41   39          trap '/usr/bin/rm -rf $tmpdir' 0 1 2 3 13 15
↓ open down ↓ 31 lines elided ↑ open up ↑
  73   71  if [ -c $f3 ]
  74   72  then
  75   73          /usr/bin/cat $f3 > $tmpdir/d3e$$
  76   74          f3=$tmpdir/d3e$$
  77   75  fi
  78   76  
  79   77  /usr/bin/diff $f1 $f3 > $tmpdir/d3a$$ 2> $tmpdir/d3a$$.err
  80   78  STATUS=$?
  81   79  if [ $STATUS -eq 1 ]
  82   80  then
  83      -        /usr/xpg4/bin/grep -q "^[<>]" $tmpdir/d3a$$
       81 +        /usr/bin/grep -q "^[<>]" $tmpdir/d3a$$
  84   82          RET=$?
  85   83          if [ $RET -eq 1 ]
  86   84          then
  87   85                  /usr/bin/cat $tmpdir/d3a$$
  88   86                  exit $STATUS
  89   87          fi
  90   88  
  91   89          if [ $RET -gt 1 ]
  92   90          then
  93   91                  echo "diff3 failed" 1>&2
↓ open down ↓ 4 lines elided ↑ open up ↑
  98   96  if [ $STATUS -gt 1 ]
  99   97  then
 100   98          /usr/bin/cat $tmpdir/d3a$$.err
 101   99          exit $STATUS
 102  100  fi
 103  101  
 104  102  /usr/bin/diff $f2 $f3 > $tmpdir/d3b$$ 2> $tmpdir/d3b$$.err
 105  103  STATUS=$?
 106  104  if [ $STATUS -eq 1 ]
 107  105  then
 108      -        /usr/xpg4/bin/grep -q "^[<>]" $tmpdir/d3b$$
      106 +        /usr/bin/grep -q "^[<>]" $tmpdir/d3b$$
 109  107          RET=$?
 110  108          if [ $RET -eq 1 ]
 111  109          then
 112  110                  /usr/bin/cat $tmpdir/d3b$$
 113  111                  exit $STATUS
 114  112          fi
 115  113  
 116  114          if [ $RET -gt 1 ]
 117  115          then
 118  116                  echo "diff3 failed" 1>&2
↓ open down ↓ 11 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX