Print this page
XXX Remove nawk(1)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/scripts/protocmp.terse.sh
+++ new/usr/src/tools/scripts/protocmp.terse.sh
1 1 #!/bin/ksh
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License, Version 1.0 only
7 7 # (the "License"). You may not use this file except in compliance
8 8 # with the License.
9 9 #
10 10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 11 # or http://www.opensolaris.org/os/licensing.
12 12 # See the License for the specific language governing permissions
13 13 # and limitations under the License.
14 14 #
15 15 # When distributing Covered Code, include this CDDL HEADER in each
16 16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 # If applicable, add the following below this CDDL HEADER, with the
18 18 # fields enclosed by brackets "[]" replaced with your own identifying
19 19 # information: Portions Copyright [yyyy] [name of copyright owner]
20 20 #
21 21 # CDDL HEADER END
22 22 #
23 23 #
24 24 # Copyright 1993-2003 Sun Microsystems, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 -#ident "%Z%%M% %I% %E% SMI"
28 27
29 28 opts=""
30 29 while getopts guplmsLv arg
31 30 do
32 31 if [ "$arg" = "?" ]; then
33 32 exit 1
34 33 fi
35 34 opts="$opts -$arg"
36 35 done
37 36
38 37 shift $(($OPTIND - 1))
39 38
40 39 if [ $# -le 3 ]; then
41 40 echo "$0: at least 3 arguments required." >&2
↓ open down ↓ |
4 lines elided |
↑ open up ↑ |
42 41 exit 1
43 42 fi
44 43
45 44 old="$1"; shift
46 45 new="$1"; shift
47 46 differ="$1"; shift
48 47
49 48 errlog=/tmp/protocmp.err.$$
50 49
51 50 protocmp $opts "$@" 2>$errlog |
52 - nawk -v old="$old" -v new="$new" -v differ="$differ" '
51 + /usr/xpg4/bin/awk -v old="$old" -v new="$new" -v differ="$differ" '
53 52 /^\**$/ {
54 53 next;
55 54 }
56 55 /^\* Entries/ {
57 56 category++;
58 57 next;
59 58 }
60 59 /^\* filea ==/ {
61 60 filea = $NF;
62 61 next;
63 62 }
64 63 /^\* fileb ==/ {
65 64 fileb = $NF;
66 65 next;
67 66 }
68 67 {
69 68 buf[category, ++line[category]] = $0
70 69 }
71 70 END {
72 71 if (line[1] > 2) {
73 72 printf("\n%s\n\n", old);
74 73 for (i = 1; i <= line[1]; i++) {
75 74 print buf[1, i];
76 75 }
77 76 }
78 77 if (line[2] > 2) {
79 78 printf("\n%s\n\n", new);
80 79 for (i = 1; i <= line[2]; i++) {
81 80 print buf[2, i];
82 81 }
83 82 }
84 83 if (line[3] > 2) {
85 84 printf("\n%s\n\n", differ);
86 85 for (i = 1; i <= line[3]; i++) {
87 86 print buf[3, i];
88 87 }
89 88 }
90 89 }'
91 90
92 91 if [ -s $errlog ]; then
93 92 echo "\n====== protocmp ERRORS =====\n"
94 93 cat $errlog
95 94 fi
96 95 rm -f $errlog
↓ open down ↓ |
34 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX