--- old/usr/src/Makefile.lint	2013-05-27 09:44:59.969360734 +0000
+++ new/usr/src/Makefile.lint	2013-05-27 09:44:59.982907576 +0000
@@ -44,7 +44,6 @@
 	cmd/autopush \
 	cmd/availdevs \
 	cmd/avs \
-	cmd/awk \
 	cmd/banner \
 	cmd/bart \
 	cmd/basename \
--- old/usr/src/Makefile.master	2013-05-27 09:45:00.395735723 +0000
+++ new/usr/src/Makefile.master	2013-05-27 09:45:00.406063148 +0000
@@ -164,7 +164,7 @@
 ELFWRAP=	/usr/bin/elfwrap
 KSH93=		/usr/bin/ksh93
 SED=		/usr/bin/sed
-NAWK=		/usr/bin/nawk
+AWK=		/usr/xpg4/bin/awk
 CP=		/usr/bin/cp -f
 MCS=		/usr/ccs/bin/mcs
 CAT=            /usr/bin/cat
--- old/usr/src/Makefile.msg.targ	2013-05-27 09:45:00.856494414 +0000
+++ new/usr/src/Makefile.msg.targ	2013-05-27 09:45:00.865241234 +0000
@@ -53,7 +53,7 @@
 
 BUILDPO.pofiles = \
 	$(RM) $(POFILE); \
-	$(NAWK) '\
+	$(AWK) '\
 	    FNR == 1		{ print "\# Messages from " FILENAME; } \
 	    /^domain/		{ next; } \
 	    /^msgid/, /^msgstr/	{ msg = msg "\n" $$0; \
--- old/usr/src/cmd/Makefile	2013-05-27 09:45:01.242072118 +0000
+++ new/usr/src/cmd/Makefile	2013-05-27 09:45:01.251866736 +0000
@@ -65,7 +65,6 @@
 	auths		\
 	autopush	\
 	avs		\
-	awk		\
 	awk_xpg4	\
 	backup		\
 	banner		\
@@ -530,7 +529,6 @@
 	auths		\
 	autopush	\
 	avs		\
-	awk		\
 	awk_xpg4	\
 	backup		\
 	banner		\
--- old/usr/src/cmd/acct/lastlogin.sh	2013-05-27 09:45:01.662379163 +0000
+++ new/usr/src/cmd/acct/lastlogin.sh	2013-05-27 09:45:01.675058109 +0000
@@ -24,7 +24,6 @@
 #	  All Rights Reserved
 
 
-#ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.6	*/
 #	"lastlogin - keep record of date each person last logged in"
 #	"bug - the date shown is usually 1 more than it should be "
 #	"       because lastlogin is run at 4am and checks the last"
@@ -57,7 +56,7 @@
 #	"1st occurrence of each login name and resorts by date"
 acctmerg -a < nite/ctacct.$_day | \
 sed -e "s/^[^ 	]*[ 	]\([^ 	]*\)[ 	].*/$_d  \1/" | \
-nawk	'/^00-00-00/ {
+/usr/xpg4/bin/awk	'/^00-00-00/ {
                 $0 = "00" $0
         }
 	/^[0-9][0-9]-/ {
@@ -70,7 +69,7 @@
         }
         { print }' - sum/loginlog | \
 sort -r +1 | uniq +10 | sort | \
-nawk	'/^[0-9][0-9][0-9][0-9]-/ {
+/usr/xpg4/bin/awk	'/^[0-9][0-9][0-9][0-9]-/ {
 	$0 = substr($0,3)
     }
     { print }' > sum/tmploginlog
--- old/usr/src/cmd/allocate/disk_clean.sh	2013-05-27 09:45:02.040127620 +0000
+++ new/usr/src/cmd/allocate/disk_clean.sh	2013-05-27 09:45:02.049681168 +0000
@@ -223,7 +223,7 @@
 #
 
 findmounts() {
-	nawk -f - -v vold_root="$VOLD_ROOT" -v devs="$*" /etc/mnttab <<\
+	/usr/xpg4/bin/awk -f - -v vold_root="$VOLD_ROOT" -v devs="$*" /etc/mnttab <<\
 	    "ENDOFAWKPGM"
 	BEGIN {
 		split(devs, devlist, " ");
--- old/usr/src/cmd/awk/Makefile	2013-05-27 09:45:02.496097546 +0000
+++ /dev/null	2013-05-27 09:45:02.000000000 +0000
@@ -1,99 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#
-# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-# NOTE: awk is oawk.
-
-PROG= nawk
-
-OBJ1= b.o lib.o main.o parse.o proctab.o run.o tran.o
-OBJ2= awk.g.o awk.lx.o
-OBJS= $(OBJ2) $(OBJ1)
-SRCS= $(OBJ1:%.o=%.c)
-
-include ../Makefile.cmd
-
-CERRWARN += -_gcc=-Wno-implicit-function-declaration
-CERRWARN += -_gcc=-Wno-unused-label
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-unused-variable
-CERRWARN += -_gcc=-Wno-uninitialized
-
-#
-# Message catalog
-#
-POFILES= $(OBJS:%.o=%.po)
-POFILE= awk.po
-XGETFLAGS += -a -x awk.xcl
-#
-
-CPPFLAGS += -D_FILE_OFFSET_BITS=64
-YFLAGS += -d
-LDLIBS += -lm
-LINTFLAGS += -u
-CLEANFILES= maketab proctab.c awk.g.c awk.lx.c y.tab.h
-
-.KEEP_STATE:
-
-all: $(PROG) 
-
-$(PROG): $(OBJS)
-	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
-	$(POST_PROCESS)
-
-#
-# message catalog
-#
-
-$(POFILE):  y.tab.h $(POFILES)
-	$(RM) $@
-	cat $(POFILES) > $@
-#
-
-proctab.c: maketab
-	rm -f $@; ./maketab > $@
-
-maketab: maketab.c
-	$(NATIVECC) -O maketab.c -o $@ $(LDLIBS)
-
-install: all $(ROOTPROG) $(ROOTLINK)
-
-clean:
-	$(RM) $(OBJS) $(CLEANFILES)
-
-lint: awk.g.c lint_SRCS
-
-awk.g.c + y.tab.h: awk.g.y
-
-awk.g.o: awk.g.c
-
-awk.lx.c: awk.lx.l
-
-proctab.o: proctab.c
-	$(COMPILE.c) proctab.c
-	$(POST_PROCESS_O)
-
-include ../Makefile.targ
--- old/usr/src/cmd/awk/awk.g.y	2013-05-27 09:45:02.620214096 +0000
+++ /dev/null	2013-05-27 09:45:02.000000000 +0000
@@ -1,470 +0,0 @@
-%{
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-%}
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-%{
-#ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 2.10	*/
-%}
-
-%{
-#include "awk.h"
-int yywrap(void) { return(1); }
-#ifndef	DEBUG
-#	define	PUTS(x)
-#endif
-Node	*beginloc = 0, *endloc = 0;
-int	infunc	= 0;	/* = 1 if in arglist or body of func */
-uchar	*curfname = 0;
-Node	*arglist = 0;	/* list of args for current function */
-static void	setfname(Cell *);
-static int	constnode(Node *);
-static uchar	*strnode(Node *);
-static Node	*notnull();
-%}
-
-%union {
-	Node	*p;
-	Cell	*cp;
-	int	i;
-	uchar	*s;
-}
-
-%token	<i>	FIRSTTOKEN	/* must be first */
-%token	<p>	PROGRAM PASTAT PASTAT2 XBEGIN XEND
-%token	<i>	NL ',' '{' '(' '|' ';' '/' ')' '}' '[' ']'
-%token	<i>	ARRAY
-%token	<i>	MATCH NOTMATCH MATCHOP
-%token	<i>	FINAL DOT ALL CCL NCCL CHAR OR STAR QUEST PLUS
-%token	<i>	AND BOR APPEND EQ GE GT LE LT NE IN
-%token	<i>	ARG BLTIN BREAK CLOSE CONTINUE DELETE DO EXIT FOR FUNC 
-%token	<i>	SUB GSUB IF INDEX LSUBSTR MATCHFCN NEXT
-%token	<i>	ADD MINUS MULT DIVIDE MOD
-%token	<i>	ASSIGN ASGNOP ADDEQ SUBEQ MULTEQ DIVEQ MODEQ POWEQ
-%token	<i>	PRINT PRINTF SPRINTF
-%token	<p>	ELSE INTEST CONDEXPR
-%token	<i>	POSTINCR PREINCR POSTDECR PREDECR
-%token	<cp>	VAR IVAR VARNF CALL NUMBER STRING FIELD
-%token	<s>	REGEXPR
-
-%type	<p>	pas pattern ppattern plist pplist patlist prarg term
-%type	<p>	pa_pat pa_stat pa_stats
-%type	<s>	reg_expr
-%type	<p>	simple_stmt opt_simple_stmt stmt stmtlist
-%type	<p>	var varname funcname varlist
-%type	<p>	for if while
-%type	<i>	pst opt_pst lbrace rparen comma nl opt_nl and bor
-%type	<i>	subop print
-
-%right	ASGNOP
-%right	'?'
-%right	':'
-%left	BOR
-%left	AND
-%left	GETLINE
-%nonassoc APPEND EQ GE GT LE LT NE MATCHOP IN '|'
-%left	ARG BLTIN BREAK CALL CLOSE CONTINUE DELETE DO EXIT FOR FIELD FUNC 
-%left	GSUB IF INDEX LSUBSTR MATCHFCN NEXT NUMBER
-%left	PRINT PRINTF RETURN SPLIT SPRINTF STRING SUB SUBSTR
-%left	REGEXPR VAR VARNF IVAR WHILE '('
-%left	CAT
-%left	'+' '-'
-%left	'*' '/' '%'
-%left	NOT UMINUS
-%right	POWER
-%right	DECR INCR
-%left	INDIRECT
-%token	LASTTOKEN	/* must be last */
-
-%%
-
-program:
-	  pas	{ if (errorflag==0)
-			winner = (Node *)stat3(PROGRAM, beginloc, $1, endloc); }
-	| error	{ yyclearin; bracecheck(); ERROR "bailing out" SYNTAX; }
-	;
-
-and:
-	  AND | and NL
-	;
-
-bor:
-	  BOR | bor NL
-	;
-
-comma:
-	  ',' | comma NL
-	;
-
-do:
-	  DO | do NL
-	;
-
-else:
-	  ELSE | else NL
-	;
-
-for:
-	  FOR '(' opt_simple_stmt ';' pattern ';' opt_simple_stmt rparen stmt
-		{ $$ = stat4(FOR, $3, notnull($5), $7, $9); }
-	| FOR '(' opt_simple_stmt ';'  ';' opt_simple_stmt rparen stmt
-		{ $$ = stat4(FOR, $3, NIL, $6, $8); }
-	| FOR '(' varname IN varname rparen stmt
-		{ $$ = stat3(IN, $3, makearr($5), $7); }
-	;
-
-funcname:
-	  VAR	{ setfname($1); }
-	| CALL	{ setfname($1); }
-	;
-
-if:
-	  IF '(' pattern rparen		{ $$ = notnull($3); }
-	;
-
-lbrace:
-	  '{' | lbrace NL
-	;
-
-nl:
-	  NL | nl NL
-	;
-
-opt_nl:
-	  /* empty */	{ $$ = 0; }
-	| nl
-	;
-
-opt_pst:
-	  /* empty */	{ $$ = 0; }
-	| pst
-	;
-
-
-opt_simple_stmt:
-	  /* empty */			{ $$ = 0; }
-	| simple_stmt
-	;
-
-pas:
-	  opt_pst			{ $$ = 0; }
-	| opt_pst pa_stats opt_pst	{ $$ = $2; }
-	;
-
-pa_pat:
-	  pattern	{ $$ = notnull($1); }
-	;
-
-pa_stat:
-	  pa_pat			{ $$ = stat2(PASTAT, $1, stat2(PRINT, rectonode(), NIL)); }
-	| pa_pat lbrace stmtlist '}'	{ $$ = stat2(PASTAT, $1, $3); }
-	| pa_pat ',' pa_pat		{ $$ = pa2stat($1, $3, stat2(PRINT, rectonode(), NIL)); }
-	| pa_pat ',' pa_pat lbrace stmtlist '}'	{ $$ = pa2stat($1, $3, $5); }
-	| lbrace stmtlist '}'		{ $$ = stat2(PASTAT, NIL, $2); }
-	| XBEGIN lbrace stmtlist '}'
-		{ beginloc = linkum(beginloc, $3); $$ = 0; }
-	| XEND lbrace stmtlist '}'
-		{ endloc = linkum(endloc, $3); $$ = 0; }
-	| FUNC funcname '(' varlist rparen {infunc++;} lbrace stmtlist '}'
-		{ infunc--; curfname=0; defn((Cell *)$2, $4, $8); $$ = 0; }
-	;
-
-pa_stats:
-	  pa_stat
-	| pa_stats opt_pst pa_stat	{ $$ = linkum($1, $3); }
-	;
-
-patlist:
-	  pattern
-	| patlist comma pattern	{ $$ = linkum($1, $3); }
-	;
-
-ppattern:
-	  var ASGNOP ppattern		{ $$ = op2($2, $1, $3); }
-	| ppattern '?' ppattern ':' ppattern %prec '?'
-	 	{ $$ = op3(CONDEXPR, notnull($1), $3, $5); }
-	| ppattern bor ppattern %prec BOR
-		{ $$ = op2(BOR, notnull($1), notnull($3)); }
-	| ppattern and ppattern %prec AND
-		{ $$ = op2(AND, notnull($1), notnull($3)); }
-	| NOT ppattern
-		{ $$ = op1(NOT, notnull($2)); }
-	| ppattern MATCHOP reg_expr	{ $$ = op3($2, NIL, $1, (Node*)makedfa($3, 0)); }
-	| ppattern MATCHOP ppattern
-		{ if (constnode($3))
-			$$ = op3($2, NIL, $1, (Node*)makedfa(strnode($3), 0));
-		  else
-			$$ = op3($2, (Node *)1, $1, $3); }
-	| ppattern IN varname		{ $$ = op2(INTEST, $1, makearr($3)); }
-	| '(' plist ')' IN varname	{ $$ = op2(INTEST, $2, makearr($5)); }
-	| ppattern term %prec CAT	{ $$ = op2(CAT, $1, $2); }
-	| reg_expr
-		{ $$ = op3(MATCH, NIL, rectonode(), (Node*)makedfa($1, 0)); }
-	| term
-	;
-
-pattern:
-	  var ASGNOP pattern		{ $$ = op2($2, $1, $3); }
-	| pattern '?' pattern ':' pattern %prec '?'
-	 	{ $$ = op3(CONDEXPR, notnull($1), $3, $5); }
-	| pattern bor pattern %prec BOR
-		{ $$ = op2(BOR, notnull($1), notnull($3)); }
-	| pattern and pattern %prec AND
-		{ $$ = op2(AND, notnull($1), notnull($3)); }
-	| NOT pattern
-		{ $$ = op1(NOT, op2(NE,$2,valtonode(lookup((uchar *)"$zero&null",symtab),CCON))); }
-	| pattern EQ pattern		{ $$ = op2($2, $1, $3); }
-	| pattern GE pattern		{ $$ = op2($2, $1, $3); }
-	| pattern GT pattern		{ $$ = op2($2, $1, $3); }
-	| pattern LE pattern		{ $$ = op2($2, $1, $3); }
-	| pattern LT pattern		{ $$ = op2($2, $1, $3); }
-	| pattern NE pattern		{ $$ = op2($2, $1, $3); }
-	| pattern MATCHOP reg_expr	{ $$ = op3($2, NIL, $1, (Node*)makedfa($3, 0)); }
-	| pattern MATCHOP pattern
-		{ if (constnode($3))
-			$$ = op3($2, NIL, $1, (Node*)makedfa(strnode($3), 0));
-		  else
-			$$ = op3($2, (Node *)1, $1, $3); }
-	| pattern IN varname		{ $$ = op2(INTEST, $1, makearr($3)); }
-	| '(' plist ')' IN varname	{ $$ = op2(INTEST, $2, makearr($5)); }
-	| pattern '|' GETLINE var	{ $$ = op3(GETLINE, $4, (Node*)$2, $1); }
-	| pattern '|' GETLINE		{ $$ = op3(GETLINE, (Node*)0, (Node*)$2, $1); }
-	| pattern term %prec CAT	{ $$ = op2(CAT, $1, $2); }
-	| reg_expr
-		{ $$ = op3(MATCH, NIL, rectonode(), (Node*)makedfa($1, 0)); }
-	| term
-	;
-
-plist:
-	  pattern comma pattern		{ $$ = linkum($1, $3); }
-	| plist comma pattern		{ $$ = linkum($1, $3); }
-	;
-
-pplist:
-	  ppattern
-	| pplist comma ppattern		{ $$ = linkum($1, $3); }
-
-prarg:
-	  /* empty */			{ $$ = rectonode(); }
-	| pplist
-	| '(' plist ')'			{ $$ = $2; }
-	;
-
-print:
-	  PRINT | PRINTF
-	;
-
-pst:
-	  NL | ';' | pst NL | pst ';'
-	;
-
-rbrace:
-	  '}' | rbrace NL
-	;
-
-reg_expr:
-	  '/' {startreg();} REGEXPR '/'		{ $$ = $3; }
-	;
-
-rparen:
-	  ')' | rparen NL
-	;
-
-simple_stmt:
-	  print prarg '|' term		{ $$ = stat3($1, $2, (Node *) $3, $4); }
-	| print prarg APPEND term	{ $$ = stat3($1, $2, (Node *) $3, $4); }
-	| print prarg GT term		{ $$ = stat3($1, $2, (Node *) $3, $4); }
-	| print prarg			{ $$ = stat3($1, $2, NIL, NIL); }
-	| DELETE varname '[' patlist ']' { $$ = stat2(DELETE, makearr($2), $4); }
-	| DELETE varname		{ yyclearin; ERROR "you can only delete array[element]" SYNTAX; $$ = stat1(DELETE, $2); }
-	| pattern			{ $$ = exptostat($1); }
-	| error				{ yyclearin; ERROR "illegal statement" SYNTAX; }
-	;
-
-st:
-	  nl | ';' opt_nl
-	;
-
-stmt:
-	  BREAK st		{ $$ = stat1(BREAK, NIL); }
-	| CLOSE pattern st	{ $$ = stat1(CLOSE, $2); }
-	| CONTINUE st		{ $$ = stat1(CONTINUE, NIL); }
-	| do stmt WHILE '(' pattern ')' st
-		{ $$ = stat2(DO, $2, notnull($5)); }
-	| EXIT pattern st	{ $$ = stat1(EXIT, $2); }
-	| EXIT st		{ $$ = stat1(EXIT, NIL); }
-	| for
-	| if stmt else stmt	{ $$ = stat3(IF, $1, $2, $4); }
-	| if stmt		{ $$ = stat3(IF, $1, $2, NIL); }
-	| lbrace stmtlist rbrace { $$ = $2; }
-	| NEXT st	{ if (infunc)
-				ERROR "next is illegal inside a function" SYNTAX;
-			  $$ = stat1(NEXT, NIL); }
-	| RETURN pattern st	{ $$ = stat1(RETURN, $2); }
-	| RETURN st		{ $$ = stat1(RETURN, NIL); }
-	| simple_stmt st
-	| while stmt		{ $$ = stat2(WHILE, $1, $2); }
-	| ';' opt_nl		{ $$ = 0; }
-	;
-
-stmtlist:
-	  stmt
-	| stmtlist stmt		{ $$ = linkum($1, $2); }
-	;
-
-subop:
-	  SUB | GSUB
-	;
-
-term:
-	  term '+' term			{ $$ = op2(ADD, $1, $3); }
-	| term '-' term			{ $$ = op2(MINUS, $1, $3); }
-	| term '*' term			{ $$ = op2(MULT, $1, $3); }
-	| term '/' term			{ $$ = op2(DIVIDE, $1, $3); }
-	| term '%' term			{ $$ = op2(MOD, $1, $3); }
-	| term POWER term		{ $$ = op2(POWER, $1, $3); }
-	| '-' term %prec UMINUS		{ $$ = op1(UMINUS, $2); }
-	| '+' term %prec UMINUS		{ $$ = $2; }
-	| BLTIN '(' ')'			{ $$ = op2(BLTIN, (Node *) $1, rectonode()); }
-	| BLTIN '(' patlist ')'		{ $$ = op2(BLTIN, (Node *) $1, $3); }
-	| BLTIN				{ $$ = op2(BLTIN, (Node *) $1, rectonode()); }
-	| CALL '(' ')'			{ $$ = op2(CALL, valtonode($1,CVAR), NIL); }
-	| CALL '(' patlist ')'		{ $$ = op2(CALL, valtonode($1,CVAR), $3); }
-	| DECR var			{ $$ = op1(PREDECR, $2); }
-	| INCR var			{ $$ = op1(PREINCR, $2); }
-	| var DECR			{ $$ = op1(POSTDECR, $1); }
-	| var INCR			{ $$ = op1(POSTINCR, $1); }
-	| GETLINE var LT term		{ $$ = op3(GETLINE, $2, (Node *)$3, $4); }
-	| GETLINE LT term		{ $$ = op3(GETLINE, NIL, (Node *)$2, $3); }
-	| GETLINE var			{ $$ = op3(GETLINE, $2, NIL, NIL); }
-	| GETLINE			{ $$ = op3(GETLINE, NIL, NIL, NIL); }
-	| INDEX '(' pattern comma pattern ')'
-		{ $$ = op2(INDEX, $3, $5); }
-	| INDEX '(' pattern comma reg_expr ')'
-		{ ERROR "index() doesn't permit regular expressions" SYNTAX;
-		  $$ = op2(INDEX, $3, (Node*)$5); }
-	| '(' pattern ')'		{ $$ = $2; }
-	| MATCHFCN '(' pattern comma reg_expr ')'
-		{ $$ = op3(MATCHFCN, NIL, $3, (Node*)makedfa($5, 1)); }
-	| MATCHFCN '(' pattern comma pattern ')'
-		{ if (constnode($5))
-			$$ = op3(MATCHFCN, NIL, $3, (Node*)makedfa(strnode($5), 1));
-		  else
-			$$ = op3(MATCHFCN, (Node *)1, $3, $5); }
-	| NUMBER			{ $$ = valtonode($1, CCON); }
-	| SPLIT '(' pattern comma varname comma pattern ')'     /* string */
-		{ $$ = op4(SPLIT, $3, makearr($5), $7, (Node*)STRING); }
-	| SPLIT '(' pattern comma varname comma reg_expr ')'    /* const /regexp/ */
-		{ $$ = op4(SPLIT, $3, makearr($5), (Node*)makedfa($7, 1), (Node *)REGEXPR); }
-	| SPLIT '(' pattern comma varname ')'
-		{ $$ = op4(SPLIT, $3, makearr($5), NIL, (Node*)STRING); }  /* default */
-	| SPRINTF '(' patlist ')'	{ $$ = op1($1, $3); }
-	| STRING	 		{ $$ = valtonode($1, CCON); }
-	| subop '(' reg_expr comma pattern ')'
-		{ $$ = op4($1, NIL, (Node*)makedfa($3, 1), $5, rectonode()); }
-	| subop '(' pattern comma pattern ')'
-		{ if (constnode($3))
-			$$ = op4($1, NIL, (Node*)makedfa(strnode($3), 1), $5, rectonode());
-		  else
-			$$ = op4($1, (Node *)1, $3, $5, rectonode()); }
-	| subop '(' reg_expr comma pattern comma var ')'
-		{ $$ = op4($1, NIL, (Node*)makedfa($3, 1), $5, $7); }
-	| subop '(' pattern comma pattern comma var ')'
-		{ if (constnode($3))
-			$$ = op4($1, NIL, (Node*)makedfa(strnode($3), 1), $5, $7);
-		  else
-			$$ = op4($1, (Node *)1, $3, $5, $7); }
-	| SUBSTR '(' pattern comma pattern comma pattern ')'
-		{ $$ = op3(SUBSTR, $3, $5, $7); }
-	| SUBSTR '(' pattern comma pattern ')'
-		{ $$ = op3(SUBSTR, $3, $5, NIL); }
-	| var
-	;
-
-var:
-	  varname
-	| varname '[' patlist ']'	{ $$ = op2(ARRAY, makearr($1), $3); }
-	| FIELD				{ $$ = valtonode($1, CFLD); }
-	| IVAR				{ $$ = op1(INDIRECT, valtonode($1, CVAR)); }
-	| INDIRECT term	 		{ $$ = op1(INDIRECT, $2); }
-	;	
-
-varlist:
-	  /* nothing */		{ arglist = $$ = 0; }
-	| VAR			{ arglist = $$ = valtonode($1,CVAR); }
-	| varlist comma VAR	{ arglist = $$ = linkum($1,valtonode($3,CVAR)); }
-	;
-
-varname:
-	  VAR			{ $$ = valtonode($1, CVAR); }
-	| ARG 			{ $$ = op1(ARG, (Node *) $1); }
-	| VARNF			{ $$ = op1(VARNF, (Node *) $1); }
-	;
-
-
-while:
-	  WHILE '(' pattern rparen	{ $$ = notnull($3); }
-	;
-
-%%
-
-static void
-setfname(Cell *p)
-{
-	if (isarr(p))
-		ERROR "%s is an array, not a function", p->nval SYNTAX;
-	else if (isfunc(p))
-		ERROR "you can't define function %s more than once", p->nval SYNTAX;
-	curfname = p->nval;
-}
-
-
-static int
-constnode(Node *p)
-{
-	return p->ntype == NVALUE && ((Cell *) (p->narg[0]))->csub == CCON;
-}
-
-static uchar *
-strnode(Node *p)
-{
-	return ((Cell *)(p->narg[0]))->sval;
-}
-
-static Node *
-notnull(Node *n)
-{
-	switch (n->nobj) {
-	case LE: case LT: case EQ: case NE: case GT: case GE:
-	case BOR: case AND: case NOT:
-		return n;
-	default:
-		return op2(NE, n, nullnode);
-	}
-}
--- old/usr/src/cmd/awk/awk.h	2013-05-27 09:45:02.753093367 +0000
+++ /dev/null	2013-05-27 09:45:02.000000000 +0000
@@ -1,366 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#ifndef AWK_H
-#define	AWK_H
-
-#include <sys/types.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libintl.h>
-#include <limits.h>
-
-typedef double	Awkfloat;
-typedef	unsigned char uchar;
-
-#define	xfree(a)	{ if ((a) != NULL) { free(a); a = NULL; } }
-
-#define	DEBUG
-#ifdef	DEBUG
-			/* uses have to be doubly parenthesized */
-#define	dprintf(x)	if (dbg) (void) printf x
-#else
-#define	dprintf(x)
-#endif
-
-extern	char	errbuf[200];
-extern	void	error(int, char *);
-#define	ERROR	(void) snprintf(errbuf, sizeof (errbuf),
-/*CSTYLED*/
-#define	FATAL	), error(1, errbuf)
-/*CSTYLED*/
-#define	WARNING	), error(0, errbuf)
-/*CSTYLED*/
-#define	SYNTAX	), yyerror(errbuf)
-/*CSTYLED*/
-#define	CONT	)
-
-extern int	compile_time;	/* 1 if compiling, 0 if running */
-
-#define	FLD_INCR	64
-#define	LINE_INCR	256
-
-/* ensure that there is extra 1 byte in the buffer */
-#define	expand_buf(p, n, r)	\
-	if (*(n) == 0 || (r) >= (*(n) - 1)) r_expand_buf(p, n, r)
-
-extern uchar	**FS;
-extern uchar	**RS;
-extern uchar	**ORS;
-extern uchar	**OFS;
-extern uchar	**OFMT;
-extern Awkfloat *NR;
-extern Awkfloat *FNR;
-extern Awkfloat *NF;
-extern uchar	**FILENAME;
-extern uchar	**SUBSEP;
-extern Awkfloat *RSTART;
-extern Awkfloat *RLENGTH;
-
-extern uchar	*record;
-extern size_t	record_size;
-extern int	errorflag;
-extern int	donefld;	/* 1 if record broken into fields */
-extern int	donerec;	/* 1 if record is valid (no fld has changed */
-
-extern	uchar	*patbeg;	/* beginning of pattern matched */
-extern	int	patlen;		/* length.  set in b.c */
-
-/* Cell:  all information about a variable or constant */
-
-typedef struct Cell {
-	uchar	ctype;		/* OCELL, OBOOL, OJUMP, etc. */
-	uchar	csub;		/* CCON, CTEMP, CFLD, etc. */
-	uchar	*nval;		/* name, for variables only */
-	uchar	*sval;		/* string value */
-	Awkfloat fval;		/* value as number */
-	unsigned tval;
-		/* type info: STR|NUM|ARR|FCN|FLD|CON|DONTFREE */
-	struct Cell *cnext;	/* ptr to next if chained */
-} Cell;
-
-typedef struct {		/* symbol table array */
-	int	nelem;		/* elements in table right now */
-	int	size;		/* size of tab */
-	Cell	**tab;		/* hash table pointers */
-} Array;
-
-#define	NSYMTAB	50	/* initial size of a symbol table */
-extern Array	*symtab, *makesymtab(int);
-extern Cell	*setsymtab(uchar *, uchar *, Awkfloat, unsigned int, Array *);
-extern Cell	*lookup(uchar *, Array *);
-
-extern Cell	*recloc;	/* location of input record */
-extern Cell	*nrloc;		/* NR */
-extern Cell	*fnrloc;	/* FNR */
-extern Cell	*nfloc;		/* NF */
-extern Cell	*rstartloc;	/* RSTART */
-extern Cell	*rlengthloc;	/* RLENGTH */
-
-/* Cell.tval values: */
-#define	NUM	01	/* number value is valid */
-#define	STR	02	/* string value is valid */
-#define	DONTFREE 04	/* string space is not freeable */
-#define	CON	010	/* this is a constant */
-#define	ARR	020	/* this is an array */
-#define	FCN	040	/* this is a function name */
-#define	FLD	0100	/* this is a field $1, $2, ... */
-#define	REC	0200	/* this is $0 */
-
-#define	freeable(p)	(!((p)->tval & DONTFREE))
-
-extern Awkfloat setfval(Cell *, Awkfloat), getfval(Cell *), r_getfval(Cell *);
-extern uchar	*setsval(Cell *, uchar *), *getsval(Cell *), *r_getsval(Cell *);
-extern uchar	*tostring(uchar *), *tokname(int), *qstring(uchar *, int);
-
-#define	getfval(p)	\
-	(((p)->tval & (ARR|FLD|REC|NUM)) == NUM ? (p)->fval : r_getfval(p))
-#define	getsval(p)	\
-	(((p)->tval & (ARR|FLD|REC|STR)) == STR ? (p)->sval : r_getsval(p))
-
-/* function types */
-#define	FLENGTH	1
-#define	FSQRT	2
-#define	FEXP	3
-#define	FLOG	4
-#define	FINT	5
-#define	FSYSTEM	6
-#define	FRAND	7
-#define	FSRAND	8
-#define	FSIN	9
-#define	FCOS	10
-#define	FATAN	11
-#define	FTOUPPER 12
-#define	FTOLOWER 13
-
-/* Node:  parse tree is made of nodes, with Cell's at bottom */
-
-typedef struct Node {
-	int	ntype;
-	struct	Node *nnext;
-	off_t lineno;
-	int	nobj;
-	struct Node *narg[1];
-		/* variable: actual size set by calling malloc */
-} Node;
-
-#define	NIL	((Node *)0)
-
-extern Node	*winner;
-extern Node	*nullstat;
-extern Node	*nullnode;
-
-/* ctypes */
-#define	OCELL	1
-#define	OBOOL	2
-#define	OJUMP	3
-
-/* Cell subtypes: csub */
-#define	CFREE	7
-#define	CCOPY	6
-#define	CCON	5
-#define	CTEMP	4
-#define	CNAME	3
-#define	CVAR	2
-#define	CFLD	1
-
-/* bool subtypes */
-#define	BTRUE	11
-#define	BFALSE	12
-
-/* jump subtypes */
-#define	JEXIT	21
-#define	JNEXT	22
-#define	JBREAK	23
-#define	JCONT	24
-#define	JRET	25
-
-/* node types */
-#define	NVALUE	1
-#define	NSTAT	2
-#define	NEXPR	3
-#define	NFIELD	4
-
-extern	Cell	*(*proctab[])(Node **, int);
-extern	Cell	*nullproc(Node **, int);
-extern	int	pairstack[], paircnt;
-
-extern	Node	*stat1(int, Node *), *stat2(int, Node *, Node *);
-extern	Node	*stat3(int, Node *, Node *, Node *);
-extern	Node	*stat4(int, Node *, Node *, Node *, Node *);
-extern	Node	*pa2stat(Node *, Node *, Node *);
-extern	Node	*op1(int, Node *), *op2(int, Node *, Node *);
-extern	Node	*op3(int, Node *, Node *, Node *);
-extern	Node	*op4(int, Node *, Node *, Node *, Node *);
-extern	Node	*linkum(Node *, Node *), *valtonode(Cell *, int);
-extern	Node	*rectonode(void), *exptostat(Node *);
-extern	Node	*makearr(Node *);
-
-#define	notlegal(n)	\
-	(n <= FIRSTTOKEN || n >= LASTTOKEN || proctab[n-FIRSTTOKEN] == nullproc)
-#define	isvalue(n)	((n)->ntype == NVALUE)
-#define	isexpr(n)	((n)->ntype == NEXPR)
-#define	isjump(n)	((n)->ctype == OJUMP)
-#define	isexit(n)	((n)->csub == JEXIT)
-#define	isbreak(n)	((n)->csub == JBREAK)
-#define	iscont(n)	((n)->csub == JCONT)
-#define	isnext(n)	((n)->csub == JNEXT)
-#define	isret(n)	((n)->csub == JRET)
-#define	isstr(n)	((n)->tval & STR)
-#define	isnum(n)	((n)->tval & NUM)
-#define	isarr(n)	((n)->tval & ARR)
-#define	isfunc(n)	((n)->tval & FCN)
-#define	istrue(n)	((n)->csub == BTRUE)
-#define	istemp(n)	((n)->csub == CTEMP)
-
-#define	NCHARS	(256+1)
-#define	NSTATES	32
-
-typedef struct rrow {
-	int	ltype;
-	int	lval;
-	int	*lfollow;
-} rrow;
-
-typedef struct fa {
-	uchar	*restr;
-	int	anchor;
-	int	use;
-	uchar	gototab[NSTATES][NCHARS];
-	int	*posns[NSTATES];
-	uchar	out[NSTATES];
-	int	initstat;
-	int	curstat;
-	int	accept;
-	int	reset;
-	struct	rrow re[1];
-} fa;
-
-/* b.c */
-extern	fa	*makedfa(uchar *, int);
-extern	int	nematch(fa *, uchar *);
-extern	int	match(fa *, uchar *);
-extern	int	pmatch(fa *, uchar *);
-
-/* lib.c */
-extern	int	isclvar(uchar *);
-extern	int	is_number(uchar *);
-extern	void	setclvar(uchar *);
-extern	int	readrec(uchar **, size_t *, FILE *);
-extern	void	bracecheck(void);
-extern	void	syminit(void);
-extern	void	yyerror(char *);
-extern	void	fldbld(void);
-extern	void	recbld(void);
-extern	int	getrec(uchar **, size_t *);
-extern	Cell	*fieldadr(int);
-extern	void	newfld(int);
-extern	Cell	*getfld(int);
-extern	int	fldidx(Cell *);
-extern	double	errcheck(double, char *);
-extern	void	fpecatch(int);
-extern	void	init_buf(uchar **, size_t *, size_t);
-extern	void	adjust_buf(uchar **, size_t);
-extern	void	r_expand_buf(uchar **, size_t *, size_t);
-
-extern	int	donefld;
-extern	int	donerec;
-extern	uchar	*record;
-extern	size_t	record_size;
-
-/* main.c */
-extern	int	dbg;
-extern	uchar	*cmdname;
-extern	uchar	*lexprog;
-extern	int	compile_time;
-extern	char	radixpoint;
-
-/* tran.c */
-extern	void	syminit(void);
-extern	void	arginit(int, uchar **);
-extern	void	envinit(uchar **);
-extern	void	freesymtab(Cell *);
-extern	void	freeelem(Cell *, uchar *);
-extern	void	funnyvar(Cell *, char *);
-extern	int	hash(uchar *, int);
-extern	Awkfloat *ARGC;
-
-/* run.c */
-extern	void	run(Node *);
-
-extern	int	paircnt;
-extern	Node	*winner;
-
-#ifndef input
-extern	int	input(void);
-#endif
-extern	int	yyparse(void);
-extern	FILE	*yyin;
-extern	off_t	lineno;
-
-/* proc */
-extern Cell *nullproc(Node **, int);
-extern Cell *program(Node **, int);
-extern Cell *boolop(Node **, int);
-extern Cell *relop(Node **, int);
-extern Cell *array(Node **, int);
-extern Cell *indirect(Node **, int);
-extern Cell *substr(Node **, int);
-extern Cell *sub(Node **, int);
-extern Cell *gsub(Node **, int);
-extern Cell *sindex(Node **, int);
-extern Cell *a_sprintf(Node **, int);
-extern Cell *arith(Node **, int);
-extern Cell *incrdecr(Node **, int);
-extern Cell *cat(Node **, int);
-extern Cell *pastat(Node **, int);
-extern Cell *dopa2(Node **, int);
-extern Cell *matchop(Node **, int);
-extern Cell *intest(Node **, int);
-extern Cell *aprintf(Node **, int);
-extern Cell *print(Node **, int);
-extern Cell *closefile(Node **, int);
-extern Cell *delete(Node **, int);
-extern Cell *split(Node **, int);
-extern Cell *assign(Node **, int);
-extern Cell *condexpr(Node **, int);
-extern Cell *ifstat(Node **, int);
-extern Cell *whilestat(Node **, int);
-extern Cell *forstat(Node **, int);
-extern Cell *dostat(Node **, int);
-extern Cell *instat(Node **, int);
-extern Cell *jump(Node **, int);
-extern Cell *bltin(Node **, int);
-extern Cell *call(Node **, int);
-extern Cell *arg(Node **, int);
-extern Cell *getnf(Node **, int);
-extern Cell *getaline(Node **, int);
-
-#endif /* AWK_H */
--- old/usr/src/cmd/awk/awk.lx.l	2013-05-27 09:45:02.881674846 +0000
+++ /dev/null	2013-05-27 09:45:02.000000000 +0000
@@ -1,306 +0,0 @@
-%{
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-%}
-
-%{
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-%}
-
-%Start A str sc reg comment
-
-%{
-
-#include	<sys/types.h>
-#include	"awk.h"
-#include	"y.tab.h"
-
-#undef	input	/* defeat lex */
-#undef	unput
-
-static void unput(int);
-static void unputstr(char *);
-
-extern YYSTYPE	yylval;
-extern int	infunc;
-
-off_t	lineno	= 1;
-int	bracecnt = 0;
-int	brackcnt  = 0;
-int	parencnt = 0;
-#define DEBUG
-#ifdef	DEBUG
-#	define	RET(x)	{if(dbg)printf("lex %s [%s]\n", tokname(x), yytext); return(x); }
-#else
-#	define	RET(x)	return(x)
-#endif
-
-/*
- * The standards (SUSV2) requires that Record size be atleast LINE_MAX.
- * LINE_MAX is a standard variable defined in limits.h.
- * Though nawk is not standards compliant, we let RECSIZE
- * grow with LINE_MAX instead of the magic number 1024.
- */
-#define	CBUFLEN	(3 * LINE_MAX)
-
-#define	CADD	cbuf[clen++] = yytext[0]; \
-		if (clen >= CBUFLEN-1) { \
-			ERROR "string/reg expr %.10s... too long", cbuf SYNTAX; \
-			BEGIN A; \
-		}
-
-static uchar	cbuf[CBUFLEN];
-static uchar	*s;
-static int	clen, cflag;
-%}
-
-A	[a-zA-Z_]
-B	[a-zA-Z0-9_]
-D	[0-9]
-O	[0-7]
-H	[0-9a-fA-F]
-WS	[ \t]
-
-%%
-	switch (yybgin-yysvec-1) {	/* witchcraft */
-	case 0:
-		BEGIN A;
-		break;
-	case sc:
-		BEGIN A;
-		RET('}');
-	}
-
-<A>\n		{ lineno++; RET(NL); }
-<A>#.*		{ ; }	/* strip comments */
-<A>{WS}+	{ ; }
-<A>;		{ RET(';'); }
-
-<A>"\\"\n	{ lineno++; }
-<A>BEGIN	{ RET(XBEGIN); }
-<A>END		{ RET(XEND); }
-<A>func(tion)?	{ if (infunc) ERROR "illegal nested function" SYNTAX; RET(FUNC); }
-<A>return	{ if (!infunc) ERROR "return not in function" SYNTAX; RET(RETURN); }
-<A>"&&"		{ RET(AND); }
-<A>"||"		{ RET(BOR); }
-<A>"!"		{ RET(NOT); }
-<A>"!="		{ yylval.i = NE; RET(NE); }
-<A>"~"		{ yylval.i = MATCH; RET(MATCHOP); }
-<A>"!~"		{ yylval.i = NOTMATCH; RET(MATCHOP); }
-<A>"<"		{ yylval.i = LT; RET(LT); }
-<A>"<="		{ yylval.i = LE; RET(LE); }
-<A>"=="		{ yylval.i = EQ; RET(EQ); }
-<A>">="		{ yylval.i = GE; RET(GE); }
-<A>">"		{ yylval.i = GT; RET(GT); }
-<A>">>"		{ yylval.i = APPEND; RET(APPEND); }
-<A>"++"		{ yylval.i = INCR; RET(INCR); }
-<A>"--"		{ yylval.i = DECR; RET(DECR); }
-<A>"+="		{ yylval.i = ADDEQ; RET(ASGNOP); }
-<A>"-="		{ yylval.i = SUBEQ; RET(ASGNOP); }
-<A>"*="		{ yylval.i = MULTEQ; RET(ASGNOP); }
-<A>"/="		{ yylval.i = DIVEQ; RET(ASGNOP); }
-<A>"%="		{ yylval.i = MODEQ; RET(ASGNOP); }
-<A>"^="		{ yylval.i = POWEQ; RET(ASGNOP); }
-<A>"**="	{ yylval.i = POWEQ; RET(ASGNOP); }
-<A>"="		{ yylval.i = ASSIGN; RET(ASGNOP); }
-<A>"**"		{ RET(POWER); }
-<A>"^"		{ RET(POWER); }
-
-<A>"$"{D}+	{ yylval.cp = fieldadr(atoi(yytext+1)); RET(FIELD); }
-<A>"$NF"	{ unputstr("(NF)"); return(INDIRECT); }
-<A>"$"{A}{B}*	{ int c, n;
-		  c = input(); unput(c);
-		  if (c == '(' || c == '[' || infunc && (n=isarg(yytext+1)) >= 0) {
-			unputstr(yytext+1);
-			return(INDIRECT);
-		  } else {
-			yylval.cp = setsymtab((uchar *)yytext+1,
-				(uchar *)"",0.0,STR|NUM,symtab);
-			RET(IVAR);
-		  }
-		}
-<A>"$"		{ RET(INDIRECT); }
-<A>NF		{ yylval.cp = setsymtab((uchar *)yytext, (uchar *)"", 0.0, NUM, symtab); RET(VARNF); }
-
-<A>({D}+("."?){D}*|"."{D}+)((e|E)("+"|-)?{D}+)?	{
-		  yylval.cp = setsymtab((uchar *)yytext, tostring((uchar *)yytext), atof(yytext), CON|NUM, symtab);
-		  RET(NUMBER); }
-
-<A>while	{ RET(WHILE); }
-<A>for		{ RET(FOR); }
-<A>do		{ RET(DO); }
-<A>if		{ RET(IF); }
-<A>else		{ RET(ELSE); }
-<A>next		{ RET(NEXT); }
-<A>exit		{ RET(EXIT); }
-<A>break	{ RET(BREAK); }
-<A>continue	{ RET(CONTINUE); }
-<A>print	{ yylval.i = PRINT; RET(PRINT); }
-<A>printf	{ yylval.i = PRINTF; RET(PRINTF); }
-<A>sprintf	{ yylval.i = SPRINTF; RET(SPRINTF); }
-<A>split	{ yylval.i = SPLIT; RET(SPLIT); }
-<A>substr	{ RET(SUBSTR); }
-<A>sub		{ yylval.i = SUB; RET(SUB); }
-<A>gsub		{ yylval.i = GSUB; RET(GSUB); }
-<A>index	{ RET(INDEX); }
-<A>match	{ RET(MATCHFCN); }
-<A>in		{ RET(IN); }
-<A>getline	{ RET(GETLINE); }
-<A>close	{ RET(CLOSE); }
-<A>delete	{ RET(DELETE); }
-<A>length	{ yylval.i = FLENGTH; RET(BLTIN); }
-<A>log		{ yylval.i = FLOG; RET(BLTIN); }
-<A>int		{ yylval.i = FINT; RET(BLTIN); }
-<A>exp		{ yylval.i = FEXP; RET(BLTIN); }
-<A>sqrt		{ yylval.i = FSQRT; RET(BLTIN); }
-<A>sin		{ yylval.i = FSIN; RET(BLTIN); }
-<A>cos		{ yylval.i = FCOS; RET(BLTIN); }
-<A>atan2	{ yylval.i = FATAN; RET(BLTIN); }
-<A>system	{ yylval.i = FSYSTEM; RET(BLTIN); }
-<A>rand		{ yylval.i = FRAND; RET(BLTIN); }
-<A>srand	{ yylval.i = FSRAND; RET(BLTIN); }
-<A>toupper	{ yylval.i = FTOUPPER; RET(BLTIN); }
-<A>tolower	{ yylval.i = FTOLOWER; RET(BLTIN); }
-
-<A>{A}{B}*	{ int n, c;
-		  c = input(); unput(c);	/* look for '(' */
-		  if (c != '(' && infunc && (n=isarg(yytext)) >= 0) {
-			yylval.i = n;
-			RET(ARG);
-		  } else {
-			yylval.cp = setsymtab((uchar *)yytext,
-				(uchar *)"",0.0,STR|NUM,symtab);
-			if (c == '(') {
-				RET(CALL);
-			} else {
-				RET(VAR);
-			}
-		  }
-		}
-<A>\"		{ BEGIN str; clen = 0; }
-
-<A>"}"		{ if (--bracecnt < 0) ERROR "extra }" SYNTAX; BEGIN sc; RET(';'); }
-<A>"]"		{ if (--brackcnt < 0) ERROR "extra ]" SYNTAX; RET(']'); }
-<A>")"		{ if (--parencnt < 0) ERROR "extra )" SYNTAX; RET(')'); }
-
-<A>.		{ if (yytext[0] == '{') bracecnt++;
-		  else if (yytext[0] == '[') brackcnt++;
-		  else if (yytext[0] == '(') parencnt++;
-		  RET(yylval.i = yytext[0]); /* everything else */ }
-
-<reg>\\.	{ cbuf[clen++] = '\\'; cbuf[clen++] = yytext[1]; }
-<reg>\n		{ ERROR "newline in regular expression %.10s...", cbuf SYNTAX; lineno++; BEGIN A; }
-<reg>"/"	{ BEGIN A;
-		  cbuf[clen] = 0;
-		  yylval.s = tostring(cbuf);
-		  unput('/');
-		  RET(REGEXPR); }
-<reg>.		{ CADD; }
-
-<str>\"		{ BEGIN A;
-		  cbuf[clen] = 0; s = tostring(cbuf);
-		  cbuf[clen] = ' '; cbuf[++clen] = 0;
-		  yylval.cp = setsymtab(cbuf, s, 0.0, CON|STR, symtab);
-		  RET(STRING); }
-<str>\n		{ ERROR "newline in string %.10s...", cbuf SYNTAX; lineno++; BEGIN A; }
-<str>"\\\""	{ cbuf[clen++] = '"'; }
-<str>"\\"n	{ cbuf[clen++] = '\n'; }
-<str>"\\"t	{ cbuf[clen++] = '\t'; }
-<str>"\\"f	{ cbuf[clen++] = '\f'; }
-<str>"\\"r	{ cbuf[clen++] = '\r'; }
-<str>"\\"b	{ cbuf[clen++] = '\b'; }
-<str>"\\"v	{ cbuf[clen++] = '\v'; }	/* these ANSIisms may not be known by */
-<str>"\\"a	{ cbuf[clen++] = '\007'; }	/* your compiler. hence 007 for bell */
-<str>"\\\\"	{ cbuf[clen++] = '\\'; }
-<str>"\\"({O}{O}{O}|{O}{O}|{O}) { int n;
-		  sscanf(yytext+1, "%o", &n); cbuf[clen++] = n; }
-<str>"\\"x({H}+) { int n;	/* ANSI permits any number! */
-		  sscanf(yytext+2, "%x", &n); cbuf[clen++] = n; }
-<str>"\\".	{ cbuf[clen++] = yytext[1]; }
-<str>.		{ CADD; }
-
-%%
-
-void
-startreg()
-{
-	BEGIN reg;
-	clen = 0;
-}
-
-/* input() and unput() are transcriptions of the standard lex
-   macros for input and output with additions for error message
-   printing.  God help us all if someone changes how lex works.
-*/
-
-uchar	ebuf[300];
-uchar	*ep = ebuf;
-
-int
-input(void)
-{
-	register int c;
-	extern uchar *lexprog;
-
-	if (yysptr > yysbuf)
-		c = U(*--yysptr);
-	else if (lexprog != NULL)	/* awk '...' */
-		c = *lexprog++;
-	else				/* awk -f ... */
-		c = pgetc();
-	if (c == '\n')
-		yylineno++;
-	else if (c == EOF)
-		c = 0;
-	if (ep >= ebuf + sizeof ebuf)
-		ep = ebuf;
-	return *ep++ = c;
-}
-
-static void
-unput(int c)
-{
-	yytchar = c;
-	if (yytchar == '\n')
-		yylineno--;
-	*yysptr++ = yytchar;
-	if (--ep < ebuf)
-		ep = ebuf + sizeof(ebuf) - 1;
-}
-
-
-static void
-unputstr(char *s)
-{
-	int i;
-
-	for (i = strlen(s)-1; i >= 0; i--)
-		unput(s[i]);
-}
--- old/usr/src/cmd/awk/awk.xcl	2013-05-27 09:45:03.022093298 +0000
+++ /dev/null	2013-05-27 09:45:03.000000000 +0000
@@ -1,234 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-msgid "$zero&null"
-msgid "next is illegal inside a function"
-msgid "syntax error"
-msgid "yacc stack overflow"
-msgid ""
-msgid "%o"
-msgid "%x"
-msgid "(NF)"
-msgid "Input string too long, limit %d\n"
-msgid "bad switch yylook %d"
-msgid "lex %s [%s]\n"
-msgid ""
-msgid "cclenter: in = |%s|, out = |%s|\n"
-msgid "reparse <%s>\n"
-msgid ""
-msgid "$0"
-msgid "%d"
-msgid "%s"
-msgid "%s\n"
-msgid "-"
-msgid "RS=<%s>, FS=<%s>, ARGC=%d, FILENAME=%s\n"
-msgid "\n"
-msgid "argno=%d, file=|%s|\n"
-msgid "command line set %s to |%s|\n"
-msgid "field %d: |%s|\n"
-msgid "getargv(%d) returns |%s|\n"
-msgid "in recbld FS=%o, recloc=%o\n"
-msgid "into refldbld, rec = <%s>, pat = <%s>\n"
-msgid "match %s (%d chars)\n"
-msgid "no match %s\n"
-msgid "opening file %s\n"
-msgid "r"
-msgid "readrec saw <%s>, returns %d\n"
-msgid "recbld = |%s|\n"
-msgid "refldbld: i=%d\n"
-msgid ""
-msgid "--"
-msgid "#"
-msgid "# file: main.c.i, line number: 1016, textdomain("")"
-msgid "\t"
-msgid "argc=%d, argv[0]=%s\n"
-msgid "awk %s\n"
-msgid "errorflag=%d\n"
-msgid "program = |%s|\n"
-msgid "r"
-msgid "version Oct 11, 1989"
-msgid "defining func %s (%d args)\n"
-msgid "ADD"
-msgid "ADDEQ"
-msgid "ALL"
-msgid "AND"
-msgid "APPEND"
-msgid "ARG"
-msgid "ARRAY"
-msgid "ASGNOP"
-msgid "ASSIGN"
-msgid "BLTIN"
-msgid "BOR"
-msgid "BREAK"
-msgid "CALL"
-msgid "CAT"
-msgid "CCL"
-msgid "CHAR"
-msgid "CLOSE"
-msgid "CONDEXPR"
-msgid "CONTINUE"
-msgid "DECR"
-msgid "DELETE"
-msgid "DIVEQ"
-msgid "DIVIDE"
-msgid "DO"
-msgid "DOT"
-msgid "ELSE"
-msgid "EQ"
-msgid "EXIT"
-msgid "FIELD"
-msgid "FINAL"
-msgid "FIRSTTOKEN"
-msgid "FOR"
-msgid "FUNC"
-msgid "GE"
-msgid "GETLINE"
-msgid "GSUB"
-msgid "GT"
-msgid "IF"
-msgid "IN"
-msgid "INCR"
-msgid "INDEX"
-msgid "INDIRECT"
-msgid "INTEST"
-msgid "IVAR"
-msgid "LASTTOKEN"
-msgid "LE"
-msgid "LSUBSTR"
-msgid "LT"
-msgid "MATCH"
-msgid "MATCHFCN"
-msgid "MATCHOP"
-msgid "MINUS"
-msgid "MOD"
-msgid "MODEQ"
-msgid "MULT"
-msgid "MULTEQ"
-msgid "NCCL"
-msgid "NE"
-msgid "NEXT"
-msgid "NL"
-msgid "NOT"
-msgid "NOTMATCH"
-msgid "NUMBER"
-msgid "OR"
-msgid "PASTAT"
-msgid "PASTAT2"
-msgid "PLUS"
-msgid "POSTDECR"
-msgid "POSTINCR"
-msgid "POWEQ"
-msgid "POWER"
-msgid "PREDECR"
-msgid "PREINCR"
-msgid "PRINT"
-msgid "PRINTF"
-msgid "PROGRAM"
-msgid "QUEST"
-msgid "REGEXPR"
-msgid "RETURN"
-msgid "SPLIT"
-msgid "SPRINTF"
-msgid "STAR"
-msgid "STRING"
-msgid "SUB"
-msgid "SUBEQ"
-msgid "SUBSTR"
-msgid "UMINUS"
-msgid "VAR"
-msgid "VARNF"
-msgid "WHILE"
-msgid "XBEGIN"
-msgid "XEND"
-msgid "token %d"
-msgid ""
-msgid "## gtemp %.8s %06o\n"
-msgid "## tfree %.8s %06o %s\n"
-msgid "%d"
-msgid "%s"
-msgid "%s returns %g |%s| %o\n"
-msgid "(array)"
-msgid "(regexpr)"
-msgid "-"
-msgid "a"
-msgid "arg(%d), fp->nargs=%d\n"
-msgid "args[%d]: %s %f <%s>, t=%o\n"
-msgid "call.fcn"
-msgid "callargs"
-msgid "calling %s, %d args (%d in defn), fp=%d\n"
-msgid "close"
-msgid "copycell"
-msgid "evaluate args[%d], fp=%d:\n"
-msgid "execute"
-msgid "exp"
-msgid "fcn ret"
-msgid "finished exec of %s, fp=%d\n"
-msgid "fp->args"
-msgid "log"
-msgid "making %s into an array\n"
-msgid "nullargs"
-msgid "oargsarr"
-msgid "pow"
-msgid "r"
-msgid "read value of"
-msgid "retval"
-msgid "split: s=|%s|, a=%s, sep=|%s|\n"
-msgid "sqrt"
-msgid "start exec of %s, fp=%d\n"
-msgid "substr: m=%d, n=%d, s=%s\n"
-msgid "w"
-msgid ""
-msgid " "
-msgid " s=\"%s\" f=%g t=%o\n"
-msgid "$zero&null"
-msgid "%.20g"
-msgid "%.6g"
-msgid "%d"
-msgid "-"
-msgid "0"
-msgid "ARGC"
-msgid "ARGV"
-msgid "ENVIRON"
-msgid "FILENAME"
-msgid "FNR"
-msgid "FS"
-msgid "NF"
-msgid "NR"
-msgid "OFMT"
-msgid "OFS"
-msgid "ORS"
-msgid "RLENGTH"
-msgid "RS"
-msgid "RSTART"
-msgid "SUBSEP"
-msgid "SYMTAB"
-msgid "\034"
-msgid "\n"
-msgid "assign to"
-msgid "getfval %o: %s = %g, t=%o\n"
-msgid "getsval %o: %s = \"%s\", t=%o\n"
-msgid "read value of"
-msgid "setfval %o: %s = %g, t=%o\n"
-msgid "setsval %o: %s = \"%s\", t=%o\n"
-msgid "setsymtab found %o: n=%s"
-msgid "setsymtab set %o: n=%s"
-msgid "setting field %d to %g\n"
-msgid "setting field %d to %s\n"
--- old/usr/src/cmd/awk/b.c	2013-05-27 09:45:03.161873881 +0000
+++ /dev/null	2013-05-27 09:45:03.000000000 +0000
@@ -1,864 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#define	DEBUG
-
-#include "awk.h"
-#include "y.tab.h"
-
-#define	HAT	(NCHARS-1)	/* matches ^ in regular expr */
-				/* NCHARS is 2**n */
-#define	MAXLIN (3 * LINE_MAX)
-
-#define	type(v)		(v)->nobj
-#define	left(v)		(v)->narg[0]
-#define	right(v)	(v)->narg[1]
-#define	parent(v)	(v)->nnext
-
-#define	LEAF	case CCL: case NCCL: case CHAR: case DOT: case FINAL: case ALL:
-#define	UNARY	case STAR: case PLUS: case QUEST:
-
-/*
- * encoding in tree Nodes:
- *	leaf (CCL, NCCL, CHAR, DOT, FINAL, ALL):
- *		left is index, right contains value or pointer to value
- *	unary (STAR, PLUS, QUEST): left is child, right is null
- *	binary (CAT, OR): left and right are children
- *	parent contains pointer to parent
- */
-
-int	setvec[MAXLIN];
-int	tmpset[MAXLIN];
-Node	*point[MAXLIN];
-
-int	rtok;		/* next token in current re */
-int	rlxval;
-uchar	*rlxstr;
-uchar	*prestr;	/* current position in current re */
-uchar	*lastre;	/* origin of last re */
-
-static	int setcnt;
-static	int poscnt;
-
-uchar	*patbeg;
-int	patlen;
-
-#define	NFA	20	/* cache this many dynamic fa's */
-fa	*fatab[NFA];
-int	nfatab	= 0;	/* entries in fatab */
-
-static fa	*mkdfa(uchar *, int);
-static int	makeinit(fa *, int);
-static void	penter(Node *);
-static void	freetr(Node *);
-static void	overflo(char *);
-static void	cfoll(fa *, Node *);
-static void	follow(Node *);
-static Node	*reparse(uchar *);
-static int	relex(void);
-static void	freefa(fa *);
-static int	cgoto(fa *, int, int);
-
-fa *
-makedfa(uchar *s, int anchor)	/* returns dfa for reg expr s */
-{
-	int i, use, nuse;
-	fa *pfa;
-
-	if (compile_time)	/* a constant for sure */
-		return (mkdfa(s, anchor));
-	for (i = 0; i < nfatab; i++) {	/* is it there already? */
-		if (fatab[i]->anchor == anchor &&
-		    strcmp((char *)fatab[i]->restr, (char *)s) == 0) {
-			fatab[i]->use++;
-			return (fatab[i]);
-		}
-	}
-	pfa = mkdfa(s, anchor);
-	if (nfatab < NFA) {	/* room for another */
-		fatab[nfatab] = pfa;
-		fatab[nfatab]->use = 1;
-		nfatab++;
-		return (pfa);
-	}
-	use = fatab[0]->use;	/* replace least-recently used */
-	nuse = 0;
-	for (i = 1; i < nfatab; i++)
-		if (fatab[i]->use < use) {
-			use = fatab[i]->use;
-			nuse = i;
-		}
-	freefa(fatab[nuse]);
-	fatab[nuse] = pfa;
-	pfa->use = 1;
-	return (pfa);
-}
-
-fa *
-mkdfa(uchar *s, int anchor)	/* does the real work of making a dfa */
-	/* anchor = 1 for anchored matches, else 0 */
-{
-	Node *p, *p1;
-	fa *f;
-
-	p = reparse(s);
-	p1 = op2(CAT, op2(STAR, op2(ALL, NIL, NIL), NIL), p);
-		/* put ALL STAR in front of reg.  exp. */
-	p1 = op2(CAT, p1, op2(FINAL, NIL, NIL));
-		/* put FINAL after reg.  exp. */
-
-	poscnt = 0;
-	penter(p1);	/* enter parent pointers and leaf indices */
-	if ((f = (fa *)calloc(1, sizeof (fa) + poscnt * sizeof (rrow))) == NULL)
-		overflo("no room for fa");
-	/* penter has computed number of positions in re */
-	f->accept = poscnt-1;
-	cfoll(f, p1);	/* set up follow sets */
-	freetr(p1);
-	if ((f->posns[0] =
-	    (int *)calloc(1, *(f->re[0].lfollow) * sizeof (int))) == NULL) {
-			overflo("out of space in makedfa");
-	}
-	if ((f->posns[1] = (int *)calloc(1, sizeof (int))) == NULL)
-		overflo("out of space in makedfa");
-	*f->posns[1] = 0;
-	f->initstat = makeinit(f, anchor);
-	f->anchor = anchor;
-	f->restr = tostring(s);
-	return (f);
-}
-
-static int
-makeinit(fa *f, int anchor)
-{
-	register int i, k;
-
-	f->curstat = 2;
-	f->out[2] = 0;
-	f->reset = 0;
-	k = *(f->re[0].lfollow);
-	xfree(f->posns[2]);
-	if ((f->posns[2] = (int *)calloc(1, (k+1) * sizeof (int))) == NULL)
-		overflo("out of space in makeinit");
-	for (i = 0; i <= k; i++) {
-		(f->posns[2])[i] = (f->re[0].lfollow)[i];
-	}
-	if ((f->posns[2])[1] == f->accept)
-		f->out[2] = 1;
-	for (i = 0; i < NCHARS; i++)
-		f->gototab[2][i] = 0;
-	f->curstat = cgoto(f, 2, HAT);
-	if (anchor) {
-		*f->posns[2] = k-1;	/* leave out position 0 */
-		for (i = 0; i < k; i++) {
-			(f->posns[0])[i] = (f->posns[2])[i];
-		}
-
-		f->out[0] = f->out[2];
-		if (f->curstat != 2)
-			--(*f->posns[f->curstat]);
-	}
-	return (f->curstat);
-}
-
-void
-penter(Node *p)	/* set up parent pointers and leaf indices */
-{
-	switch (type(p)) {
-	LEAF
-		left(p) = (Node *) poscnt;
-		point[poscnt++] = p;
-		break;
-	UNARY
-		penter(left(p));
-		parent(left(p)) = p;
-		break;
-	case CAT:
-	case OR:
-		penter(left(p));
-		penter(right(p));
-		parent(left(p)) = p;
-		parent(right(p)) = p;
-		break;
-	default:
-		ERROR "unknown type %d in penter", type(p) FATAL;
-		break;
-	}
-}
-
-static void
-freetr(Node *p)	/* free parse tree */
-{
-	switch (type(p)) {
-	LEAF
-		xfree(p);
-		break;
-	UNARY
-		freetr(left(p));
-		xfree(p);
-		break;
-	case CAT:
-	case OR:
-		freetr(left(p));
-		freetr(right(p));
-		xfree(p);
-		break;
-	default:
-		ERROR "unknown type %d in freetr", type(p) FATAL;
-		break;
-	}
-}
-
-uchar *
-cclenter(uchar *p)
-{
-	register int i, c;
-	uchar *op, *chars, *ret;
-	size_t	bsize;
-
-	init_buf(&chars, &bsize, LINE_INCR);
-	op = p;
-	i = 0;
-	while ((c = *p++) != 0) {
-		if (c == '\\') {
-			if ((c = *p++) == 't')
-				c = '\t';
-			else if (c == 'n')
-				c = '\n';
-			else if (c == 'f')
-				c = '\f';
-			else if (c == 'r')
-				c = '\r';
-			else if (c == 'b')
-				c = '\b';
-			else if (c == '\\')
-				c = '\\';
-			else if (isdigit(c)) {
-				int n = c - '0';
-				if (isdigit(*p)) {
-					n = 8 * n + *p++ - '0';
-					if (isdigit(*p))
-						n = 8 * n + *p++ - '0';
-				}
-				c = n;
-			} /* else */
-				/* c = c; */
-		} else if (c == '-' && i > 0 && chars[i-1] != 0) {
-			if (*p != 0) {
-				c = chars[i-1];
-				while ((uchar)c < *p) {	/* fails if *p is \\ */
-					expand_buf(&chars, &bsize, i);
-					chars[i++] = ++c;
-				}
-				p++;
-				continue;
-			}
-		}
-		expand_buf(&chars, &bsize, i);
-		chars[i++] = c;
-	}
-	chars[i++] = '\0';
-	dprintf(("cclenter: in = |%s|, out = |%s|\n", op, chars));
-	xfree(op);
-	ret = tostring(chars);
-	free(chars);
-	return (ret);
-}
-
-static void
-overflo(char *s)
-{
-	ERROR "regular expression too big: %s", gettext((char *)s) FATAL;
-}
-
-/* enter follow set of each leaf of vertex v into lfollow[leaf] */
-static void
-cfoll(fa *f, Node *v)
-{
-	register int i;
-	register int *p;
-
-	switch (type(v)) {
-	LEAF
-		f->re[(int)left(v)].ltype = type(v);
-		f->re[(int)left(v)].lval = (int)right(v);
-		for (i = 0; i <= f->accept; i++)
-			setvec[i] = 0;
-		setcnt = 0;
-		follow(v);	/* computes setvec and setcnt */
-		if ((p = (int *)calloc(1, (setcnt+1) * sizeof (int))) == NULL)
-			overflo("follow set overflow");
-		f->re[(int)left(v)].lfollow = p;
-		*p = setcnt;
-		for (i = f->accept; i >= 0; i--) {
-			if (setvec[i] == 1)
-				*++p = i;
-		}
-		break;
-	UNARY
-		cfoll(f, left(v));
-		break;
-	case CAT:
-	case OR:
-		cfoll(f, left(v));
-		cfoll(f, right(v));
-		break;
-	default:
-		ERROR "unknown type %d in cfoll", type(v) FATAL;
-	}
-}
-
-/*
- * collects initially active leaves of p into setvec
- * returns 0 or 1 depending on whether p matches empty string
- */
-static int
-first(Node *p)
-{
-	register int b;
-
-	switch (type(p)) {
-	LEAF
-		if (setvec[(int)left(p)] != 1) {
-			setvec[(int)left(p)] = 1;
-			setcnt++;
-		}
-		if (type(p) == CCL && (*(uchar *)right(p)) == '\0')
-			return (0);		/* empty CCL */
-		else
-			return (1);
-	case PLUS:
-		if (first(left(p)) == 0)
-			return (0);
-		return (1);
-	case STAR:
-	case QUEST:
-		(void) first(left(p));
-		return (0);
-	case CAT:
-		if (first(left(p)) == 0 && first(right(p)) == 0)
-			return (0);
-		return (1);
-	case OR:
-		b = first(right(p));
-		if (first(left(p)) == 0 || b == 0)
-			return (0);
-		return (1);
-	}
-	ERROR "unknown type %d in first", type(p) FATAL;
-	return (-1);
-}
-
-/* collects leaves that can follow v into setvec */
-static void
-follow(Node *v)
-{
-	Node *p;
-
-	if (type(v) == FINAL)
-		return;
-	p = parent(v);
-	switch (type(p)) {
-	case STAR:
-	case PLUS:
-		(void) first(v);
-		follow(p);
-		return;
-
-	case OR:
-	case QUEST:
-		follow(p);
-		return;
-
-	case CAT:
-		if (v == left(p)) {	/* v is left child of p */
-			if (first(right(p)) == 0) {
-				follow(p);
-				return;
-			}
-		} else		/* v is right child */
-			follow(p);
-		return;
-	default:
-		ERROR "unknown type %d in follow", type(p) FATAL;
-		break;
-	}
-}
-
-static int
-member(uchar c, uchar *s)	/* is c in s? */
-{
-	while (*s)
-		if (c == *s++)
-			return (1);
-	return (0);
-}
-
-
-int
-match(fa *f, uchar *p)
-{
-	register int s, ns;
-
-	s = f->reset ? makeinit(f, 0) : f->initstat;
-	if (f->out[s])
-		return (1);
-	do {
-		if ((ns = f->gototab[s][*p]) != 0)
-			s = ns;
-		else
-			s = cgoto(f, s, *p);
-		if (f->out[s])
-			return (1);
-	} while (*p++ != 0);
-	return (0);
-}
-
-int
-pmatch(fa *f, uchar *p)
-{
-	register int s, ns;
-	register uchar *q;
-	int i, k;
-
-	if (f->reset) {
-		f->initstat = s = makeinit(f, 1);
-	} else {
-		s = f->initstat;
-	}
-	patbeg = p;
-	patlen = -1;
-	do {
-		q = p;
-		do {
-			if (f->out[s])		/* final state */
-				patlen = q-p;
-			if ((ns = f->gototab[s][*q]) != 0)
-				s = ns;
-			else
-				s = cgoto(f, s, *q);
-			if (s == 1) {	/* no transition */
-				if (patlen >= 0) {
-					patbeg = p;
-					return (1);
-				} else
-					goto nextin;	/* no match */
-			}
-		} while (*q++ != 0);
-		if (f->out[s])
-			patlen = q - p - 1;	/* don't count $ */
-		if (patlen >= 0) {
-			patbeg = p;
-			return (1);
-		}
-	nextin:
-		s = 2;
-		if (f->reset) {
-			for (i = 2; i <= f->curstat; i++)
-				xfree(f->posns[i]);
-			k = *f->posns[0];
-			if ((f->posns[2] =
-			    (int *)calloc(1, (k + 1) * sizeof (int))) == NULL) {
-				overflo("out of space in pmatch");
-			}
-			for (i = 0; i <= k; i++)
-				(f->posns[2])[i] = (f->posns[0])[i];
-			f->initstat = f->curstat = 2;
-			f->out[2] = f->out[0];
-			for (i = 0; i < NCHARS; i++)
-				f->gototab[2][i] = 0;
-		}
-	} while (*p++ != 0);
-	return (0);
-}
-
-int
-nematch(fa *f, uchar *p)
-{
-	register int s, ns;
-	register uchar *q;
-	int i, k;
-
-	if (f->reset) {
-		f->initstat = s = makeinit(f, 1);
-	} else {
-		s = f->initstat;
-	}
-	patlen = -1;
-	while (*p) {
-		q = p;
-		do {
-			if (f->out[s])		/* final state */
-				patlen = q-p;
-			if ((ns = f->gototab[s][*q]) != 0)
-				s = ns;
-			else
-				s = cgoto(f, s, *q);
-			if (s == 1) {	/* no transition */
-				if (patlen > 0) {
-					patbeg = p;
-					return (1);
-				} else
-					goto nnextin;	/* no nonempty match */
-			}
-		} while (*q++ != 0);
-		if (f->out[s])
-			patlen = q - p - 1;	/* don't count $ */
-		if (patlen > 0) {
-			patbeg = p;
-			return (1);
-		}
-	nnextin:
-		s = 2;
-		if (f->reset) {
-			for (i = 2; i <= f->curstat; i++)
-				xfree(f->posns[i]);
-			k = *f->posns[0];
-			if ((f->posns[2] =
-			    (int *)calloc(1, (k + 1) * sizeof (int))) == NULL) {
-				overflo("out of state space");
-			}
-			for (i = 0; i <= k; i++)
-				(f->posns[2])[i] = (f->posns[0])[i];
-			f->initstat = f->curstat = 2;
-			f->out[2] = f->out[0];
-			for (i = 0; i < NCHARS; i++)
-				f->gototab[2][i] = 0;
-		}
-		p++;
-	}
-	return (0);
-}
-
-static Node *regexp(void), *primary(void), *concat(Node *);
-static Node *alt(Node *), *unary(Node *);
-
-static Node *
-reparse(uchar *p)
-{
-	/* parses regular expression pointed to by p */
-	/* uses relex() to scan regular expression */
-	Node *np;
-
-	dprintf(("reparse <%s>\n", p));
-	lastre = prestr = p;	/* prestr points to string to be parsed */
-	rtok = relex();
-	if (rtok == '\0')
-		ERROR "empty regular expression" FATAL;
-	np = regexp();
-	if (rtok == '\0') {
-		return (np);
-	} else {
-		ERROR "syntax error in regular expression %s at %s",
-		    lastre, prestr FATAL;
-	}
-	/*NOTREACHED*/
-	return (NULL);
-}
-
-static Node *
-regexp(void)
-{
-	return (alt(concat(primary())));
-}
-
-static Node *
-primary(void)
-{
-	Node *np;
-
-	switch (rtok) {
-	case CHAR:
-		np = op2(CHAR, NIL, (Node *)rlxval);
-		rtok = relex();
-		return (unary(np));
-	case ALL:
-		rtok = relex();
-		return (unary(op2(ALL, NIL, NIL)));
-	case DOT:
-		rtok = relex();
-		return (unary(op2(DOT, NIL, NIL)));
-	case CCL:
-		/*LINTED align*/
-		np = op2(CCL, NIL, (Node *)cclenter(rlxstr));
-		rtok = relex();
-		return (unary(np));
-	case NCCL:
-		/*LINTED align*/
-		np = op2(NCCL, NIL, (Node *)cclenter(rlxstr));
-		rtok = relex();
-		return (unary(np));
-	case '^':
-		rtok = relex();
-		return (unary(op2(CHAR, NIL, (Node *)HAT)));
-	case '$':
-		rtok = relex();
-		return (unary(op2(CHAR, NIL, NIL)));
-	case '(':
-		rtok = relex();
-		if (rtok == ')') {	/* special pleading for () */
-			rtok = relex();
-			return (unary(op2(CCL, NIL,
-			    /*LINTED align*/
-			    (Node *)tostring((uchar *)""))));
-		}
-		np = regexp();
-		if (rtok == ')') {
-			rtok = relex();
-			return (unary(np));
-		} else {
-			ERROR "syntax error in regular expression %s at %s",
-			    lastre, prestr FATAL;
-		}
-	default:
-		ERROR "illegal primary in regular expression %s at %s",
-		    lastre, prestr FATAL;
-	}
-	/*NOTREACHED*/
-	return (NULL);
-}
-
-static Node *
-concat(Node *np)
-{
-	switch (rtok) {
-	case CHAR: case DOT: case ALL: case CCL: case NCCL: case '$': case '(':
-		return (concat(op2(CAT, np, primary())));
-	default:
-		return (np);
-	}
-}
-
-static Node *
-alt(Node *np)
-{
-	if (rtok == OR) {
-		rtok = relex();
-		return (alt(op2(OR, np, concat(primary()))));
-	}
-	return (np);
-}
-
-static Node *
-unary(Node *np)
-{
-	switch (rtok) {
-	case STAR:
-		rtok = relex();
-		return (unary(op2(STAR, np, NIL)));
-	case PLUS:
-		rtok = relex();
-		return (unary(op2(PLUS, np, NIL)));
-	case QUEST:
-		rtok = relex();
-		return (unary(op2(QUEST, np, NIL)));
-	default:
-		return (np);
-	}
-}
-
-static int
-relex(void)		/* lexical analyzer for reparse */
-{
-	register int c;
-	uchar *cbuf;
-	int clen, cflag;
-
-	switch (c = *prestr++) {
-	case '|': return OR;
-	case '*': return STAR;
-	case '+': return PLUS;
-	case '?': return QUEST;
-	case '.': return DOT;
-	case '\0': prestr--; return '\0';
-	case '^':
-	case '$':
-	case '(':
-	case ')':
-		return (c);
-	case '\\':
-		if ((c = *prestr++) == 't')
-			c = '\t';
-		else if (c == 'n')
-			c = '\n';
-		else if (c == 'f')
-			c = '\f';
-		else if (c == 'r')
-			c = '\r';
-		else if (c == 'b')
-			c = '\b';
-		else if (c == '\\')
-			c = '\\';
-		else if (isdigit(c)) {
-			int n = c - '0';
-			if (isdigit(*prestr)) {
-				n = 8 * n + *prestr++ - '0';
-				if (isdigit(*prestr))
-					n = 8 * n + *prestr++ - '0';
-			}
-			c = n;
-		} /* else it's now in c */
-		rlxval = c;
-		return (CHAR);
-	default:
-		rlxval = c;
-		return (CHAR);
-	case '[':
-		clen = 0;
-		if (*prestr == '^') {
-			cflag = 1;
-			prestr++;
-		} else
-			cflag = 0;
-		init_buf(&cbuf, NULL, strlen((char *)prestr) * 2 + 1);
-		for (;;) {
-			if ((c = *prestr++) == '\\') {
-				cbuf[clen++] = '\\';
-				if ((c = *prestr++) == '\0') {
-					ERROR
-			"nonterminated character class %s", lastre FATAL;
-				}
-				cbuf[clen++] = c;
-			} else if (c == ']') {
-				cbuf[clen] = 0;
-				rlxstr = tostring(cbuf);
-				free(cbuf);
-				if (cflag == 0)
-					return (CCL);
-				else
-					return (NCCL);
-			} else if (c == '\n') {
-				ERROR "newline in character class %s...",
-				    lastre FATAL;
-			} else if (c == '\0') {
-				ERROR "nonterminated character class %s",
-				    lastre FATAL;
-			} else
-				cbuf[clen++] = c;
-		}
-		/*NOTREACHED*/
-	}
-	return (0);
-}
-
-static int
-cgoto(fa *f, int s, int c)
-{
-	register int i, j, k;
-	register int *p, *q;
-
-	for (i = 0; i <= f->accept; i++)
-		setvec[i] = 0;
-	setcnt = 0;
-	/* compute positions of gototab[s,c] into setvec */
-	p = f->posns[s];
-	for (i = 1; i <= *p; i++) {
-		if ((k = f->re[p[i]].ltype) != FINAL) {
-			if (k == CHAR && c == f->re[p[i]].lval ||
-			    k == DOT && c != 0 && c != HAT ||
-			    k == ALL && c != 0 ||
-			    k == CCL &&
-			    member(c, (uchar *)f->re[p[i]].lval) ||
-			    k == NCCL &&
-			    !member(c, (uchar *)f->re[p[i]].lval) &&
-			    c != 0 && c != HAT) {
-				q = f->re[p[i]].lfollow;
-				for (j = 1; j <= *q; j++) {
-					if (setvec[q[j]] == 0) {
-						setcnt++;
-						setvec[q[j]] = 1;
-					}
-				}
-			}
-		}
-	}
-	/* determine if setvec is a previous state */
-	tmpset[0] = setcnt;
-	j = 1;
-	for (i = f->accept; i >= 0; i--)
-		if (setvec[i]) {
-			tmpset[j++] = i;
-		}
-	/* tmpset == previous state? */
-	for (i = 1; i <= f->curstat; i++) {
-		p = f->posns[i];
-		if ((k = tmpset[0]) != p[0])
-			goto different;
-		for (j = 1; j <= k; j++)
-			if (tmpset[j] != p[j])
-				goto different;
-		/* setvec is state i */
-		f->gototab[s][c] = i;
-		return (i);
-	different:;
-	}
-
-	/* add tmpset to current set of states */
-	if (f->curstat >= NSTATES-1) {
-		f->curstat = 2;
-		f->reset = 1;
-		for (i = 2; i < NSTATES; i++)
-			xfree(f->posns[i]);
-	} else
-		++(f->curstat);
-	for (i = 0; i < NCHARS; i++)
-		f->gototab[f->curstat][i] = 0;
-	xfree(f->posns[f->curstat]);
-	if ((p = (int *)calloc(1, (setcnt + 1) * sizeof (int))) == NULL)
-		overflo("out of space in cgoto");
-
-	f->posns[f->curstat] = p;
-	f->gototab[s][c] = f->curstat;
-	for (i = 0; i <= setcnt; i++)
-		p[i] = tmpset[i];
-	if (setvec[f->accept])
-		f->out[f->curstat] = 1;
-	else
-		f->out[f->curstat] = 0;
-	return (f->curstat);
-}
-
-static void
-freefa(fa *f)
-{
-
-	register int i;
-
-	if (f == NULL)
-		return;
-	for (i = 0; i <= f->curstat; i++)
-		xfree(f->posns[i]);
-	for (i = 0; i <= f->accept; i++)
-		xfree(f->re[i].lfollow);
-	xfree(f->restr);
-	xfree(f);
-}
--- old/usr/src/cmd/awk/lib.c	2013-05-27 09:45:03.304065967 +0000
+++ /dev/null	2013-05-27 09:45:03.000000000 +0000
@@ -1,795 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include <errno.h>
-#include "awk.h"
-#include "y.tab.h"
-
-uchar	*record;
-size_t	record_size;
-
-int	donefld;	/* 1 = implies rec broken into fields */
-int	donerec;	/* 1 = record is valid (no flds have changed) */
-
-static struct fldtab_chunk {
-	struct fldtab_chunk	*next;
-	Cell			fields[FLD_INCR];
-} *fldtab_head, *fldtab_tail;
-
-static	size_t	fldtab_maxidx;
-
-static FILE	*infile	= NULL;
-static uchar	*file	= (uchar*) "";
-static uchar	*fields;
-static size_t	fields_size = LINE_INCR;
-
-static int	maxfld	= 0;	/* last used field */
-static int	argno	= 1;	/* current input argument number */
-
-static	uchar	*getargv(int);
-static	void	cleanfld(int, int);
-static	int	refldbld(uchar *, uchar *);
-static	void	bcheck2(int, int, int);
-static	void	eprint(void);
-static	void	bclass(int);
-
-static void
-initgetrec(void)
-{
-	int i;
-	uchar *p;
-
-	for (i = 1; i < *ARGC; i++) {
-		if (!isclvar(p = getargv(i)))	/* find 1st real filename */
-			return;
-		setclvar(p);	/* a commandline assignment before filename */
-		argno++;
-	}
-	infile = stdin;		/* no filenames, so use stdin */
-	/* *FILENAME = file = (uchar*) "-"; */
-}
-
-int
-getrec(uchar **bufp, size_t *bufsizep)
-{
-	int c;
-	static int firsttime = 1;
-	uchar_t	*buf, *nbuf;
-	size_t	len;
-
-	if (firsttime) {
-		firsttime = 0;
-		initgetrec();
-	}
-	dprintf(("RS=<%s>, FS=<%s>, ARGC=%f, FILENAME=%s\n",
-	    *RS, *FS, *ARGC, *FILENAME));
-	donefld = 0;
-	donerec = 1;
-	while (argno < *ARGC || infile == stdin) {
-		dprintf(("argno=%d, file=|%s|\n", argno, file));
-		if (infile == NULL) {	/* have to open a new file */
-			file = getargv(argno);
-			if (*file == '\0') {	/* it's been zapped */
-				argno++;
-				continue;
-			}
-			if (isclvar(file)) {	/* a var=value arg */
-				setclvar(file);
-				argno++;
-				continue;
-			}
-			*FILENAME = file;
-			dprintf(("opening file %s\n", file));
-			if (*file == '-' && *(file+1) == '\0')
-				infile = stdin;
-			else if ((infile = fopen((char *)file, "r")) == NULL)
-				ERROR "can't open file %s", file FATAL;
-			(void) setfval(fnrloc, 0.0);
-		}
-		c = readrec(&nbuf, &len, infile);
-		expand_buf(bufp, bufsizep, len);
-		buf = *bufp;
-		(void) memcpy(buf, nbuf, len);
-		buf[len] = '\0';
-		free(nbuf);
-
-		if (c != 0 || buf[0] != '\0') {	/* normal record */
-			if (bufp == &record) {
-				if (!(recloc->tval & DONTFREE))
-					xfree(recloc->sval);
-				recloc->sval = record;
-				recloc->tval = REC | STR | DONTFREE;
-				if (is_number(recloc->sval)) {
-					recloc->fval =
-					    atof((const char *)recloc->sval);
-					recloc->tval |= NUM;
-				}
-			}
-			(void) setfval(nrloc, nrloc->fval+1);
-			(void) setfval(fnrloc, fnrloc->fval+1);
-			return (1);
-		}
-		/* EOF arrived on this file; set up next */
-		if (infile != stdin)
-			(void) fclose(infile);
-		infile = NULL;
-		argno++;
-	}
-	return (0);	/* true end of file */
-}
-
-int
-readrec(uchar **bufp, size_t *sizep, FILE *inf)	/* read one record into buf */
-{
-	int sep, c;
-	uchar	*buf;
-	int	count;
-	size_t	bufsize;
-
-	init_buf(&buf, &bufsize, LINE_INCR);
-	if ((sep = **RS) == 0) {
-		sep = '\n';
-		/* skip leading \n's */
-		while ((c = getc(inf)) == '\n' && c != EOF)
-			;
-		if (c != EOF)
-			(void) ungetc(c, inf);
-	}
-	count = 0;
-	for (;;) {
-		while ((c = getc(inf)) != sep && c != EOF) {
-			expand_buf(&buf, &bufsize, count);
-			buf[count++] = c;
-		}
-		if (**RS == sep || c == EOF)
-			break;
-		if ((c = getc(inf)) == '\n' || c == EOF) /* 2 in a row */
-			break;
-		expand_buf(&buf, &bufsize, count + 1);
-		buf[count++] = '\n';
-		buf[count++] = c;
-	}
-	buf[count] = '\0';
-	dprintf(("readrec saw <%s>, returns %d\n",
-	    buf, c == EOF && count == 0 ? 0 : 1));
-	*bufp = buf;
-	*sizep = count;
-	return (c == EOF && count == 0 ? 0 : 1);
-}
-
-/* get ARGV[n] */
-static uchar *
-getargv(int n)
-{
-	Cell *x;
-	uchar *s, temp[11];
-	extern Array *ARGVtab;
-
-	(void) sprintf((char *)temp, "%d", n);
-	x = setsymtab(temp, (uchar *)"", 0.0, STR, ARGVtab);
-	s = getsval(x);
-	dprintf(("getargv(%d) returns |%s|\n", n, s));
-	return (s);
-}
-
-void
-setclvar(uchar *s)	/* set var=value from s */
-{
-	uchar *p;
-	Cell *q;
-
-	for (p = s; *p != '='; p++)
-		;
-	*p++ = 0;
-	p = qstring(p, '\0');
-	q = setsymtab(s, p, 0.0, STR, symtab);
-	(void) setsval(q, p);
-	if (is_number(q->sval)) {
-		q->fval = atof((const char *)q->sval);
-		q->tval |= NUM;
-	}
-	dprintf(("command line set %s to |%s|\n", s, p));
-	free(p);
-}
-
-void
-fldbld(void)
-{
-	uchar *r, *fr, sep;
-	Cell *p;
-	int i;
-	size_t	len;
-
-	if (donefld)
-		return;
-	if (!(recloc->tval & STR))
-		(void) getsval(recloc);
-	r = recloc->sval;	/* was record! */
-
-	/* make sure fields is always allocated */
-	adjust_buf(&fields, fields_size);
-
-	/*
-	 * make sure fields has enough size. We don't expand the buffer
-	 * in the middle of the loop, since p->sval has already pointed
-	 * the address in the fields.
-	 */
-	len = strlen((char *)r) + 1;
-	expand_buf(&fields, &fields_size, len);
-	fr = fields;
-
-	i = 0;	/* number of fields accumulated here */
-	if (strlen((char *)*FS) > 1) {	/* it's a regular expression */
-		i = refldbld(r, *FS);
-	} else if ((sep = **FS) == ' ') {
-		for (i = 0; ; ) {
-			while (*r == ' ' || *r == '\t' || *r == '\n')
-				r++;
-			if (*r == 0)
-				break;
-			i++;
-			p = getfld(i);
-			if (!(p->tval & DONTFREE))
-				xfree(p->sval);
-			p->sval = fr;
-			p->tval = FLD | STR | DONTFREE;
-			do
-				*fr++ = *r++;
-			while (*r != ' ' && *r != '\t' && *r != '\n' &&
-			    *r != '\0')
-				;
-			*fr++ = 0;
-		}
-		*fr = 0;
-	} else if (*r != 0) {	/* if 0, it's a null field */
-		for (;;) {
-			i++;
-			p = getfld(i);
-			if (!(p->tval & DONTFREE))
-				xfree(p->sval);
-			p->sval = fr;
-			p->tval = FLD | STR | DONTFREE;
-			/* \n always a separator */
-			while (*r != sep && *r != '\n' && *r != '\0')
-				*fr++ = *r++;
-			*fr++ = 0;
-			if (*r++ == 0)
-				break;
-		}
-		*fr = 0;
-	}
-	/* clean out junk from previous record */
-	cleanfld(i, maxfld);
-	maxfld = i;
-	donefld = 1;
-	for (i = 1; i <= maxfld; i++) {
-		p = getfld(i);
-		if (is_number(p->sval)) {
-			p->fval = atof((const char *)p->sval);
-			p->tval |= NUM;
-		}
-	}
-
-	(void) setfval(nfloc, (Awkfloat) maxfld);
-	if (dbg) {
-		for (i = 0; i <= maxfld; i++) {
-			p = getfld(i);
-			(void) printf("field %d: |%s|\n", i, p->sval);
-		}
-	}
-}
-
-static void
-cleanfld(int n1, int n2)	/* clean out fields n1..n2 inclusive */
-{
-	static uchar *nullstat = (uchar *) "";
-	Cell *p;
-	int	i;
-
-	for (i = n2; i > n1; i--) {
-		p = getfld(i);
-		if (!(p->tval & DONTFREE))
-			xfree(p->sval);
-		p->tval = FLD | STR | DONTFREE;
-		p->sval = nullstat;
-	}
-}
-
-void
-newfld(int n)	/* add field n (after end) */
-{
-	if (n < 0)
-		ERROR "accessing invalid field", record FATAL;
-	(void) getfld(n);
-	cleanfld(maxfld, n);
-	maxfld = n;
-	(void) setfval(nfloc, (Awkfloat) n);
-}
-
-/*
- * allocate field table. We don't reallocate the table since there
- * might be somewhere recording the address of the table.
- */
-static void
-morefld(void)
-{
-	int	i;
-	struct fldtab_chunk *fldcp;
-	Cell	*newfld;
-
-	if ((fldcp = calloc(sizeof (struct fldtab_chunk), 1)) == NULL)
-		ERROR "out of space in morefld" FATAL;
-
-	newfld = &fldcp->fields[0];
-	for (i = 0; i < FLD_INCR; i++) {
-		newfld[i].ctype = OCELL;
-		newfld[i].csub = CFLD;
-		newfld[i].nval = NULL;
-		newfld[i].sval = (uchar *)"";
-		newfld[i].fval = 0.0;
-		newfld[i].tval = FLD|STR|DONTFREE;
-		newfld[i].cnext = NULL;
-	}
-	/*
-	 * link this field chunk
-	 */
-	if (fldtab_head == NULL)
-		fldtab_head = fldcp;
-	else
-		fldtab_tail->next = fldcp;
-	fldtab_tail = fldcp;
-	fldcp->next = NULL;
-
-	fldtab_maxidx += FLD_INCR;
-}
-
-Cell *
-getfld(int idx)
-{
-	struct fldtab_chunk *fldcp;
-	int	cbase;
-
-	if (idx < 0)
-		ERROR "trying to access field %d", idx FATAL;
-	while (idx >= fldtab_maxidx)
-		morefld();
-	cbase = 0;
-	for (fldcp = fldtab_head; fldcp != NULL; fldcp = fldcp->next) {
-		if (idx < (cbase + FLD_INCR))
-			return (&fldcp->fields[idx - cbase]);
-		cbase += FLD_INCR;
-	}
-	/* should never happen */
-	ERROR "trying to access invalid field %d", idx FATAL;
-	return (NULL);
-}
-
-int
-fldidx(Cell *vp)
-{
-	struct fldtab_chunk *fldcp;
-	Cell	*tbl;
-	int	cbase;
-
-	cbase = 0;
-	for (fldcp = fldtab_head; fldcp != NULL; fldcp = fldcp->next) {
-		tbl = &fldcp->fields[0];
-		if (vp >= tbl && vp < (tbl + FLD_INCR))
-			return (cbase + (vp - tbl));
-		cbase += FLD_INCR;
-	}
-	/* should never happen */
-	ERROR "trying to access unknown field" FATAL;
-	return (0);
-}
-
-static int
-refldbld(uchar *rec, uchar *fs)	/* build fields from reg expr in FS */
-{
-	uchar *fr;
-	int i, tempstat;
-	fa *pfa;
-	Cell	*p;
-	size_t	len;
-
-	/* make sure fields is allocated */
-	adjust_buf(&fields, fields_size);
-	fr = fields;
-	*fr = '\0';
-	if (*rec == '\0')
-		return (0);
-
-	len = strlen((char *)rec) + 1;
-	expand_buf(&fields, &fields_size, len);
-	fr = fields;
-
-	pfa = makedfa(fs, 1);
-	dprintf(("into refldbld, rec = <%s>, pat = <%s>\n", rec, fs));
-	tempstat = pfa->initstat;
-	for (i = 1; ; i++) {
-		p = getfld(i);
-		if (!(p->tval & DONTFREE))
-			xfree(p->sval);
-		p->tval = FLD | STR | DONTFREE;
-		p->sval = fr;
-		dprintf(("refldbld: i=%d\n", i));
-		if (nematch(pfa, rec)) {
-			pfa->initstat = 2;
-			dprintf(("match %s (%d chars)\n", patbeg, patlen));
-			(void) strncpy((char *)fr, (char *)rec, patbeg-rec);
-			fr += patbeg - rec + 1;
-			*(fr-1) = '\0';
-			rec = patbeg + patlen;
-		} else {
-			dprintf(("no match %s\n", rec));
-			(void) strcpy((char *)fr, (char *)rec);
-			pfa->initstat = tempstat;
-			break;
-		}
-	}
-	return (i);
-}
-
-void
-recbld(void)
-{
-	int i;
-	uchar *p;
-	size_t cnt, len, olen;
-
-	if (donerec == 1)
-		return;
-	cnt = 0;
-	olen = strlen((char *)*OFS);
-	for (i = 1; i <= *NF; i++) {
-		p = getsval(getfld(i));
-		len = strlen((char *)p);
-		expand_buf(&record, &record_size, cnt + len + olen);
-		(void) memcpy(&record[cnt], p, len);
-		cnt += len;
-		if (i < *NF) {
-			(void) memcpy(&record[cnt], *OFS, olen);
-			cnt += olen;
-		}
-	}
-	record[cnt] = '\0';
-	dprintf(("in recbld FS=%o, recloc=%p\n", **FS, (void *)recloc));
-	if (!(recloc->tval & DONTFREE))
-		xfree(recloc->sval);
-	recloc->tval = REC | STR | DONTFREE;
-	recloc->sval = record;
-	dprintf(("in recbld FS=%o, recloc=%p\n", **FS, (void *)recloc));
-	dprintf(("recbld = |%s|\n", record));
-	donerec = 1;
-}
-
-Cell *
-fieldadr(int n)
-{
-	if (n < 0)
-		ERROR "trying to access field %d", n FATAL;
-	return (getfld(n));
-}
-
-int	errorflag	= 0;
-char	errbuf[200];
-
-void
-yyerror(char *s)
-{
-	extern uchar *cmdname, *curfname;
-	static int been_here = 0;
-
-	if (been_here++ > 2)
-		return;
-	(void) fprintf(stderr, "%s: %s", cmdname, s);
-	(void) fprintf(stderr, gettext(" at source line %lld"), lineno);
-	if (curfname != NULL)
-		(void) fprintf(stderr, gettext(" in function %s"), curfname);
-	(void) fprintf(stderr, "\n");
-	errorflag = 2;
-	eprint();
-}
-
-/*ARGSUSED*/
-void
-fpecatch(int sig)
-{
-	ERROR "floating point exception" FATAL;
-}
-
-extern int bracecnt, brackcnt, parencnt;
-
-void
-bracecheck(void)
-{
-	int c;
-	static int beenhere = 0;
-
-	if (beenhere++)
-		return;
-	while ((c = input()) != EOF && c != '\0')
-		bclass(c);
-	bcheck2(bracecnt, '{', '}');
-	bcheck2(brackcnt, '[', ']');
-	bcheck2(parencnt, '(', ')');
-}
-
-/*ARGSUSED*/
-static void
-bcheck2(int n, int c1, int c2)
-{
-	if (n == 1)
-		(void) fprintf(stderr, gettext("\tmissing %c\n"), c2);
-	else if (n > 1)
-		(void) fprintf(stderr, gettext("\t%d missing %c's\n"), n, c2);
-	else if (n == -1)
-		(void) fprintf(stderr, gettext("\textra %c\n"), c2);
-	else if (n < -1)
-		(void) fprintf(stderr, gettext("\t%d extra %c's\n"), -n, c2);
-}
-
-void
-error(int f, char *s)
-{
-	extern Node *curnode;
-	extern uchar *cmdname;
-
-	(void) fflush(stdout);
-	(void) fprintf(stderr, "%s: ", cmdname);
-	(void) fprintf(stderr, "%s", s);
-	(void) fprintf(stderr, "\n");
-	if (compile_time != 2 && NR && *NR > 0) {
-		(void) fprintf(stderr,
-		    gettext(" input record number %g"), *FNR);
-		if (strcmp((char *)*FILENAME, "-") != 0)
-			(void) fprintf(stderr, gettext(", file %s"), *FILENAME);
-		(void) fprintf(stderr, "\n");
-	}
-	if (compile_time != 2 && curnode)
-		(void) fprintf(stderr, gettext(" source line number %lld\n"),
-		    curnode->lineno);
-	else if (compile_time != 2 && lineno) {
-		(void) fprintf(stderr,
-		    gettext(" source line number %lld\n"), lineno);
-	}
-	eprint();
-	if (f) {
-		if (dbg)
-			abort();
-		exit(2);
-	}
-}
-
-static void
-eprint(void)	/* try to print context around error */
-{
-	uchar *p, *q;
-	int c;
-	static int been_here = 0;
-	extern uchar ebuf[300], *ep;
-
-	if (compile_time == 2 || compile_time == 0 || been_here++ > 0)
-		return;
-	p = ep - 1;
-	if (p > ebuf && *p == '\n')
-		p--;
-	for (; p > ebuf && *p != '\n' && *p != '\0'; p--)
-		;
-	while (*p == '\n')
-		p++;
-	(void) fprintf(stderr, gettext(" context is\n\t"));
-	for (q = ep-1; q >= p && *q != ' ' && *q != '\t' && *q != '\n'; q--)
-		;
-	for (; p < q; p++)
-		if (*p)
-			(void) putc(*p, stderr);
-	(void) fprintf(stderr, " >>> ");
-	for (; p < ep; p++)
-		if (*p)
-			(void) putc(*p, stderr);
-	(void) fprintf(stderr, " <<< ");
-	if (*ep)
-		while ((c = input()) != '\n' && c != '\0' && c != EOF) {
-			(void) putc(c, stderr);
-			bclass(c);
-		}
-	(void) putc('\n', stderr);
-	ep = ebuf;
-}
-
-static void
-bclass(int c)
-{
-	switch (c) {
-	case '{': bracecnt++; break;
-	case '}': bracecnt--; break;
-	case '[': brackcnt++; break;
-	case ']': brackcnt--; break;
-	case '(': parencnt++; break;
-	case ')': parencnt--; break;
-	}
-}
-
-double
-errcheck(double x, char *s)
-{
-	extern int errno;
-
-	if (errno == EDOM) {
-		errno = 0;
-		ERROR "%s argument out of domain", s WARNING;
-		x = 1;
-	} else if (errno == ERANGE) {
-		errno = 0;
-		ERROR "%s result out of range", s WARNING;
-		x = 1;
-	}
-	return (x);
-}
-
-void
-PUTS(uchar *s)
-{
-	dprintf(("%s\n", s));
-}
-
-int
-isclvar(uchar *s)	/* is s of form var=something? */
-{
-	if (s != NULL) {
-
-		/* Must begin with an underscore or alphabetic character */
-		if (isalpha(*s) || (*s == '_')) {
-
-			for (s++; *s; s++) {
-				/*
-				 * followed by a sequence of underscores,
-				 * digits, and alphabetics
-				 */
-				if (!(isalnum(*s) || *s == '_')) {
-					break;
-				}
-			}
-			return (*s == '=' && *(s + 1) != '=');
-		}
-	}
-
-	return (0);
-}
-
-#define	MAXEXPON	38	/* maximum exponent for fp number */
-
-int
-is_number(uchar *s)
-{
-	int d1, d2;
-	int point;
-	uchar *es;
-	extern char	radixpoint;
-
-	d1 = d2 = point = 0;
-	while (*s == ' ' || *s == '\t' || *s == '\n')
-		s++;
-	if (*s == '\0')
-		return (0);	/* empty stuff isn't number */
-	if (*s == '+' || *s == '-')
-		s++;
-	if (!isdigit(*s) && *s != radixpoint)
-		return (0);
-	if (isdigit(*s)) {
-		do {
-			d1++;
-			s++;
-		} while (isdigit(*s));
-	}
-	if (d1 >= MAXEXPON)
-		return (0);	/* too many digits to convert */
-	if (*s == radixpoint) {
-		point++;
-		s++;
-	}
-	if (isdigit(*s)) {
-		d2++;
-		do {
-			s++;
-		} while (isdigit(*s));
-	}
-	if (!(d1 || point && d2))
-		return (0);
-	if (*s == 'e' || *s == 'E') {
-		s++;
-		if (*s == '+' || *s == '-')
-			s++;
-		if (!isdigit(*s))
-			return (0);
-		es = s;
-		do {
-			s++;
-		} while (isdigit(*s));
-		if (s - es > 2) {
-			return (0);
-		} else if (s - es == 2 &&
-		    (int)(10 * (*es-'0') + *(es+1)-'0') >= MAXEXPON) {
-			return (0);
-		}
-	}
-	while (*s == ' ' || *s == '\t' || *s == '\n')
-		s++;
-	if (*s == '\0')
-		return (1);
-	else
-		return (0);
-}
-
-void
-init_buf(uchar **optr, size_t *sizep, size_t amt)
-{
-	uchar	*nptr = NULL;
-
-	if ((nptr = malloc(amt)) == NULL)
-		ERROR "out of space in init_buf" FATAL;
-	/* initial buffer should have NULL terminated */
-	*nptr = '\0';
-	if (sizep != NULL)
-		*sizep = amt;
-	*optr = nptr;
-}
-
-void
-r_expand_buf(uchar **optr, size_t *sizep, size_t req)
-{
-	uchar	*nptr;
-	size_t	amt, size = *sizep;
-
-	if (size != 0 && req < (size - 1))
-		return;
-	amt = req + 1 - size;
-	amt = (amt / LINE_INCR + 1) * LINE_INCR;
-
-	if ((nptr = realloc(*optr, size + amt)) == NULL)
-		ERROR "out of space in expand_buf" FATAL;
-	/* initial buffer should have NULL terminated */
-	if (size == 0)
-		*nptr = '\0';
-	*sizep += amt;
-	*optr = nptr;
-}
-
-void
-adjust_buf(uchar **optr, size_t size)
-{
-	uchar	*nptr;
-
-	if ((nptr = realloc(*optr, size)) == NULL)
-		ERROR "out of space in adjust_buf" FATAL;
-	*optr = nptr;
-}
--- old/usr/src/cmd/awk/main.c	2013-05-27 09:45:03.426469497 +0000
+++ /dev/null	2013-05-27 09:45:03.000000000 +0000
@@ -1,197 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#include <locale.h>
-#include <libintl.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <values.h>
-#include <langinfo.h>
-#include "awk.h"
-#include "y.tab.h"
-
-char	*version = "version Oct 11, 1989";
-
-int	dbg	= 0;
-uchar	*cmdname;	/* gets argv[0] for error messages */
-uchar	*lexprog;	/* points to program argument if it exists */
-int	compile_time = 2;	/* for error printing: */
-				/* 2 = cmdline, 1 = compile, 0 = running */
-char	radixpoint = '.';
-
-static uchar	**pfile = NULL;	/* program filenames from -f's */
-static int	npfile = 0;	/* number of filenames */
-static int	curpfile = 0;	/* current filename */
-
-int
-main(int argc, char *argv[], char *envp[])
-{
-	uchar *fs = NULL;
-	char	*nl_radix;
-	/*
-	 * At this point, numbers are still scanned as in
-	 * the POSIX locale.
-	 * (POSIX.2, volume 2, P867, L4742-4757)
-	 */
-	(void) setlocale(LC_ALL, "");
-	(void) setlocale(LC_NUMERIC, "C");
-#if !defined(TEXT_DOMAIN)	/* Should be defined by cc -D */
-#define	TEXT_DOMAIN	"SYS_TEST"	/* Use this only if it weren't */
-#endif
-	(void) textdomain(TEXT_DOMAIN);
-	cmdname = (uchar *)argv[0];
-	if (argc == 1) {
-		(void) fprintf(stderr, gettext(
-		    "Usage: %s [-f programfile | 'program'] [-Ffieldsep] "
-		    "[-v var=value] [files]\n"), cmdname);
-		exit(1);
-	}
-	(void) signal(SIGFPE, fpecatch);
-	yyin = NULL;
-	syminit();
-	while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') {
-		if (strcmp(argv[1], "--") == 0) {
-			/* explicit end of args */
-			argc--;
-			argv++;
-			break;
-		}
-		switch (argv[1][1]) {
-		case 'f':	/* next argument is program filename */
-			argc--;
-			argv++;
-			if (argc <= 1)
-				ERROR "no program filename" FATAL;
-			pfile = realloc(pfile, sizeof (uchar *) * (npfile + 1));
-			if (pfile == NULL)
-				ERROR "out of space in main" FATAL;
-			pfile[npfile++] = (uchar *)argv[1];
-			break;
-		case 'F':	/* set field separator */
-			if (argv[1][2] != 0) {	/* arg is -Fsomething */
-				/* wart: t=>\t */
-				if (argv[1][2] == 't' && argv[1][3] == 0)
-					fs = (uchar *) "\t";
-				else if (argv[1][2] != 0)
-					fs = (uchar *)&argv[1][2];
-			} else {		/* arg is -F something */
-				argc--; argv++;
-				if (argc > 1) {
-					/* wart: t=>\t */
-					if (argv[1][0] == 't' &&
-					    argv[1][1] == 0)
-						fs = (uchar *) "\t";
-					else if (argv[1][0] != 0)
-						fs = (uchar *)&argv[1][0];
-				}
-			}
-			if (fs == NULL || *fs == '\0')
-				ERROR "field separator FS is empty" WARNING;
-			break;
-		case 'v':	/* -v a=1 to be done NOW.  one -v for each */
-			if (argv[1][2] == '\0' && --argc > 1 &&
-			    isclvar((uchar *)(++argv)[1]))
-				setclvar((uchar *)argv[1]);
-			break;
-		case 'd':
-			dbg = atoi(&argv[1][2]);
-			if (dbg == 0)
-				dbg = 1;
-			(void) printf("awk %s\n", version);
-			break;
-		default:
-			ERROR "unknown option %s ignored", argv[1] WARNING;
-			break;
-		}
-		argc--;
-		argv++;
-	}
-	/* argv[1] is now the first argument */
-	if (npfile == 0) {	/* no -f; first argument is program */
-		if (argc <= 1) {
-			if (dbg)
-				exit(0);
-			ERROR "no program given" FATAL;
-		}
-		dprintf(("program = |%s|\n", argv[1]));
-		lexprog = (uchar *)argv[1];
-		argc--;
-		argv++;
-	}
-	compile_time = 1;
-	argv[0] = (char *)cmdname;	/* put prog name at front of arglist */
-	dprintf(("argc=%d, argv[0]=%s\n", argc, argv[0]));
-	arginit(argc, (uchar **)argv);
-	envinit((uchar **)envp);
-	(void) yyparse();
-	if (fs)
-		*FS = qstring(fs, '\0');
-	dprintf(("errorflag=%d\n", errorflag));
-	/*
-	 * done parsing, so now activate the LC_NUMERIC
-	 */
-	(void) setlocale(LC_ALL, "");
-	nl_radix = nl_langinfo(RADIXCHAR);
-	if (nl_radix)
-		radixpoint = *nl_radix;
-
-	if (errorflag == 0) {
-		compile_time = 0;
-		run(winner);
-	} else
-		bracecheck();
-	return (errorflag);
-}
-
-int
-pgetc(void)		/* get program character */
-{
-	int c;
-
-	for (;;) {
-		if (yyin == NULL) {
-			if (curpfile >= npfile)
-				return (EOF);
-			yyin = (strcmp((char *)pfile[curpfile], "-") == 0) ?
-			    stdin : fopen((char *)pfile[curpfile], "r");
-			if (yyin == NULL) {
-				ERROR "can't open file %s",
-				    pfile[curpfile] FATAL;
-			}
-		}
-		if ((c = getc(yyin)) != EOF)
-			return (c);
-		(void) fclose(yyin);
-		yyin = NULL;
-		curpfile++;
-	}
-}
--- old/usr/src/cmd/awk/maketab.c	2013-05-27 09:45:03.562480611 +0000
+++ /dev/null	2013-05-27 09:45:03.000000000 +0000
@@ -1,166 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <libintl.h>
-#include "awk.h"
-#include "y.tab.h"
-
-struct xx {
-	int token;
-	char *name;
-	char *pname;
-} proc[] = {
-	{ PROGRAM, "program", NULL },
-	{ BOR, "boolop", " || " },
-	{ AND, "boolop", " && " },
-	{ NOT, "boolop", " !" },
-	{ NE, "relop", " != " },
-	{ EQ, "relop", " == " },
-	{ LE, "relop", " <= " },
-	{ LT, "relop", " < " },
-	{ GE, "relop", " >= " },
-	{ GT, "relop", " > " },
-	{ ARRAY, "array", NULL },
-	{ INDIRECT, "indirect", "$(" },
-	{ SUBSTR, "substr", "substr" },
-	{ SUB, "sub", "sub" },
-	{ GSUB, "gsub", "gsub" },
-	{ INDEX, "sindex", "sindex" },
-	{ SPRINTF, "a_sprintf", "sprintf " },
-	{ ADD, "arith", " + " },
-	{ MINUS, "arith", " - " },
-	{ MULT, "arith", " * " },
-	{ DIVIDE, "arith", " / " },
-	{ MOD, "arith", " % " },
-	{ UMINUS, "arith", " -" },
-	{ POWER, "arith", " **" },
-	{ PREINCR, "incrdecr", "++" },
-	{ POSTINCR, "incrdecr", "++" },
-	{ PREDECR, "incrdecr", "--" },
-	{ POSTDECR, "incrdecr", "--" },
-	{ CAT, "cat", " " },
-	{ PASTAT, "pastat", NULL },
-	{ PASTAT2, "dopa2", NULL },
-	{ MATCH, "matchop", " ~ " },
-	{ NOTMATCH, "matchop", " !~ " },
-	{ MATCHFCN, "matchop", "matchop" },
-	{ INTEST, "intest", "intest" },
-	{ PRINTF, "aprintf", "printf" },
-	{ PRINT, "print", "print" },
-	{ CLOSE, "closefile", "closefile" },
-	{ DELETE, "delete", "delete" },
-	{ SPLIT, "split", "split" },
-	{ ASSIGN, "assign", " = " },
-	{ ADDEQ, "assign", " += " },
-	{ SUBEQ, "assign", " -= " },
-	{ MULTEQ, "assign", " *= " },
-	{ DIVEQ, "assign", " /= " },
-	{ MODEQ, "assign", " %= " },
-	{ POWEQ, "assign", " ^= " },
-	{ CONDEXPR, "condexpr", " ?: " },
-	{ IF, "ifstat", "if(" },
-	{ WHILE, "whilestat", "while(" },
-	{ FOR, "forstat", "for(" },
-	{ DO, "dostat", "do" },
-	{ IN, "instat", "instat" },
-	{ NEXT, "jump", "next" },
-	{ EXIT, "jump", "exit" },
-	{ BREAK, "jump", "break" },
-	{ CONTINUE, "jump", "continue" },
-	{ RETURN, "jump", "ret" },
-	{ BLTIN, "bltin", "bltin" },
-	{ CALL, "call", "call" },
-	{ ARG, "arg", "arg" },
-	{ VARNF, "getnf", "NF" },
-	{ GETLINE, "getaline", "getline" },
-	{ 0, "", "" },
-};
-
-#define	SIZE	LASTTOKEN - FIRSTTOKEN + 1
-char *table[SIZE];
-char *names[SIZE];
-
-int
-main()
-{
-	struct xx *p;
-	int i, n, tok;
-	char c;
-	FILE *fp;
-	char buf[100], name[100], def[100];
-
-	printf("#include \"awk.h\"\n");
-	printf("#include \"y.tab.h\"\n\n");
-
-	if ((fp = fopen("y.tab.h", "r")) == NULL) {
-		fprintf(stderr, gettext("maketab can't open y.tab.h!\n"));
-		exit(1);
-	}
-	printf("static uchar *printname[%d] = {\n", SIZE);
-	i = 0;
-	while (fgets(buf, sizeof (buf), fp) != NULL) {
-		n = sscanf(buf, "%1c %s %s %d", &c, def, name, &tok);
-		/* not a valid #define? */
-		if (c != '#' || n != 4 && strcmp(def, "define") != 0)
-			continue;
-		if (tok < FIRSTTOKEN || tok > LASTTOKEN) {
-			fprintf(stderr, gettext("maketab funny token %d %s\n"),
-			    tok, buf);
-			exit(1);
-		}
-		names[tok-FIRSTTOKEN] = malloc(strlen(name)+1);
-		strcpy(names[tok-FIRSTTOKEN], name);
-		printf("\t(uchar *) \"%s\",\t/* %d */\n", name, tok);
-		i++;
-	}
-	printf("};\n\n");
-
-	for (p = proc; p->token != 0; p++)
-		table[p->token-FIRSTTOKEN] = p->name;
-	printf("\nCell *(*proctab[%d])() = {\n", SIZE);
-	for (i = 0; i < SIZE; i++)
-		if (table[i] == 0)
-			printf("\tnullproc,\t/* %s */\n", names[i]);
-		else
-			printf("\t%s,\t/* %s */\n", table[i], names[i]);
-	printf("};\n\n");
-
-	printf("uchar *\ntokname(int n)\n");	/* print a tokname() function */
-	printf("{\n");
-	printf("	static char buf[100];\n\n");
-	printf("	if (n < FIRSTTOKEN || n > LASTTOKEN) {\n");
-	printf("		(void) sprintf(buf, \"token %%d\", n);\n");
-	printf("		return ((uchar *)buf);\n");
-	printf("	}\n");
-	printf("	return printname[n-257];\n");
-	printf("}\n");
-	exit(0);
-}
--- old/usr/src/cmd/awk/parse.c	2013-05-27 09:45:03.690071739 +0000
+++ /dev/null	2013-05-27 09:45:03.000000000 +0000
@@ -1,285 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#define	DEBUG
-#include "awk.h"
-#include "y.tab.h"
-
-Node *
-nodealloc(int n)
-{
-	register Node *x;
-
-	x = (Node *)malloc(sizeof (Node) + (n - 1) * sizeof (Node *));
-	if (x == NULL)
-		ERROR "out of space in nodealloc" FATAL;
-	x->nnext = NULL;
-	x->lineno = lineno;
-	return (x);
-}
-
-Node *
-exptostat(Node *a)
-{
-	a->ntype = NSTAT;
-	return (a);
-}
-
-Node *
-node1(int a, Node *b)
-{
-	register Node *x;
-
-	x = nodealloc(1);
-	x->nobj = a;
-	x->narg[0] = b;
-	return (x);
-}
-
-Node *
-node2(int a, Node *b, Node *c)
-{
-	register Node *x;
-
-	x = nodealloc(2);
-	x->nobj = a;
-	x->narg[0] = b;
-	x->narg[1] = c;
-	return (x);
-}
-
-Node *
-node3(int a, Node *b, Node *c, Node *d)
-{
-	register Node *x;
-
-	x = nodealloc(3);
-	x->nobj = a;
-	x->narg[0] = b;
-	x->narg[1] = c;
-	x->narg[2] = d;
-	return (x);
-}
-
-Node *
-node4(int a, Node *b, Node *c, Node *d, Node *e)
-{
-	register Node *x;
-	x = nodealloc(4);
-	x->nobj = a;
-	x->narg[0] = b;
-	x->narg[1] = c;
-	x->narg[2] = d;
-	x->narg[3] = e;
-	return (x);
-}
-
-Node *
-stat3(int a, Node *b, Node *c, Node *d)
-{
-	register Node *x;
-
-	x = node3(a, b, c, d);
-	x->ntype = NSTAT;
-	return (x);
-}
-
-Node *
-op2(int a, Node *b, Node *c)
-{
-	register Node *x;
-
-	x = node2(a, b, c);
-	x->ntype = NEXPR;
-	return (x);
-}
-
-Node *
-op1(int a, Node *b)
-{
-	register Node *x;
-
-	x = node1(a, b);
-	x->ntype = NEXPR;
-	return (x);
-}
-
-Node *
-stat1(int a, Node *b)
-{
-	register Node *x;
-
-	x = node1(a, b);
-	x->ntype = NSTAT;
-	return (x);
-}
-
-Node *
-op3(int a, Node *b, Node *c, Node *d)
-{
-	register Node *x;
-
-	x = node3(a, b, c, d);
-	x->ntype = NEXPR;
-	return (x);
-}
-
-Node *
-op4(int a, Node *b, Node *c, Node *d, Node *e)
-{
-	register Node *x;
-
-	x = node4(a, b, c, d, e);
-	x->ntype = NEXPR;
-	return (x);
-}
-
-Node *
-stat2(int a, Node *b, Node *c)
-{
-	register Node *x;
-
-	x = node2(a, b, c);
-	x->ntype = NSTAT;
-	return (x);
-}
-
-Node *
-stat4(int a, Node *b, Node *c, Node *d, Node *e)
-{
-	register Node *x;
-
-	x = node4(a, b, c, d, e);
-	x->ntype = NSTAT;
-	return (x);
-}
-
-Node *
-valtonode(Cell *a, int b)
-{
-	register Node *x;
-
-	a->ctype = OCELL;
-	a->csub = b;
-	x = node1(0, (Node *)a);
-	x->ntype = NVALUE;
-	return (x);
-}
-
-Node *
-rectonode(void)
-{
-	/* return valtonode(lookup("$0", symtab), CFLD); */
-	return (valtonode(recloc, CFLD));
-}
-
-Node *
-makearr(Node *p)
-{
-	Cell *cp;
-
-	if (isvalue(p)) {
-		cp = (Cell *)(p->narg[0]);
-		if (isfunc(cp))
-			ERROR "%s is a function, not an array", cp->nval SYNTAX;
-		else if (!isarr(cp)) {
-			xfree(cp->sval);
-			cp->sval = (uchar *)makesymtab(NSYMTAB);
-			cp->tval = ARR;
-		}
-	}
-	return (p);
-}
-
-Node *
-pa2stat(Node *a, Node *b, Node *c)
-{
-	register Node *x;
-
-	x = node4(PASTAT2, a, b, c, (Node *)paircnt);
-	paircnt++;
-	x->ntype = NSTAT;
-	return (x);
-}
-
-Node *
-linkum(Node *a, Node *b)
-{
-	register Node *c;
-
-	if (errorflag)	/* don't link things that are wrong */
-		return (a);
-	if (a == NULL)
-		return (b);
-	else if (b == NULL)
-		return (a);
-	for (c = a; c->nnext != NULL; c = c->nnext)
-		;
-	c->nnext = b;
-	return (a);
-}
-
-void
-defn(Cell *v, Node *vl, Node *st)	/* turn on FCN bit in definition */
-{
-	Node *p;
-	int n;
-
-	if (isarr(v)) {
-		ERROR "`%s' is an array name and a function name",
-		    v->nval SYNTAX;
-		return;
-	}
-	v->tval = FCN;
-	v->sval = (uchar *)st;
-	n = 0;	/* count arguments */
-	for (p = vl; p; p = p->nnext)
-		n++;
-	v->fval = n;
-	dprintf(("defining func %s (%d args)\n", v->nval, n));
-}
-
-int
-isarg(uchar *s)	/* is s in argument list for current function? */
-{
-	extern Node *arglist;
-	Node *p = arglist;
-	int n;
-
-	for (n = 0; p != 0; p = p->nnext, n++) {
-		if (strcmp((char *)((Cell *)(p->narg[0]))->nval,
-		    (char *)s) == 0) {
-			return (n);
-		}
-	}
-	return (-1);
-}
--- old/usr/src/cmd/awk/run.c	2013-05-27 09:45:03.830533888 +0000
+++ /dev/null	2013-05-27 09:45:03.000000000 +0000
@@ -1,1904 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#define	tempfree(x, s)	if (istemp(x)) tfree(x, s)
-
-#define	execute(p) r_execute(p)
-
-#define	DEBUG
-#include	"awk.h"
-#include	<math.h>
-#include	"y.tab.h"
-#include	<stdio.h>
-#include	<ctype.h>
-#include	<setjmp.h>
-#include	<time.h>
-
-#ifndef	FOPEN_MAX
-#define	FOPEN_MAX	15	/* max number of open files, from ANSI std. */
-#endif
-
-
-static jmp_buf env;
-
-static	Cell	*r_execute(Node *);
-static	Cell	*gettemp(char *), *copycell(Cell *);
-static	FILE	*openfile(int, uchar *), *redirect(int, Node *);
-
-int	paircnt;
-Node	*winner = NULL;
-
-static Cell	*tmps;
-
-static Cell	truecell	= { OBOOL, BTRUE, 0, 0, 1.0, NUM };
-Cell	*true	= &truecell;
-static Cell	falsecell	= { OBOOL, BFALSE, 0, 0, 0.0, NUM };
-Cell	*false	= &falsecell;
-static Cell	breakcell	= { OJUMP, JBREAK, 0, 0, 0.0, NUM };
-Cell	*jbreak	= &breakcell;
-static Cell	contcell	= { OJUMP, JCONT, 0, 0, 0.0, NUM };
-Cell	*jcont	= &contcell;
-static Cell	nextcell	= { OJUMP, JNEXT, 0, 0, 0.0, NUM };
-Cell	*jnext	= &nextcell;
-static Cell	exitcell	= { OJUMP, JEXIT, 0, 0, 0.0, NUM };
-Cell	*jexit	= &exitcell;
-static Cell	retcell		= { OJUMP, JRET, 0, 0, 0.0, NUM };
-Cell	*jret	= &retcell;
-static Cell	tempcell	= { OCELL, CTEMP, 0, 0, 0.0, NUM };
-
-Node	*curnode = NULL;	/* the node being executed, for debugging */
-
-static	void	tfree(Cell *, char *);
-static	void	closeall(void);
-static	double	ipow(double, int);
-
-void
-run(Node *a)
-{
-	(void) execute(a);
-	closeall();
-}
-
-static Cell *
-r_execute(Node *u)
-{
-	register Cell *(*proc)();
-	register Cell *x;
-	register Node *a;
-
-	if (u == NULL)
-		return (true);
-	for (a = u; ; a = a->nnext) {
-		curnode = a;
-		if (isvalue(a)) {
-			x = (Cell *) (a->narg[0]);
-			if ((x->tval & FLD) && !donefld)
-				fldbld();
-			else if ((x->tval & REC) && !donerec)
-				recbld();
-			return (x);
-		}
-		/* probably a Cell* but too risky to print */
-		if (notlegal(a->nobj))
-			ERROR "illegal statement" FATAL;
-		proc = proctab[a->nobj-FIRSTTOKEN];
-		x = (*proc)(a->narg, a->nobj);
-		if ((x->tval & FLD) && !donefld)
-			fldbld();
-		else if ((x->tval & REC) && !donerec)
-			recbld();
-		if (isexpr(a))
-			return (x);
-		/* a statement, goto next statement */
-		if (isjump(x))
-			return (x);
-		if (a->nnext == (Node *)NULL)
-			return (x);
-		tempfree(x, "execute");
-	}
-}
-
-/*ARGSUSED*/
-Cell *
-program(Node **a, int n)
-{
-	register Cell *x;
-
-	if (setjmp(env) != 0)
-		goto ex;
-	if (a[0]) {		/* BEGIN */
-		x = execute(a[0]);
-		if (isexit(x))
-			return (true);
-		if (isjump(x)) {
-			ERROR "illegal break, continue or next from BEGIN"
-			    FATAL;
-		}
-		tempfree(x, "");
-	}
-loop:
-	if (a[1] || a[2])
-		while (getrec(&record, &record_size) > 0) {
-			x = execute(a[1]);
-			if (isexit(x))
-				break;
-			tempfree(x, "");
-		}
-ex:
-	if (setjmp(env) != 0)
-		goto ex1;
-	if (a[2]) {		/* END */
-		x = execute(a[2]);
-		if (iscont(x))	/* read some more */
-			goto loop;
-		if (isbreak(x) || isnext(x))
-			ERROR "illegal break or next from END" FATAL;
-		tempfree(x, "");
-	}
-ex1:
-	return (true);
-}
-
-struct Frame {
-	int nargs;	/* number of arguments in this call */
-	Cell *fcncell;	/* pointer to Cell for function */
-	Cell **args;	/* pointer to array of arguments after execute */
-	Cell *retval;	/* return value */
-};
-
-#define	NARGS	30
-
-struct Frame *frame = NULL; /* base of stack frames; dynamically allocated */
-int	nframe = 0;		/* number of frames allocated */
-struct Frame *fp = NULL;	/* frame pointer. bottom level unused */
-
-/*ARGSUSED*/
-Cell *
-call(Node **a, int n)
-{
-	static Cell newcopycell =
-		{ OCELL, CCOPY, 0, (uchar *) "", 0.0, NUM|STR|DONTFREE };
-	int i, ncall, ndef, freed = 0;
-	Node *x;
-	Cell *args[NARGS], *oargs[NARGS], *y, *z, *fcn;
-	uchar *s;
-
-	fcn = execute(a[0]);	/* the function itself */
-	s = fcn->nval;
-	if (!isfunc(fcn))
-		ERROR "calling undefined function %s", s FATAL;
-	if (frame == NULL) {
-		fp = frame = (struct Frame *)calloc(nframe += 100,
-		    sizeof (struct Frame));
-		if (frame == NULL) {
-			ERROR "out of space for stack frames calling %s",
-			    s FATAL;
-		}
-	}
-	for (ncall = 0, x = a[1]; x != NULL; x = x->nnext) /* args in call */
-		ncall++;
-	ndef = (int)fcn->fval;			/* args in defn */
-	dprintf(("calling %s, %d args (%d in defn), fp=%d\n",
-	    s, ncall, ndef, fp-frame));
-	if (ncall > ndef) {
-		ERROR "function %s called with %d args, uses only %d",
-		    s, ncall, ndef WARNING;
-	}
-	if (ncall + ndef > NARGS) {
-		ERROR "function %s has %d arguments, limit %d",
-		    s, ncall+ndef, NARGS FATAL;
-	}
-	for (i = 0, x = a[1]; x != NULL; i++, x = x->nnext) {
-		/* get call args */
-		dprintf(("evaluate args[%d], fp=%d:\n", i, fp-frame));
-		y = execute(x);
-		oargs[i] = y;
-		dprintf(("args[%d]: %s %f <%s>, t=%o\n",
-		    i, y->nval, y->fval,
-		    isarr(y) ? "(array)" : (char *)y->sval, y->tval));
-		if (isfunc(y)) {
-			ERROR "can't use function %s as argument in %s",
-			    y->nval, s FATAL;
-		}
-		if (isarr(y))
-			args[i] = y;	/* arrays by ref */
-		else
-			args[i] = copycell(y);
-		tempfree(y, "callargs");
-	}
-	for (; i < ndef; i++) { /* add null args for ones not provided */
-		args[i] = gettemp("nullargs");
-		*args[i] = newcopycell;
-	}
-	fp++;	/* now ok to up frame */
-	if (fp >= frame + nframe) {
-		int dfp = fp - frame;	/* old index */
-		frame = (struct Frame *)
-		    realloc(frame, (nframe += 100) * sizeof (struct Frame));
-		if (frame == NULL)
-			ERROR "out of space for stack frames in %s", s FATAL;
-		fp = frame + dfp;
-	}
-	fp->fcncell = fcn;
-	fp->args = args;
-	fp->nargs = ndef;	/* number defined with (excess are locals) */
-	fp->retval = gettemp("retval");
-
-	dprintf(("start exec of %s, fp=%d\n", s, fp-frame));
-	/*LINTED align*/
-	y = execute((Node *)(fcn->sval));	/* execute body */
-	dprintf(("finished exec of %s, fp=%d\n", s, fp-frame));
-
-	for (i = 0; i < ndef; i++) {
-		Cell *t = fp->args[i];
-		if (isarr(t)) {
-			if (t->csub == CCOPY) {
-				if (i >= ncall) {
-					freesymtab(t);
-					t->csub = CTEMP;
-				} else {
-					oargs[i]->tval = t->tval;
-					oargs[i]->tval &= ~(STR|NUM|DONTFREE);
-					oargs[i]->sval = t->sval;
-					tempfree(t, "oargsarr");
-				}
-			}
-		} else {
-			t->csub = CTEMP;
-			tempfree(t, "fp->args");
-			if (t == y) freed = 1;
-		}
-	}
-	tempfree(fcn, "call.fcn");
-	if (isexit(y) || isnext(y))
-		return (y);
-	if (!freed)
-		tempfree(y, "fcn ret"); /* this can free twice! */
-	z = fp->retval;			/* return value */
-	dprintf(("%s returns %g |%s| %o\n",
-	    s, getfval(z), getsval(z), z->tval));
-	fp--;
-	return (z);
-}
-
-static Cell *
-copycell(Cell *x)	/* make a copy of a cell in a temp */
-{
-	Cell *y;
-
-	y = gettemp("copycell");
-	y->csub = CCOPY;	/* prevents freeing until call is over */
-	y->nval = x->nval;
-	y->sval = x->sval ? tostring(x->sval) : NULL;
-	y->fval = x->fval;
-	/* copy is not constant or field is DONTFREE right? */
-	y->tval = x->tval & ~(CON|FLD|REC|DONTFREE);
-	return (y);
-}
-
-/*ARGSUSED*/
-Cell *
-arg(Node **a, int nnn)
-{
-	int n;
-
-	n = (int)a[0];	/* argument number, counting from 0 */
-	dprintf(("arg(%d), fp->nargs=%d\n", n, fp->nargs));
-	if (n+1 > fp->nargs) {
-		ERROR "argument #%d of function %s was not supplied",
-		    n+1, fp->fcncell->nval FATAL;
-	}
-	return (fp->args[n]);
-}
-
-Cell *
-jump(Node **a, int n)
-{
-	register Cell *y;
-
-	switch (n) {
-	case EXIT:
-		if (a[0] != NULL) {
-			y = execute(a[0]);
-			errorflag = (int)getfval(y);
-			tempfree(y, "");
-		}
-		longjmp(env, 1);
-		/*NOTREACHED*/
-	case RETURN:
-		if (a[0] != NULL) {
-			y = execute(a[0]);
-			if ((y->tval & (STR|NUM)) == (STR|NUM)) {
-				(void) setsval(fp->retval, getsval(y));
-				fp->retval->fval = getfval(y);
-				fp->retval->tval |= NUM;
-			} else if (y->tval & STR)
-				(void) setsval(fp->retval, getsval(y));
-			else if (y->tval & NUM)
-				(void) setfval(fp->retval, getfval(y));
-			tempfree(y, "");
-		}
-		return (jret);
-	case NEXT:
-		return (jnext);
-	case BREAK:
-		return (jbreak);
-	case CONTINUE:
-		return (jcont);
-	default:	/* can't happen */
-		ERROR "illegal jump type %d", n FATAL;
-	}
-	/*NOTREACHED*/
-	return (NULL);
-}
-
-Cell *
-getaline(Node **a, int n)
-{
-	/* a[0] is variable, a[1] is operator, a[2] is filename */
-	register Cell *r, *x;
-	uchar *buf;
-	FILE *fp;
-	size_t len;
-
-	(void) fflush(stdout);	/* in case someone is waiting for a prompt */
-	r = gettemp("");
-	if (a[1] != NULL) {		/* getline < file */
-		x = execute(a[2]);		/* filename */
-		if ((int)a[1] == '|')	/* input pipe */
-			a[1] = (Node *)LE;	/* arbitrary flag */
-		fp = openfile((int)a[1], getsval(x));
-		tempfree(x, "");
-		buf = NULL;
-		if (fp == NULL)
-			n = -1;
-		else
-			n = readrec(&buf, &len, fp);
-		if (n > 0) {
-			if (a[0] != NULL) {	/* getline var <file */
-				(void) setsval(execute(a[0]), buf);
-			} else {			/* getline <file */
-				if (!(recloc->tval & DONTFREE))
-					xfree(recloc->sval);
-				expand_buf(&record, &record_size, len);
-				(void) memcpy(record, buf, len);
-				record[len] = '\0';
-				recloc->sval = record;
-				recloc->tval = REC | STR | DONTFREE;
-				donerec = 1; donefld = 0;
-			}
-		}
-		if (buf != NULL)
-			free(buf);
-	} else {			/* bare getline; use current input */
-		if (a[0] == NULL)	/* getline */
-			n = getrec(&record, &record_size);
-		else {			/* getline var */
-			init_buf(&buf, &len, LINE_INCR);
-			n = getrec(&buf, &len);
-			(void) setsval(execute(a[0]), buf);
-			free(buf);
-		}
-	}
-	(void) setfval(r, (Awkfloat)n);
-	return (r);
-}
-
-/*ARGSUSED*/
-Cell *
-getnf(Node **a, int n)
-{
-	if (donefld == 0)
-		fldbld();
-	return ((Cell *)a[0]);
-}
-
-/*ARGSUSED*/
-Cell *
-array(Node **a, int n)
-{
-	register Cell *x, *y, *z;
-	register uchar *s;
-	register Node *np;
-	uchar	*buf;
-	size_t	bsize, tlen, len, slen;
-
-	x = execute(a[0]);	/* Cell* for symbol table */
-	init_buf(&buf, &bsize, LINE_INCR);
-	buf[0] = '\0';
-	tlen = 0;
-	slen = strlen((char *)*SUBSEP);
-	for (np = a[1]; np; np = np->nnext) {
-		y = execute(np);	/* subscript */
-		s = getsval(y);
-		len = strlen((char *)s);
-		expand_buf(&buf, &bsize, tlen + len + slen);
-		(void) memcpy(&buf[tlen], s, len);
-		tlen += len;
-		if (np->nnext) {
-			(void) memcpy(&buf[tlen], *SUBSEP, slen);
-			tlen += slen;
-		}
-		buf[tlen] = '\0';
-		tempfree(y, "");
-	}
-	if (!isarr(x)) {
-		dprintf(("making %s into an array\n", x->nval));
-		if (freeable(x))
-			xfree(x->sval);
-		x->tval &= ~(STR|NUM|DONTFREE);
-		x->tval |= ARR;
-		x->sval = (uchar *) makesymtab(NSYMTAB);
-	}
-	/*LINTED align*/
-	z = setsymtab(buf, (uchar *)"", 0.0, STR|NUM, (Array *)x->sval);
-	z->ctype = OCELL;
-	z->csub = CVAR;
-	tempfree(x, "");
-	free(buf);
-	return (z);
-}
-
-/*ARGSUSED*/
-Cell *
-delete(Node **a, int n)
-{
-	Cell *x, *y;
-	Node *np;
-	uchar *buf, *s;
-	size_t bsize, tlen, slen, len;
-
-	x = execute(a[0]);	/* Cell* for symbol table */
-	if (!isarr(x))
-		return (true);
-	init_buf(&buf, &bsize, LINE_INCR);
-	buf[0] = '\0';
-	tlen = 0;
-	slen = strlen((char *)*SUBSEP);
-	for (np = a[1]; np; np = np->nnext) {
-		y = execute(np);	/* subscript */
-		s = getsval(y);
-		len = strlen((char *)s);
-		expand_buf(&buf, &bsize, tlen + len + slen);
-		(void) memcpy(&buf[tlen], s, len);
-		tlen += len;
-		if (np->nnext) {
-			(void) memcpy(&buf[tlen], *SUBSEP, slen);
-			tlen += slen;
-		}
-		buf[tlen] = '\0';
-		tempfree(y, "");
-	}
-	freeelem(x, buf);
-	tempfree(x, "");
-	free(buf);
-	return (true);
-}
-
-/*ARGSUSED*/
-Cell *
-intest(Node **a, int n)
-{
-	register Cell *x, *ap, *k;
-	Node *p;
-	uchar *buf;
-	uchar *s;
-	size_t bsize, tlen, slen, len;
-
-	ap = execute(a[1]);	/* array name */
-	if (!isarr(ap))
-		ERROR "%s is not an array", ap->nval FATAL;
-	init_buf(&buf, &bsize, LINE_INCR);
-	buf[0] = 0;
-	tlen = 0;
-	slen = strlen((char *)*SUBSEP);
-	for (p = a[0]; p; p = p->nnext) {
-		x = execute(p);	/* expr */
-		s = getsval(x);
-		len = strlen((char *)s);
-		expand_buf(&buf, &bsize, tlen + len + slen);
-		(void) memcpy(&buf[tlen], s, len);
-		tlen += len;
-		tempfree(x, "");
-		if (p->nnext) {
-			(void) memcpy(&buf[tlen], *SUBSEP, slen);
-			tlen += slen;
-		}
-		buf[tlen] = '\0';
-	}
-	/*LINTED align*/
-	k = lookup(buf, (Array *)ap->sval);
-	tempfree(ap, "");
-	free(buf);
-	if (k == NULL)
-		return (false);
-	else
-		return (true);
-}
-
-
-Cell *
-matchop(Node **a, int n)
-{
-	register Cell *x, *y;
-	register uchar *s, *t;
-	register int i;
-	fa *pfa;
-	int (*mf)() = match, mode = 0;
-
-	if (n == MATCHFCN) {
-		mf = pmatch;
-		mode = 1;
-	}
-	x = execute(a[1]);
-	s = getsval(x);
-	if (a[0] == 0)
-		i = (*mf)(a[2], s);
-	else {
-		y = execute(a[2]);
-		t = getsval(y);
-		pfa = makedfa(t, mode);
-		i = (*mf)(pfa, s);
-		tempfree(y, "");
-	}
-	tempfree(x, "");
-	if (n == MATCHFCN) {
-		int start = patbeg - s + 1;
-		if (patlen < 0)
-			start = 0;
-		(void) setfval(rstartloc, (Awkfloat)start);
-		(void) setfval(rlengthloc, (Awkfloat)patlen);
-		x = gettemp("");
-		x->tval = NUM;
-		x->fval = start;
-		return (x);
-	} else if (n == MATCH && i == 1 || n == NOTMATCH && i == 0)
-		return (true);
-	else
-		return (false);
-}
-
-
-Cell *
-boolop(Node **a, int n)
-{
-	register Cell *x, *y;
-	register int i;
-
-	x = execute(a[0]);
-	i = istrue(x);
-	tempfree(x, "");
-	switch (n) {
-	case BOR:
-		if (i)
-			return (true);
-		y = execute(a[1]);
-		i = istrue(y);
-		tempfree(y, "");
-		return (i ? true : false);
-	case AND:
-		if (!i)
-			return (false);
-		y = execute(a[1]);
-		i = istrue(y);
-		tempfree(y, "");
-		return (i ? true : false);
-	case NOT:
-		return (i ? false : true);
-	default:	/* can't happen */
-		ERROR "unknown boolean operator %d", n FATAL;
-	}
-	/*NOTREACHED*/
-	return (NULL);
-}
-
-Cell *
-relop(Node **a, int n)
-{
-	register int i;
-	register Cell *x, *y;
-	Awkfloat j;
-
-	x = execute(a[0]);
-	y = execute(a[1]);
-	if (x->tval&NUM && y->tval&NUM) {
-		j = x->fval - y->fval;
-		i = j < 0 ? -1: (j > 0 ? 1: 0);
-	} else {
-		i = strcmp((char *)getsval(x), (char *)getsval(y));
-	}
-	tempfree(x, "");
-	tempfree(y, "");
-	switch (n) {
-	case LT:	return (i < 0 ? true : false);
-	case LE:	return (i <= 0 ? true : false);
-	case NE:	return (i != 0 ? true : false);
-	case EQ:	return (i == 0 ? true : false);
-	case GE:	return (i >= 0 ? true : false);
-	case GT:	return (i > 0 ? true : false);
-	default:	/* can't happen */
-		ERROR "unknown relational operator %d", n FATAL;
-	}
-	/*NOTREACHED*/
-	return (false);
-}
-
-static void
-tfree(Cell *a, char *s)
-{
-	if (dbg > 1) {
-		(void) printf("## tfree %.8s %06lo %s\n",
-		    s, (ulong_t)a, a->sval ? a->sval : (uchar *)"");
-	}
-	if (freeable(a))
-		xfree(a->sval);
-	if (a == tmps)
-		ERROR "tempcell list is curdled" FATAL;
-	a->cnext = tmps;
-	tmps = a;
-}
-
-static Cell *
-gettemp(char *s)
-{
-	int i;
-	register Cell *x;
-
-	if (!tmps) {
-		tmps = (Cell *)calloc(100, sizeof (Cell));
-		if (!tmps)
-			ERROR "no space for temporaries" FATAL;
-		for (i = 1; i < 100; i++)
-			tmps[i-1].cnext = &tmps[i];
-		tmps[i-1].cnext = 0;
-	}
-	x = tmps;
-	tmps = x->cnext;
-	*x = tempcell;
-	if (dbg > 1)
-		(void) printf("## gtemp %.8s %06lo\n", s, (ulong_t)x);
-	return (x);
-}
-
-/*ARGSUSED*/
-Cell *
-indirect(Node **a, int n)
-{
-	register Cell *x;
-	register int m;
-	register uchar *s;
-
-	x = execute(a[0]);
-	m = (int)getfval(x);
-	if (m == 0 && !is_number(s = getsval(x)))	/* suspicion! */
-		ERROR "illegal field $(%s)", s FATAL;
-	tempfree(x, "");
-	x = fieldadr(m);
-	x->ctype = OCELL;
-	x->csub = CFLD;
-	return (x);
-}
-
-/*ARGSUSED*/
-Cell *
-substr(Node **a, int nnn)
-{
-	register int k, m, n;
-	register uchar *s;
-	int temp;
-	register Cell *x, *y, *z;
-
-	x = execute(a[0]);
-	y = execute(a[1]);
-	if (a[2] != 0)
-		z = execute(a[2]);
-	s = getsval(x);
-	k = strlen((char *)s) + 1;
-	if (k <= 1) {
-		tempfree(x, "");
-		tempfree(y, "");
-		if (a[2] != 0)
-			tempfree(z, "");
-		x = gettemp("");
-		(void) setsval(x, (uchar *)"");
-		return (x);
-	}
-	m = (int)getfval(y);
-	if (m <= 0)
-		m = 1;
-	else if (m > k)
-		m = k;
-	tempfree(y, "");
-	if (a[2] != 0) {
-		n = (int)getfval(z);
-		tempfree(z, "");
-	} else
-		n = k - 1;
-	if (n < 0)
-		n = 0;
-	else if (n > k - m)
-		n = k - m;
-	dprintf(("substr: m=%d, n=%d, s=%s\n", m, n, s));
-	y = gettemp("");
-	temp = s[n + m - 1];	/* with thanks to John Linderman */
-	s[n + m - 1] = '\0';
-	(void) setsval(y, s + m - 1);
-	s[n + m - 1] = temp;
-	tempfree(x, "");
-	return (y);
-}
-
-/*ARGSUSED*/
-Cell *
-sindex(Node **a, int nnn)
-{
-	register Cell *x, *y, *z;
-	register uchar *s1, *s2, *p1, *p2, *q;
-	Awkfloat v = 0.0;
-
-	x = execute(a[0]);
-	s1 = getsval(x);
-	y = execute(a[1]);
-	s2 = getsval(y);
-
-	z = gettemp("");
-	for (p1 = s1; *p1 != '\0'; p1++) {
-		for (q = p1, p2 = s2; *p2 != '\0' && *q == *p2; q++, p2++)
-			;
-		if (*p2 == '\0') {
-			v = (Awkfloat) (p1 - s1 + 1);	/* origin 1 */
-			break;
-		}
-	}
-	tempfree(x, "");
-	tempfree(y, "");
-	(void) setfval(z, v);
-	return (z);
-}
-
-void
-format(uchar **bufp, uchar *s, Node *a)
-{
-	uchar *fmt;
-	register uchar *os;
-	register Cell *x;
-	int flag = 0, len;
-	uchar_t	*buf;
-	size_t bufsize, fmtsize, cnt, tcnt, ret;
-
-	init_buf(&buf, &bufsize, LINE_INCR);
-	init_buf(&fmt, &fmtsize, LINE_INCR);
-	os = s;
-	cnt = 0;
-	while (*s) {
-		if (*s != '%') {
-			expand_buf(&buf, &bufsize, cnt);
-			buf[cnt++] = *s++;
-			continue;
-		}
-		if (*(s+1) == '%') {
-			expand_buf(&buf, &bufsize, cnt);
-			buf[cnt++] = '%';
-			s += 2;
-			continue;
-		}
-		for (tcnt = 0; ; s++) {
-			expand_buf(&fmt, &fmtsize, tcnt);
-			fmt[tcnt++] = *s;
-			if (*s == '\0')
-				break;
-			if (isalpha(*s) && *s != 'l' && *s != 'h' && *s != 'L')
-				break;	/* the ansi panoply */
-			if (*s == '*') {
-				if (a == NULL) {
-					ERROR
-		"not enough args in printf(%s) or sprintf(%s)", os, os FATAL;
-				}
-				x = execute(a);
-				a = a->nnext;
-				tcnt--;
-				expand_buf(&fmt, &fmtsize, tcnt + 12);
-				ret = sprintf((char *)&fmt[tcnt], "%d",
-				    (int)getfval(x));
-				tcnt += ret;
-				tempfree(x, "");
-			}
-		}
-		fmt[tcnt] = '\0';
-
-		switch (*s) {
-		case 'f': case 'e': case 'g': case 'E': case 'G':
-			flag = 1;
-			break;
-		case 'd': case 'i':
-			flag = 2;
-			if (*(s-1) == 'l')
-				break;
-			fmt[tcnt - 1] = 'l';
-			expand_buf(&fmt, &fmtsize, tcnt);
-			fmt[tcnt++] = 'd';
-			fmt[tcnt] = '\0';
-			break;
-		case 'o': case 'x': case 'X': case 'u':
-			flag = *(s-1) == 'l' ? 2 : 3;
-			break;
-		case 's':
-			flag = 4;
-			break;
-		case 'c':
-			flag = 5;
-			break;
-		default:
-			flag = 0;
-			break;
-		}
-		if (flag == 0) {
-			len = strlen((char *)fmt);
-			expand_buf(&buf, &bufsize, cnt + len);
-			(void) memcpy(&buf[cnt], fmt, len);
-			cnt += len;
-			buf[cnt] = '\0';
-			continue;
-		}
-		if (a == NULL) {
-			ERROR
-	"not enough args in printf(%s) or sprintf(%s)", os, os FATAL;
-		}
-		x = execute(a);
-		a = a->nnext;
-		for (;;) {
-			/* make sure we have at least 1 byte space */
-			expand_buf(&buf, &bufsize, cnt + 1);
-			len = bufsize - cnt;
-			switch (flag) {
-			case 1:
-				/*LINTED*/
-				ret = snprintf((char *)&buf[cnt], len,
-				    (char *)fmt, getfval(x));
-				break;
-			case 2:
-				/*LINTED*/
-				ret = snprintf((char *)&buf[cnt], len,
-				    (char *)fmt, (long)getfval(x));
-				break;
-			case 3:
-				/*LINTED*/
-				ret = snprintf((char *)&buf[cnt], len,
-				    (char *)fmt, (int)getfval(x));
-				break;
-			case 4:
-				/*LINTED*/
-				ret = snprintf((char *)&buf[cnt], len,
-				    (char *)fmt, getsval(x));
-				break;
-			case 5:
-				if (isnum(x)) {
-					/*LINTED*/
-					ret = snprintf((char *)&buf[cnt], len,
-					    (char *)fmt, (int)getfval(x));
-				} else {
-					/*LINTED*/
-					ret = snprintf((char *)&buf[cnt], len,
-					    (char *)fmt, getsval(x)[0]);
-				}
-				break;
-			default:
-				ret = 0;
-			}
-			if (ret < len)
-				break;
-			expand_buf(&buf, &bufsize, cnt + ret);
-		}
-		tempfree(x, "");
-		cnt += ret;
-		s++;
-	}
-	buf[cnt] = '\0';
-	for (; a; a = a->nnext)	/* evaluate any remaining args */
-		(void) execute(a);
-	*bufp = tostring(buf);
-	free(buf);
-	free(fmt);
-}
-
-/*ARGSUSED*/
-Cell *
-a_sprintf(Node **a, int n)
-{
-	register Cell *x;
-	register Node *y;
-	uchar *buf;
-
-	y = a[0]->nnext;
-	x = execute(a[0]);
-	format(&buf, getsval(x), y);
-	tempfree(x, "");
-	x = gettemp("");
-	x->sval = buf;
-	x->tval = STR;
-	return (x);
-}
-
-/*ARGSUSED*/
-Cell *
-aprintf(Node **a, int n)
-{
-	FILE *fp;
-	register Cell *x;
-	register Node *y;
-	uchar *buf;
-
-	y = a[0]->nnext;
-	x = execute(a[0]);
-	format(&buf, getsval(x), y);
-	tempfree(x, "");
-	if (a[1] == NULL)
-		(void) fputs((char *)buf, stdout);
-	else {
-		fp = redirect((int)a[1], a[2]);
-		(void) fputs((char *)buf, fp);
-		(void) fflush(fp);
-	}
-	free(buf);
-	return (true);
-}
-
-Cell *
-arith(Node **a, int n)
-{
-	Awkfloat i, j;
-	double v;
-	register Cell *x, *y, *z;
-
-	x = execute(a[0]);
-	i = getfval(x);
-	tempfree(x, "");
-	if (n != UMINUS) {
-		y = execute(a[1]);
-		j = getfval(y);
-		tempfree(y, "");
-	}
-	z = gettemp("");
-	switch (n) {
-	case ADD:
-		i += j;
-		break;
-	case MINUS:
-		i -= j;
-		break;
-	case MULT:
-		i *= j;
-		break;
-	case DIVIDE:
-		if (j == 0)
-			ERROR "division by zero" FATAL;
-		i /= j;
-		break;
-	case MOD:
-		if (j == 0)
-			ERROR "division by zero in mod" FATAL;
-		(void) modf(i/j, &v);
-		i = i - j * v;
-		break;
-	case UMINUS:
-		i = -i;
-		break;
-	case POWER:
-		if (j >= 0 && modf(j, &v) == 0.0) /* pos integer exponent */
-			i = ipow(i, (int)j);
-		else
-			i = errcheck(pow(i, j), "pow");
-		break;
-	default:	/* can't happen */
-		ERROR "illegal arithmetic operator %d", n FATAL;
-	}
-	(void) setfval(z, i);
-	return (z);
-}
-
-static double
-ipow(double x, int n)
-{
-	double v;
-
-	if (n <= 0)
-		return (1.0);
-	v = ipow(x, n/2);
-	if (n % 2 == 0)
-		return (v * v);
-	else
-		return (x * v * v);
-}
-
-Cell *
-incrdecr(Node **a, int n)
-{
-	register Cell *x, *z;
-	register int k;
-	Awkfloat xf;
-
-	x = execute(a[0]);
-	xf = getfval(x);
-	k = (n == PREINCR || n == POSTINCR) ? 1 : -1;
-	if (n == PREINCR || n == PREDECR) {
-		(void) setfval(x, xf + k);
-		return (x);
-	}
-	z = gettemp("");
-	(void) setfval(z, xf);
-	(void) setfval(x, xf + k);
-	tempfree(x, "");
-	return (z);
-}
-
-Cell *
-assign(Node **a, int n)
-{
-	register Cell *x, *y;
-	Awkfloat xf, yf;
-	double v;
-
-	y = execute(a[1]);
-	x = execute(a[0]);	/* order reversed from before... */
-	if (n == ASSIGN) {	/* ordinary assignment */
-		if ((y->tval & (STR|NUM)) == (STR|NUM)) {
-			(void) setsval(x, getsval(y));
-			x->fval = getfval(y);
-			x->tval |= NUM;
-		} else if (y->tval & STR)
-			(void) setsval(x, getsval(y));
-		else if (y->tval & NUM)
-			(void) setfval(x, getfval(y));
-		else
-			funnyvar(y, "read value of");
-		tempfree(y, "");
-		return (x);
-	}
-	xf = getfval(x);
-	yf = getfval(y);
-	switch (n) {
-	case ADDEQ:
-		xf += yf;
-		break;
-	case SUBEQ:
-		xf -= yf;
-		break;
-	case MULTEQ:
-		xf *= yf;
-		break;
-	case DIVEQ:
-		if (yf == 0)
-			ERROR "division by zero in /=" FATAL;
-		xf /= yf;
-		break;
-	case MODEQ:
-		if (yf == 0)
-			ERROR "division by zero in %%=" FATAL;
-		(void) modf(xf/yf, &v);
-		xf = xf - yf * v;
-		break;
-	case POWEQ:
-		if (yf >= 0 && modf(yf, &v) == 0.0) /* pos integer exponent */
-			xf = ipow(xf, (int)yf);
-		else
-			xf = errcheck(pow(xf, yf), "pow");
-		break;
-	default:
-		ERROR "illegal assignment operator %d", n FATAL;
-		break;
-	}
-	tempfree(y, "");
-	(void) setfval(x, xf);
-	return (x);
-}
-
-/*ARGSUSED*/
-Cell *
-cat(Node **a, int q)
-{
-	register Cell *x, *y, *z;
-	register int n1, n2;
-	register uchar *s;
-
-	x = execute(a[0]);
-	y = execute(a[1]);
-	(void) getsval(x);
-	(void) getsval(y);
-	n1 = strlen((char *)x->sval);
-	n2 = strlen((char *)y->sval);
-	s = (uchar *)malloc(n1 + n2 + 1);
-	if (s == NULL) {
-		ERROR "out of space concatenating %.15s and %.15s",
-		    x->sval, y->sval FATAL;
-	}
-	(void) strcpy((char *)s, (char *)x->sval);
-	(void) strcpy((char *)s + n1, (char *)y->sval);
-	tempfree(y, "");
-	z = gettemp("");
-	z->sval = s;
-	z->tval = STR;
-	tempfree(x, "");
-	return (z);
-}
-
-/*ARGSUSED*/
-Cell *
-pastat(Node **a, int n)
-{
-	register Cell *x;
-
-	if (a[0] == 0)
-		x = execute(a[1]);
-	else {
-		x = execute(a[0]);
-		if (istrue(x)) {
-			tempfree(x, "");
-			x = execute(a[1]);
-		}
-	}
-	return (x);
-}
-
-/*ARGSUSED*/
-Cell *
-dopa2(Node **a, int n)
-{
-	Cell	*x;
-	int	pair;
-	static int	*pairstack = NULL;
-
-	if (!pairstack) {
-		/* first time */
-		dprintf(("paircnt: %d\n", paircnt));
-		pairstack = (int *)malloc(sizeof (int) * paircnt);
-		if (!pairstack)
-			ERROR "out of space in dopa2" FATAL;
-		(void) memset(pairstack, 0, sizeof (int) * paircnt);
-	}
-
-	pair = (int)a[3];
-	if (pairstack[pair] == 0) {
-		x = execute(a[0]);
-		if (istrue(x))
-			pairstack[pair] = 1;
-		tempfree(x, "");
-	}
-	if (pairstack[pair] == 1) {
-		x = execute(a[1]);
-		if (istrue(x))
-			pairstack[pair] = 0;
-		tempfree(x, "");
-		x = execute(a[2]);
-		return (x);
-	}
-	return (false);
-}
-
-/*ARGSUSED*/
-Cell *
-split(Node **a, int nnn)
-{
-	Cell *x, *y, *ap;
-	register uchar *s;
-	register int sep;
-	uchar *t, temp, num[11], *fs;
-	int n, tempstat;
-
-	y = execute(a[0]);	/* source string */
-	s = getsval(y);
-	if (a[2] == 0)		/* fs string */
-		fs = *FS;
-	else if ((int)a[3] == STRING) {	/* split(str,arr,"string") */
-		x = execute(a[2]);
-		fs = getsval(x);
-	} else if ((int)a[3] == REGEXPR)
-		fs = (uchar *)"(regexpr)";	/* split(str,arr,/regexpr/) */
-	else
-		ERROR "illegal type of split()" FATAL;
-	sep = *fs;
-	ap = execute(a[1]);	/* array name */
-	freesymtab(ap);
-	dprintf(("split: s=|%s|, a=%s, sep=|%s|\n", s, ap->nval, fs));
-	ap->tval &= ~STR;
-	ap->tval |= ARR;
-	ap->sval = (uchar *)makesymtab(NSYMTAB);
-
-	n = 0;
-	if (*s != '\0' && strlen((char *)fs) > 1 || (int)a[3] == REGEXPR) {
-		/* reg expr */
-		fa *pfa;
-		if ((int)a[3] == REGEXPR) {	/* it's ready already */
-			pfa = (fa *)a[2];
-		} else {
-			pfa = makedfa(fs, 1);
-		}
-		if (nematch(pfa, s)) {
-			tempstat = pfa->initstat;
-			pfa->initstat = 2;
-			do {
-				n++;
-				(void) sprintf((char *)num, "%d", n);
-				temp = *patbeg;
-				*patbeg = '\0';
-				if (is_number(s)) {
-					(void) setsymtab(num, s,
-					    atof((char *)s),
-					    /*LINTED align*/
-					    STR|NUM, (Array *)ap->sval);
-				} else {
-					(void) setsymtab(num, s, 0.0,
-					    /*LINTED align*/
-					    STR, (Array *)ap->sval);
-				}
-				*patbeg = temp;
-				s = patbeg + patlen;
-				if (*(patbeg+patlen-1) == 0 || *s == 0) {
-					n++;
-					(void) sprintf((char *)num, "%d", n);
-					(void) setsymtab(num, (uchar *)"", 0.0,
-					    /*LINTED align*/
-					    STR, (Array *)ap->sval);
-					pfa->initstat = tempstat;
-					goto spdone;
-				}
-			} while (nematch(pfa, s));
-		}
-		n++;
-		(void) sprintf((char *)num, "%d", n);
-		if (is_number(s)) {
-			(void) setsymtab(num, s, atof((char *)s),
-			    /*LINTED align*/
-			    STR|NUM, (Array *)ap->sval);
-		} else {
-			/*LINTED align*/
-			(void) setsymtab(num, s, 0.0, STR, (Array *)ap->sval);
-		}
-spdone:
-		pfa = NULL;
-	} else if (sep == ' ') {
-		for (n = 0; ; ) {
-			while (*s == ' ' || *s == '\t' || *s == '\n')
-				s++;
-			if (*s == 0)
-				break;
-			n++;
-			t = s;
-			do
-				s++;
-			while (*s != ' ' && *s != '\t' &&
-			    *s != '\n' && *s != '\0')
-				;
-			temp = *s;
-			*s = '\0';
-			(void) sprintf((char *)num, "%d", n);
-			if (is_number(t)) {
-				(void) setsymtab(num, t, atof((char *)t),
-				    /*LINTED align*/
-				    STR|NUM, (Array *)ap->sval);
-			} else {
-				(void) setsymtab(num, t, 0.0,
-				    /*LINTED align*/
-				    STR, (Array *)ap->sval);
-			}
-			*s = temp;
-			if (*s != 0)
-				s++;
-		}
-	} else if (*s != 0) {
-		for (;;) {
-			n++;
-			t = s;
-			while (*s != sep && *s != '\n' && *s != '\0')
-				s++;
-			temp = *s;
-			*s = '\0';
-			(void) sprintf((char *)num, "%d", n);
-			if (is_number(t)) {
-				(void) setsymtab(num, t, atof((char *)t),
-				    /*LINTED align*/
-				    STR|NUM, (Array *)ap->sval);
-			} else {
-				(void) setsymtab(num, t, 0.0,
-				    /*LINTED align*/
-				    STR, (Array *)ap->sval);
-			}
-			*s = temp;
-			if (*s++ == 0)
-				break;
-		}
-	}
-	tempfree(ap, "");
-	tempfree(y, "");
-	if (a[2] != 0 && (int)a[3] == STRING)
-		tempfree(x, "");
-	x = gettemp("");
-	x->tval = NUM;
-	x->fval = n;
-	return (x);
-}
-
-/*ARGSUSED*/
-Cell *
-condexpr(Node **a, int n)
-{
-	register Cell *x;
-
-	x = execute(a[0]);
-	if (istrue(x)) {
-		tempfree(x, "");
-		x = execute(a[1]);
-	} else {
-		tempfree(x, "");
-		x = execute(a[2]);
-	}
-	return (x);
-}
-
-/*ARGSUSED*/
-Cell *
-ifstat(Node **a, int n)
-{
-	register Cell *x;
-
-	x = execute(a[0]);
-	if (istrue(x)) {
-		tempfree(x, "");
-		x = execute(a[1]);
-	} else if (a[2] != 0) {
-		tempfree(x, "");
-		x = execute(a[2]);
-	}
-	return (x);
-}
-
-/*ARGSUSED*/
-Cell *
-whilestat(Node **a, int n)
-{
-	register Cell *x;
-
-	for (;;) {
-		x = execute(a[0]);
-		if (!istrue(x))
-			return (x);
-		tempfree(x, "");
-		x = execute(a[1]);
-		if (isbreak(x)) {
-			x = true;
-			return (x);
-		}
-		if (isnext(x) || isexit(x) || isret(x))
-			return (x);
-		tempfree(x, "");
-	}
-}
-
-/*ARGSUSED*/
-Cell *
-dostat(Node **a, int n)
-{
-	register Cell *x;
-
-	for (;;) {
-		x = execute(a[0]);
-		if (isbreak(x))
-			return (true);
-		if (isnext(x) || isexit(x) || isret(x))
-			return (x);
-		tempfree(x, "");
-		x = execute(a[1]);
-		if (!istrue(x))
-			return (x);
-		tempfree(x, "");
-	}
-}
-
-/*ARGSUSED*/
-Cell *
-forstat(Node **a, int n)
-{
-	register Cell *x;
-
-	x = execute(a[0]);
-	tempfree(x, "");
-	for (;;) {
-		if (a[1] != 0) {
-			x = execute(a[1]);
-			if (!istrue(x))
-				return (x);
-			else
-				tempfree(x, "");
-		}
-		x = execute(a[3]);
-		if (isbreak(x))		/* turn off break */
-			return (true);
-		if (isnext(x) || isexit(x) || isret(x))
-			return (x);
-		tempfree(x, "");
-		x = execute(a[2]);
-		tempfree(x, "");
-	}
-}
-
-/*ARGSUSED*/
-Cell *
-instat(Node **a, int n)
-{
-	register Cell *x, *vp, *arrayp, *cp, *ncp;
-	Array *tp;
-	int i;
-
-	vp = execute(a[0]);
-	arrayp = execute(a[1]);
-	if (!isarr(arrayp))
-		ERROR "%s is not an array", arrayp->nval FATAL;
-	/*LINTED align*/
-	tp = (Array *)arrayp->sval;
-	tempfree(arrayp, "");
-	for (i = 0; i < tp->size; i++) { /* this routine knows too much */
-		for (cp = tp->tab[i]; cp != NULL; cp = ncp) {
-			(void) setsval(vp, cp->nval);
-			ncp = cp->cnext;
-			x = execute(a[2]);
-			if (isbreak(x)) {
-				tempfree(vp, "");
-				return (true);
-			}
-			if (isnext(x) || isexit(x) || isret(x)) {
-				tempfree(vp, "");
-				return (x);
-			}
-			tempfree(x, "");
-		}
-	}
-	return (true);
-}
-
-/*ARGSUSED*/
-Cell *
-bltin(Node **a, int n)
-{
-	register Cell *x, *y;
-	Awkfloat u;
-	register int t;
-	uchar *p, *buf;
-	Node *nextarg;
-
-	t = (int)a[0];
-	x = execute(a[1]);
-	nextarg = a[1]->nnext;
-	switch (t) {
-	case FLENGTH:
-		u = (Awkfloat)strlen((char *)getsval(x)); break;
-	case FLOG:
-		u = errcheck(log(getfval(x)), "log"); break;
-	case FINT:
-		(void) modf(getfval(x), &u); break;
-	case FEXP:
-		u = errcheck(exp(getfval(x)), "exp"); break;
-	case FSQRT:
-		u = errcheck(sqrt(getfval(x)), "sqrt"); break;
-	case FSIN:
-		u = sin(getfval(x)); break;
-	case FCOS:
-		u = cos(getfval(x)); break;
-	case FATAN:
-		if (nextarg == 0) {
-			ERROR "atan2 requires two arguments; returning 1.0"
-			    WARNING;
-			u = 1.0;
-		} else {
-			y = execute(a[1]->nnext);
-			u = atan2(getfval(x), getfval(y));
-			tempfree(y, "");
-			nextarg = nextarg->nnext;
-		}
-		break;
-	case FSYSTEM:
-		/* in case something is buffered already */
-		(void) fflush(stdout);
-		/* 256 is unix-dep */
-		u = (Awkfloat)system((char *)getsval(x)) / 256;
-		break;
-	case FRAND:
-		u = (Awkfloat)(rand() % 32767) / 32767.0;
-		break;
-	case FSRAND:
-		if (x->tval & REC)	/* no argument provided */
-			u = time((time_t *)0);
-		else
-			u = getfval(x);
-		srand((int)u); u = (int)u;
-		break;
-	case FTOUPPER:
-	case FTOLOWER:
-		buf = tostring(getsval(x));
-		if (t == FTOUPPER) {
-			for (p = buf; *p; p++)
-				if (islower(*p))
-					*p = toupper(*p);
-		} else {
-			for (p = buf; *p; p++)
-				if (isupper(*p))
-					*p = tolower(*p);
-		}
-		tempfree(x, "");
-		x = gettemp("");
-		(void) setsval(x, buf);
-		free(buf);
-		return (x);
-	default:	/* can't happen */
-		ERROR "illegal function type %d", t FATAL;
-		break;
-	}
-	tempfree(x, "");
-	x = gettemp("");
-	(void) setfval(x, u);
-	if (nextarg != 0) {
-		ERROR "warning: function has too many arguments" WARNING;
-		for (; nextarg; nextarg = nextarg->nnext)
-			(void) execute(nextarg);
-	}
-	return (x);
-}
-
-/*ARGSUSED*/
-Cell *
-print(Node **a, int n)
-{
-	register Node *x;
-	register Cell *y;
-	FILE *fp;
-
-	if (a[1] == 0)
-		fp = stdout;
-	else
-		fp = redirect((int)a[1], a[2]);
-	for (x = a[0]; x != NULL; x = x->nnext) {
-		y = execute(x);
-		(void) fputs((char *)getsval(y), fp);
-		tempfree(y, "");
-		if (x->nnext == NULL)
-			(void) fputs((char *)*ORS, fp);
-		else
-			(void) fputs((char *)*OFS, fp);
-	}
-	if (a[1] != 0)
-		(void) fflush(fp);
-	return (true);
-}
-
-/*ARGSUSED*/
-Cell *
-nullproc(Node **a, int n)
-{
-	return (0);
-}
-
-struct {
-	FILE	*fp;
-	uchar	*fname;
-	int	mode;	/* '|', 'a', 'w' */
-} files[FOPEN_MAX];
-
-static FILE *
-redirect(int a, Node *b)
-{
-	FILE *fp;
-	Cell *x;
-	uchar *fname;
-
-	x = execute(b);
-	fname = getsval(x);
-	fp = openfile(a, fname);
-	if (fp == NULL)
-		ERROR "can't open file %s", fname FATAL;
-	tempfree(x, "");
-	return (fp);
-}
-
-static FILE *
-openfile(int a, uchar *s)
-{
-	register int i, m;
-	register FILE *fp;
-
-	if (*s == '\0')
-		ERROR "null file name in print or getline" FATAL;
-	for (i = 0; i < FOPEN_MAX; i++) {
-		if (files[i].fname &&
-		    strcmp((char *)s, (char *)files[i].fname) == 0) {
-			if (a == files[i].mode ||
-			    a == APPEND && files[i].mode == GT) {
-				return (files[i].fp);
-			}
-		}
-	}
-	for (i = 0; i < FOPEN_MAX; i++) {
-		if (files[i].fp == 0)
-			break;
-	}
-	if (i >= FOPEN_MAX)
-		ERROR "%s makes too many open files", s FATAL;
-	(void) fflush(stdout);	/* force a semblance of order */
-	m = a;
-	if (a == GT) {
-		fp = fopen((char *)s, "w");
-	} else if (a == APPEND) {
-		fp = fopen((char *)s, "a");
-		m = GT;	/* so can mix > and >> */
-	} else if (a == '|') {	/* output pipe */
-		fp = popen((char *)s, "w");
-	} else if (a == LE) {	/* input pipe */
-		fp = popen((char *)s, "r");
-	} else if (a == LT) {	/* getline <file */
-		fp = strcmp((char *)s, "-") == 0 ?
-		    stdin : fopen((char *)s, "r");	/* "-" is stdin */
-	} else	/* can't happen */
-		ERROR "illegal redirection" FATAL;
-	if (fp != NULL) {
-		files[i].fname = tostring(s);
-		files[i].fp = fp;
-		files[i].mode = m;
-	}
-	return (fp);
-}
-
-/*ARGSUSED*/
-Cell *
-closefile(Node **a, int n)
-{
-	register Cell *x;
-	int i, stat;
-
-	x = execute(a[0]);
-	(void) getsval(x);
-	for (i = 0; i < FOPEN_MAX; i++) {
-		if (files[i].fname &&
-		    strcmp((char *)x->sval, (char *)files[i].fname) == 0) {
-			if (ferror(files[i].fp)) {
-				ERROR "i/o error occurred on %s",
-				    files[i].fname WARNING;
-			}
-			if (files[i].mode == '|' || files[i].mode == LE)
-				stat = pclose(files[i].fp);
-			else
-				stat = fclose(files[i].fp);
-			if (stat == EOF) {
-				ERROR "i/o error occurred closing %s",
-				    files[i].fname WARNING;
-			}
-			xfree(files[i].fname);
-			/* watch out for ref thru this */
-			files[i].fname = NULL;
-			files[i].fp = NULL;
-		}
-	}
-	tempfree(x, "close");
-	return (true);
-}
-
-static void
-closeall(void)
-{
-	int i, stat;
-
-	for (i = 0; i < FOPEN_MAX; i++) {
-		if (files[i].fp) {
-			if (ferror(files[i].fp)) {
-				ERROR "i/o error occurred on %s",
-				    files[i].fname WARNING;
-			}
-			if (files[i].mode == '|' || files[i].mode == LE)
-				stat = pclose(files[i].fp);
-			else
-				stat = fclose(files[i].fp);
-			if (stat == EOF) {
-				ERROR "i/o error occurred while closing %s",
-				    files[i].fname WARNING;
-			}
-		}
-	}
-}
-
-/*ARGSUSED*/
-Cell *
-sub(Node **a, int nnn)
-{
-	register uchar *sptr;
-	register Cell *x, *y, *result;
-	uchar *buf, *t;
-	fa *pfa;
-	size_t	bsize, cnt, len;
-
-	x = execute(a[3]);	/* target string */
-	t = getsval(x);
-	if (a[0] == 0)
-		pfa = (fa *)a[1];	/* regular expression */
-	else {
-		y = execute(a[1]);
-		pfa = makedfa(getsval(y), 1);
-		tempfree(y, "");
-	}
-	y = execute(a[2]);	/* replacement string */
-	result = false;
-	if (pmatch(pfa, t)) {
-		init_buf(&buf, &bsize, LINE_INCR);
-		cnt = 0;
-		sptr = t;
-		len = patbeg - sptr;
-		if (len > 0) {
-			expand_buf(&buf, &bsize, cnt + len);
-			(void) memcpy(buf, sptr, len);
-			cnt += len;
-		}
-		sptr = getsval(y);
-		while (*sptr != 0) {
-			expand_buf(&buf, &bsize, cnt);
-			if (*sptr == '\\' &&
-			    (*(sptr+1) == '&' || *(sptr+1) == '\\')) {
-				sptr++;		/* skip \, */
-				buf[cnt++] = *sptr++; /* add & or \ */
-			} else if (*sptr == '&') {
-				expand_buf(&buf, &bsize, cnt + patlen);
-				sptr++;
-				(void) memcpy(&buf[cnt], patbeg, patlen);
-				cnt += patlen;
-			} else {
-				buf[cnt++] = *sptr++;
-			}
-		}
-		sptr = patbeg + patlen;
-		if ((patlen == 0 && *patbeg) || (patlen && *(sptr-1))) {
-			len = strlen((char *)sptr);
-			expand_buf(&buf, &bsize, cnt + len);
-			(void) memcpy(&buf[cnt], sptr, len);
-			cnt += len;
-		}
-		buf[cnt] = '\0';
-		(void) setsval(x, buf);
-		free(buf);
-		result = true;
-	}
-	tempfree(x, "");
-	tempfree(y, "");
-	return (result);
-}
-
-/*ARGSUSED*/
-Cell *
-gsub(Node **a, int nnn)
-{
-	register Cell *x, *y;
-	register uchar *rptr, *sptr, *t;
-	uchar *buf;
-	register fa *pfa;
-	int mflag, tempstat, num;
-	size_t	bsize, cnt, len;
-
-	mflag = 0;	/* if mflag == 0, can replace empty string */
-	num = 0;
-	x = execute(a[3]);	/* target string */
-	t = getsval(x);
-	if (a[0] == 0)
-		pfa = (fa *) a[1];	/* regular expression */
-	else {
-		y = execute(a[1]);
-		pfa = makedfa(getsval(y), 1);
-		tempfree(y, "");
-	}
-	y = execute(a[2]);	/* replacement string */
-	if (pmatch(pfa, t)) {
-		tempstat = pfa->initstat;
-		pfa->initstat = 2;
-		init_buf(&buf, &bsize, LINE_INCR);
-		rptr = getsval(y);
-		cnt = 0;
-		do {
-			if (patlen == 0 && *patbeg != 0) {
-				/* matched empty string */
-				if (mflag == 0) {	/* can replace empty */
-					num++;
-					sptr = rptr;
-					while (*sptr != 0) {
-						expand_buf(&buf, &bsize, cnt);
-						if (*sptr == '\\' &&
-						    (*(sptr+1) == '&' ||
-						    *(sptr+1) == '\\')) {
-							sptr++;
-							buf[cnt++] = *sptr++;
-						} else if (*sptr == '&') {
-							expand_buf(&buf,
-							    &bsize,
-							    cnt + patlen);
-							sptr++;
-							(void) memcpy(&buf[cnt],
-							    patbeg, patlen);
-							cnt += patlen;
-						} else {
-							buf[cnt++] = *sptr++;
-						}
-					}
-				}
-				if (*t == 0)	/* at end */
-					goto done;
-				expand_buf(&buf, &bsize, cnt);
-				buf[cnt++] = *t++;
-				mflag = 0;
-			} else {	/* matched nonempty string */
-				num++;
-				sptr = t;
-				len = patbeg - sptr;
-				if (len > 0) {
-					expand_buf(&buf, &bsize, cnt + len);
-					(void) memcpy(&buf[cnt], sptr, len);
-					cnt += len;
-				}
-				sptr = rptr;
-				while (*sptr != 0) {
-					expand_buf(&buf, &bsize, cnt);
-					if (*sptr == '\\' &&
-					    (*(sptr+1) == '&' ||
-					    *(sptr+1) == '\\')) {
-						sptr++;
-						buf[cnt++] = *sptr++;
-					} else if (*sptr == '&') {
-						expand_buf(&buf, &bsize,
-						    cnt + patlen);
-						sptr++;
-						(void) memcpy(&buf[cnt],
-						    patbeg, patlen);
-						cnt += patlen;
-					} else {
-						buf[cnt++] = *sptr++;
-					}
-				}
-				t = patbeg + patlen;
-				if ((*(t-1) == 0) || (*t == 0))
-					goto done;
-				mflag = 1;
-			}
-		} while (pmatch(pfa, t));
-		sptr = t;
-		len = strlen((char *)sptr);
-		expand_buf(&buf, &bsize, len + cnt);
-		(void) memcpy(&buf[cnt], sptr, len);
-		cnt += len;
-	done:
-		buf[cnt] = '\0';
-		(void) setsval(x, buf);
-		free(buf);
-		pfa->initstat = tempstat;
-	}
-	tempfree(x, "");
-	tempfree(y, "");
-	x = gettemp("");
-	x->tval = NUM;
-	x->fval = num;
-	return (x);
-}
--- old/usr/src/cmd/awk/tran.c	2013-05-27 09:45:04.027715087 +0000
+++ /dev/null	2013-05-27 09:45:04.000000000 +0000
@@ -1,499 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#define	DEBUG
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include "awk.h"
-#include "y.tab.h"
-
-#define	FULLTAB	2	/* rehash when table gets this x full */
-#define	GROWTAB 4	/* grow table by this factor */
-
-Array	*symtab;	/* main symbol table */
-
-uchar	**FS;		/* initial field sep */
-uchar	**RS;		/* initial record sep */
-uchar	**OFS;		/* output field sep */
-uchar	**ORS;		/* output record sep */
-uchar	**OFMT;		/* output format for numbers */
-Awkfloat *NF;		/* number of fields in current record */
-Awkfloat *NR;		/* number of current record */
-Awkfloat *FNR;		/* number of current record in current file */
-uchar	**FILENAME;	/* current filename argument */
-Awkfloat *ARGC;		/* number of arguments from command line */
-uchar	**SUBSEP;	/* subscript separator for a[i,j,k]; default \034 */
-Awkfloat *RSTART;	/* start of re matched with ~; origin 1 (!) */
-Awkfloat *RLENGTH;	/* length of same */
-
-Cell	*recloc;	/* location of record */
-Cell	*nrloc;		/* NR */
-Cell	*nfloc;		/* NF */
-Cell	*fnrloc;	/* FNR */
-Array	*ARGVtab;	/* symbol table containing ARGV[...] */
-Array	*ENVtab;	/* symbol table containing ENVIRON[...] */
-Cell	*rstartloc;	/* RSTART */
-Cell	*rlengthloc;	/* RLENGTH */
-Cell	*symtabloc;	/* SYMTAB */
-
-Cell	*nullloc;
-Node	*nullnode;	/* zero&null, converted into a node for comparisons */
-
-static	void	rehash(Array *);
-
-void
-syminit(void)
-{
-	init_buf(&record, &record_size, LINE_INCR);
-
-	/* initialize $0 */
-	recloc = getfld(0);
-	recloc->nval = (uchar *)"$0";
-	recloc->sval = record;
-	recloc->tval = REC|STR|DONTFREE;
-
-	symtab = makesymtab(NSYMTAB);
-	(void) setsymtab((uchar *)"0", (uchar *)"0", 0.0,
-	    NUM|STR|CON|DONTFREE, symtab);
-	/* this is used for if(x)... tests: */
-	nullloc = setsymtab((uchar *)"$zero&null", (uchar *)"", 0.0,
-	    NUM|STR|CON|DONTFREE, symtab);
-	nullnode = valtonode(nullloc, CCON);
-	FS = &setsymtab((uchar *)"FS", (uchar *)" ", 0.0,
-	    STR|DONTFREE, symtab)->sval;
-	RS = &setsymtab((uchar *)"RS", (uchar *)"\n", 0.0,
-	    STR|DONTFREE, symtab)->sval;
-	OFS = &setsymtab((uchar *)"OFS", (uchar *)" ", 0.0,
-	    STR|DONTFREE, symtab)->sval;
-	ORS = &setsymtab((uchar *)"ORS", (uchar *)"\n", 0.0,
-	    STR|DONTFREE, symtab)->sval;
-	OFMT = &setsymtab((uchar *)"OFMT", (uchar *)"%.6g", 0.0,
-	    STR|DONTFREE, symtab)->sval;
-	FILENAME = &setsymtab((uchar *)"FILENAME", (uchar *)"-", 0.0,
-	    STR|DONTFREE, symtab)->sval;
-	nfloc = setsymtab((uchar *)"NF", (uchar *)"", 0.0, NUM, symtab);
-	NF = &nfloc->fval;
-	nrloc = setsymtab((uchar *)"NR", (uchar *)"", 0.0, NUM, symtab);
-	NR = &nrloc->fval;
-	fnrloc = setsymtab((uchar *)"FNR", (uchar *)"", 0.0, NUM, symtab);
-	FNR = &fnrloc->fval;
-	SUBSEP = &setsymtab((uchar *)"SUBSEP", (uchar *)"\034", 0.0,
-	    STR|DONTFREE, symtab)->sval;
-	rstartloc = setsymtab((uchar *)"RSTART", (uchar *)"", 0.0,
-	    NUM, symtab);
-	RSTART = &rstartloc->fval;
-	rlengthloc = setsymtab((uchar *)"RLENGTH", (uchar *)"", 0.0,
-	    NUM, symtab);
-	RLENGTH = &rlengthloc->fval;
-	symtabloc = setsymtab((uchar *)"SYMTAB", (uchar *)"", 0.0, ARR, symtab);
-	symtabloc->sval = (uchar *)symtab;
-}
-
-void
-arginit(int ac, uchar *av[])
-{
-	Cell *cp;
-	int i;
-	uchar temp[11];
-
-	/* first make FILENAME first real argument */
-	for (i = 1; i < ac; i++) {
-		if (!isclvar(av[i])) {
-			(void) setsval(lookup((uchar *)"FILENAME", symtab),
-			    av[i]);
-			break;
-		}
-	}
-	ARGC = &setsymtab((uchar *)"ARGC", (uchar *)"", (Awkfloat)ac,
-	    NUM, symtab)->fval;
-	cp = setsymtab((uchar *)"ARGV", (uchar *)"", 0.0, ARR, symtab);
-	ARGVtab = makesymtab(NSYMTAB);	/* could be (int) ARGC as well */
-	cp->sval = (uchar *) ARGVtab;
-	for (i = 0; i < ac; i++) {
-		(void) sprintf((char *)temp, "%d", i);
-		if (is_number(*av)) {
-			(void) setsymtab(temp, *av, atof((const char *)*av),
-			    STR|NUM, ARGVtab);
-		} else {
-			(void) setsymtab(temp, *av, 0.0, STR, ARGVtab);
-		}
-		av++;
-	}
-}
-
-void
-envinit(uchar *envp[])
-{
-	Cell *cp;
-	uchar *p;
-
-	cp = setsymtab((uchar *)"ENVIRON", (uchar *)"", 0.0, ARR, symtab);
-	ENVtab = makesymtab(NSYMTAB);
-	cp->sval = (uchar *) ENVtab;
-	for (; *envp; envp++) {
-		if ((p = (uchar *)strchr((char *)*envp, '=')) == NULL)
-			continue;
-		*p++ = 0;	/* split into two strings at = */
-		if (is_number(p)) {
-			(void) setsymtab(*envp, p, atof((const char *)p),
-			    STR|NUM, ENVtab);
-		} else {
-			(void) setsymtab(*envp, p, 0.0, STR, ENVtab);
-		}
-		/* restore in case env is passed down to a shell */
-		p[-1] = '=';
-	}
-}
-
-Array *
-makesymtab(int n)
-{
-	Array *ap;
-	Cell **tp;
-
-	ap = (Array *)malloc(sizeof (Array));
-	tp = (Cell **)calloc(n, sizeof (Cell *));
-	if (ap == NULL || tp == NULL)
-		ERROR "out of space in makesymtab" FATAL;
-	ap->nelem = 0;
-	ap->size = n;
-	ap->tab = tp;
-	return (ap);
-}
-
-void
-freesymtab(Cell *ap)	/* free symbol table */
-{
-	Cell *cp, *next;
-	Array *tp;
-	int i;
-
-	if (!isarr(ap))
-		return;
-	/*LINTED align*/
-	tp = (Array *)ap->sval;
-	if (tp == NULL)
-		return;
-	for (i = 0; i < tp->size; i++) {
-		for (cp = tp->tab[i]; cp != NULL; cp = next) {
-			next = cp->cnext;
-			xfree(cp->nval);
-			if (freeable(cp))
-				xfree(cp->sval);
-			free(cp);
-		}
-	}
-	free(tp->tab);
-	free(tp);
-}
-
-void
-freeelem(Cell *ap, uchar *s)		/* free elem s from ap (i.e., ap["s"] */
-{
-	Array *tp;
-	Cell *p, *prev = NULL;
-	int h;
-
-	/*LINTED align*/
-	tp = (Array *)ap->sval;
-	h = hash(s, tp->size);
-	for (p = tp->tab[h]; p != NULL; prev = p, p = p->cnext)
-		if (strcmp((char *)s, (char *)p->nval) == 0) {
-			if (prev == NULL)	/* 1st one */
-				tp->tab[h] = p->cnext;
-			else			/* middle somewhere */
-				prev->cnext = p->cnext;
-			if (freeable(p))
-				xfree(p->sval);
-			free(p->nval);
-			free(p);
-			tp->nelem--;
-			return;
-		}
-}
-
-Cell *
-setsymtab(uchar *n, uchar *s, Awkfloat f, unsigned int t, Array *tp)
-{
-	register int h;
-	register Cell *p;
-
-	if (n != NULL && (p = lookup(n, tp)) != NULL) {
-		dprintf(("setsymtab found %p: n=%s", (void *)p, p->nval));
-		dprintf((" s=\"%s\" f=%g t=%p\n",
-		    p->sval, p->fval, (void *)p->tval));
-		return (p);
-	}
-	p = (Cell *)malloc(sizeof (Cell));
-	if (p == NULL)
-		ERROR "symbol table overflow at %s", n FATAL;
-	p->nval = tostring(n);
-	p->sval = s ? tostring(s) : tostring((uchar *)"");
-	p->fval = f;
-	p->tval = t;
-	p->csub = 0;
-
-	tp->nelem++;
-	if (tp->nelem > FULLTAB * tp->size)
-		rehash(tp);
-	h = hash(n, tp->size);
-	p->cnext = tp->tab[h];
-	tp->tab[h] = p;
-	dprintf(("setsymtab set %p: n=%s", (void *)p, p->nval));
-	dprintf((" s=\"%s\" f=%g t=%p\n", p->sval, p->fval, (void *)p->tval));
-	return (p);
-}
-
-int
-hash(uchar *s, int n)	/* form hash value for string s */
-{
-	register unsigned hashval;
-
-	for (hashval = 0; *s != '\0'; s++)
-		hashval = (*s + 31 * hashval);
-	return (hashval % n);
-}
-
-static void
-rehash(Array *tp)	/* rehash items in small table into big one */
-{
-	int i, nh, nsz;
-	Cell *cp, *op, **np;
-
-	nsz = GROWTAB * tp->size;
-	np = (Cell **)calloc(nsz, sizeof (Cell *));
-	if (np == NULL)
-		ERROR "out of space in rehash" FATAL;
-	for (i = 0; i < tp->size; i++) {
-		for (cp = tp->tab[i]; cp; cp = op) {
-			op = cp->cnext;
-			nh = hash(cp->nval, nsz);
-			cp->cnext = np[nh];
-			np[nh] = cp;
-		}
-	}
-	free(tp->tab);
-	tp->tab = np;
-	tp->size = nsz;
-}
-
-Cell *
-lookup(uchar *s, Array *tp)	/* look for s in tp */
-{
-	register Cell *p;
-	int h;
-
-	h = hash(s, tp->size);
-	for (p = tp->tab[h]; p != NULL; p = p->cnext) {
-		if (strcmp((char *)s, (char *)p->nval) == 0)
-			return (p);	/* found it */
-	}
-	return (NULL);			/* not found */
-}
-
-Awkfloat
-setfval(Cell *vp, Awkfloat f)
-{
-	int	i;
-
-	if ((vp->tval & (NUM | STR)) == 0)
-		funnyvar(vp, "assign to");
-	if (vp->tval & FLD) {
-		donerec = 0;	/* mark $0 invalid */
-		i = fldidx(vp);
-		if (i > *NF)
-			newfld(i);
-		dprintf(("setting field %d to %g\n", i, f));
-	} else if (vp->tval & REC) {
-		donefld = 0;	/* mark $1... invalid */
-		donerec = 1;
-	}
-	vp->tval &= ~STR;	/* mark string invalid */
-	vp->tval |= NUM;	/* mark number ok */
-	dprintf(("setfval %p: %s = %g, t=%p\n", (void *)vp,
-	    vp->nval ? vp->nval : (unsigned char *)"NULL",
-	    f, (void *)vp->tval));
-	return (vp->fval = f);
-}
-
-void
-funnyvar(Cell *vp, char *rw)
-{
-	if (vp->tval & ARR)
-		ERROR "can't %s %s; it's an array name.", rw, vp->nval FATAL;
-	if (vp->tval & FCN)
-		ERROR "can't %s %s; it's a function.", rw, vp->nval FATAL;
-	ERROR "funny variable %o: n=%s s=\"%s\" f=%g t=%o",
-	    vp, vp->nval, vp->sval, vp->fval, vp->tval CONT;
-}
-
-uchar *
-setsval(Cell *vp, uchar *s)
-{
-	int	i;
-
-	if ((vp->tval & (NUM | STR)) == 0)
-		funnyvar(vp, "assign to");
-	if (vp->tval & FLD) {
-		donerec = 0;	/* mark $0 invalid */
-		i = fldidx(vp);
-		if (i > *NF)
-			newfld(i);
-		dprintf(("setting field %d to %s\n", i, s));
-	} else if (vp->tval & REC) {
-		donefld = 0;	/* mark $1... invalid */
-		donerec = 1;
-	}
-	vp->tval &= ~NUM;
-	vp->tval |= STR;
-	if (freeable(vp))
-		xfree(vp->sval);
-	vp->tval &= ~DONTFREE;
-	dprintf(("setsval %p: %s = \"%s\", t=%p\n",
-	    (void *)vp,
-	    vp->nval ? (char *)vp->nval : "",
-	    s,
-	    (void *)(vp->tval ? (char *)vp->tval : "")));
-	return (vp->sval = tostring(s));
-}
-
-Awkfloat
-r_getfval(Cell *vp)
-{
-	if ((vp->tval & (NUM | STR)) == 0)
-		funnyvar(vp, "read value of");
-	if ((vp->tval & FLD) && donefld == 0)
-		fldbld();
-	else if ((vp->tval & REC) && donerec == 0)
-		recbld();
-	if (!isnum(vp)) {	/* not a number */
-		vp->fval = atof((const char *)vp->sval);	/* best guess */
-		if (is_number(vp->sval) && !(vp->tval&CON))
-			vp->tval |= NUM;	/* make NUM only sparingly */
-	}
-	dprintf(("getfval %p: %s = %g, t=%p\n",
-	    (void *)vp, vp->nval, vp->fval, (void *)vp->tval));
-	return (vp->fval);
-}
-
-uchar *
-r_getsval(Cell *vp)
-{
-	uchar s[256];
-
-	if ((vp->tval & (NUM | STR)) == 0)
-		funnyvar(vp, "read value of");
-	if ((vp->tval & FLD) && donefld == 0)
-		fldbld();
-	else if ((vp->tval & REC) && donerec == 0)
-		recbld();
-	if ((vp->tval & STR) == 0) {
-		if (!(vp->tval&DONTFREE))
-			xfree(vp->sval);
-		if ((long long)vp->fval == vp->fval) {
-			(void) snprintf((char *)s, sizeof (s),
-			    "%.20g", vp->fval);
-		} else {
-			/*LINTED*/
-			(void) snprintf((char *)s, sizeof (s),
-			    (char *)*OFMT, vp->fval);
-		}
-		vp->sval = tostring(s);
-		vp->tval &= ~DONTFREE;
-		vp->tval |= STR;
-	}
-	dprintf(("getsval %p: %s = \"%s\", t=%p\n",
-	    (void *)vp,
-	    vp->nval ? (char *)vp->nval : "",
-	    vp->sval ? (char *)vp->sval : "",
-	    (void *)vp->tval));
-	return (vp->sval);
-}
-
-uchar *
-tostring(uchar *s)
-{
-	register uchar *p;
-
-	p = (uchar *)malloc(strlen((char *)s)+1);
-	if (p == NULL)
-		ERROR "out of space in tostring on %s", s FATAL;
-	(void) strcpy((char *)p, (char *)s);
-	return (p);
-}
-
-uchar *
-qstring(uchar *s, int delim)	/* collect string up to delim */
-{
-	uchar *cbuf, *ret;
-	int c, n;
-	size_t	cbufsz, cnt;
-
-	init_buf(&cbuf, &cbufsz, LINE_INCR);
-
-	for (cnt = 0; (c = *s) != delim; s++) {
-		if (c == '\n') {
-			ERROR "newline in string %.10s...", cbuf SYNTAX;
-		} else if (c != '\\') {
-			expand_buf(&cbuf, &cbufsz, cnt);
-			cbuf[cnt++] = c;
-		} else {	/* \something */
-			expand_buf(&cbuf, &cbufsz, cnt);
-			switch (c = *++s) {
-			case '\\':	cbuf[cnt++] = '\\'; break;
-			case 'n':	cbuf[cnt++] = '\n'; break;
-			case 't':	cbuf[cnt++] = '\t'; break;
-			case 'b':	cbuf[cnt++] = '\b'; break;
-			case 'f':	cbuf[cnt++] = '\f'; break;
-			case 'r':	cbuf[cnt++] = '\r'; break;
-			default:
-				if (!isdigit(c)) {
-					cbuf[cnt++] = c;
-					break;
-				}
-				n = c - '0';
-				if (isdigit(s[1])) {
-					n = 8 * n + *++s - '0';
-					if (isdigit(s[1]))
-						n = 8 * n + *++s - '0';
-				}
-				cbuf[cnt++] = n;
-				break;
-			}
-		}
-	}
-	cbuf[cnt] = '\0';
-	ret = tostring(cbuf);
-	free(cbuf);
-	return (ret);
-}
--- old/usr/src/cmd/boot/scripts/create_diskmap.ksh	2013-05-27 09:45:04.181930530 +0000
+++ new/usr/src/cmd/boot/scripts/create_diskmap.ksh	2013-05-27 09:45:04.195764228 +0000
@@ -24,8 +24,6 @@
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #
 # basic setup
 #
@@ -35,7 +33,7 @@
 /bin/touch "$GRUBDISKMAP"
 /sbin/biosdev 2> /dev/null | while read diskno diskpath
     do
-	devname=`/bin/ls -l /dev/rdsk/*p0 | /bin/grep $diskpath | /bin/nawk '{ print $9 }'`
+	devname=`/bin/ls -l /dev/rdsk/*p0 | /bin/grep $diskpath | /usr/xpg4/bin/awk '{ print $9 }'`
 	ctdname=`echo $devname | /bin/sed "s#/dev/rdsk/##" | /bin/sed "s#p0##"`
 	grubdisk=`echo $diskno | /bin/sed "s/0x8//"`
 	echo "$grubdisk $ctdname $diskpath" >> "$GRUBDISKMAP"
--- old/usr/src/cmd/boot/scripts/create_ramdisk.ksh	2013-05-27 09:45:04.513643466 +0000
+++ new/usr/src/cmd/boot/scripts/create_ramdisk.ksh	2013-05-27 09:45:04.527109260 +0000
@@ -159,7 +159,7 @@
 	# Estimate image size and add 10% overhead for ufs stuff.
 	# Note, we can't use du here in case we're on a filesystem, e.g. zfs,
 	# in which the disk usage is less than the sum of the file sizes.
-	# The nawk code 
+	# The awk code 
 	#
 	#	{t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5}
 	#
@@ -168,17 +168,17 @@
 	# with directories.  This results in a total size that's slightly
 	# bigger than if du was called on a ufs directory.
 	size32=$(cat "$list32" | xargs -I {} ls -lLd "{}" 2> /dev/null |
-		nawk '{t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5}
+		/usr/xpg4/bin/awk '{t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5}
 		END {print int(t * 1.10 / 1024)}')
 	(( size32 += dirsize32 ))
 	size64=$(cat "$list64" | xargs -I {} ls -lLd "{}" 2> /dev/null |
-		nawk '{t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5}
+		/usr/xpg4/bin/awk '{t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5}
 		END {print int(t * 1.10 / 1024)}')
 	(( size64 += dirsize64 ))
 	(( total_size = size32 + size64 ))
 
 	if [ $compress = yes ] ; then
-		total_size=`echo $total_size | nawk '{print int($1 / 2)}'`
+		total_size=`echo $total_size | /usr/xpg4/bin/awk '{print int($1 / 2)}'`
 	fi
 }
 
@@ -395,7 +395,7 @@
 
 	# sanity check the archive before moving it into place
 	#
-	ARCHIVE_SIZE=`ls -l "${archive}-new" 2> /dev/null | nawk '{ print $5 }'`
+	ARCHIVE_SIZE=`ls -l "${archive}-new" 2> /dev/null | /usr/xpg4/bin/awk '{ print $5 }'`
 	if [ $compress = yes ] || [ $ISA = sparc ] ; then
 		#
 		# 'file' will report "English text" for uncompressed
@@ -477,7 +477,7 @@
 		print "$path"
 	elif [ -d "$path" ]; then
 		if [ $format = ufs ]; then
-			size=`ls -lLd "$path" | nawk '
+			size=`ls -lLd "$path" | /usr/xpg4/bin/awk '
 			    {print ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5}'`
 			if [ `basename "$path"` != "amd64" ]; then
 				(( dirsize32 += size ))
--- old/usr/src/cmd/boot/scripts/root_archive.ksh	2013-05-27 09:45:04.863597048 +0000
+++ new/usr/src/cmd/boot/scripts/root_archive.ksh	2013-05-27 09:45:04.872239122 +0000
@@ -206,7 +206,7 @@
 	# Estimate image size and add %10 overhead for ufs stuff.
 	# Note, we can't use du here in case $UNPACKED_ROOT is on a filesystem,
 	# e.g. zfs, in which the disk usage is less than the sum of the file
-	# sizes.  The nawk code
+	# sizes.  The awk code
 	#
 	#	{t += ($7 % 1024) ? (int($7 / 1024) + 1) * 1024 : $7}
 	#
@@ -218,11 +218,11 @@
 	# if the operation in turn is compressing the files the amount
 	# of typical shrinkage is used to come up with a useful archive
 	# size
-	size=$(find "$UNPACKED_ROOT" -ls | nawk '
+	size=$(find "$UNPACKED_ROOT" -ls | /usr/xpg4/bin/awk '
 	    {t += ($7 % 1024) ? (int($7 / 1024) + 1) * 1024 : $7}
 	    END {print int(t * 1.10 / 1024)}')
 	if [ "$COMPRESS" = true ] ; then
-		size=`echo $size | nawk '{s = $1} END {print int(s * 0.6)}'`
+		size=`echo $size | /usr/xpg4/bin/awk '{s = $1} END {print int(s * 0.6)}'`
 	fi
 
 	/usr/sbin/mkfile ${size}k "$TMR"
--- old/usr/src/cmd/boot/scripts/update_grub.ksh	2013-05-27 09:45:05.195283472 +0000
+++ new/usr/src/cmd/boot/scripts/update_grub.ksh	2013-05-27 09:45:05.209938516 +0000
@@ -46,7 +46,7 @@
 check_pcfs_boot()
 {
 	bootdev=`grep -v "^#" "$ALT_ROOT"/etc/vfstab | grep pcfs \
-	    | grep "[       ]/stubboot[      ]" | nawk '{print $1}'`
+	    | grep "[       ]/stubboot[      ]" | /usr/xpg4/bin/awk '{print $1}'`
 	if [ X"$bootdev" = "X" ]; then
 		is_pcfs_boot=no
 	fi
@@ -91,13 +91,13 @@
 		    sed -n -e '/--/q' -e p | awk '{print $1}'`
 	else
 		metadev=`grep -v "^#" "$ALT_ROOT"/etc/vfstab | \
-		    grep "[	 ]/[ 	]" | nawk '{print $2}'`
+		    grep "[	 ]/[ 	]" | /usr/xpg4/bin/awk '{print $2}'`
 		if [[ $metadev = /dev/rdsk/* ]]; then
 			rootdevlist=`basename "$metadev"`
 		elif [[ $metadev = /dev/md/rdsk/* ]]; then
 			metavol=`basename "$metadev"`
 			rootdevlist=`metastat -p $metavol |\
-			    grep -v "^$metavol[	 ]" | nawk '{print $4}'`
+			    grep -v "^$metavol[	 ]" | /usr/xpg4/bin/awk '{print $4}'`
 		fi
 	fi
 	for rootdev in $rootdevlist
@@ -122,7 +122,7 @@
 		mkdir -p "$ALT_ROOT"/stubboot/boot/grub
 		cp "$ALT_ROOT"/boot/grub/menu.lst "$ALT_ROOT"/stubboot/boot/grub
 		bootdev=`grep -v "^#" "$ALT_ROOT"/etc/vfstab | grep pcfs | \
-			grep "[	 ]/stubboot[ 	]" | nawk '{print $1}'`
+			grep "[	 ]/stubboot[ 	]" | /usr/xpg4/bin/awk '{print $1}'`
 		rpcfsdev=`echo "$bootdev" | sed -e "s/dev\/dsk/dev\/rdsk/"`
 		if [ X"$rpcfsdev" != X ]; then
 			print "Installing grub on $rpcfsdev"
--- old/usr/src/cmd/cmd-inet/etc/init.d/pppd	2013-05-27 09:45:05.528372823 +0000
+++ new/usr/src/cmd/cmd-inet/etc/init.d/pppd	2013-05-27 09:45:05.543197080 +0000
@@ -63,7 +63,7 @@
 
 	# Use ifconfig to make the interfaces down just in case
 	if [ -f $PPPDIR/ifconfig ]; then
-        	nawk '/ifconfig[	]*sppp/ { \
+        	/usr/xpg4/bin/awk '/ifconfig[	]*sppp/ { \
 			system("ifconfig " $2 " down"); \
 			system("ifconfig " $2 " unplumb"); \
 			next; \
--- old/usr/src/cmd/cmd-inet/usr.sbin/routeadm/svc-legacy-routing	2013-05-27 09:45:05.870645642 +0000
+++ new/usr/src/cmd/cmd-inet/usr.sbin/routeadm/svc-legacy-routing	2013-05-27 09:45:05.885627184 +0000
@@ -23,7 +23,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
 
 # This script is the shared method script for the legacy ipv4/ipv6
 # routing services.
@@ -31,14 +30,14 @@
 . /lib/svc/share/smf_include.sh
 
 daemon_prog=`/usr/sbin/svccfg -s $SMF_FMRI listprop routeadm/daemon | \
-	/usr/bin/nawk '{ for (i = 3; i <= NF; i++) printf $i" " }' | \
-	/usr/bin/nawk '{ sub(/^\"/,""); sub(/\"[ \t]*$/,""); print }'`
+	/usr/xpg4/bin/awk '{ for (i = 3; i <= NF; i++) printf $i" " }' | \
+	/usr/xpg4/bin/awk '{ sub(/^\"/,""); sub(/\"[ \t]*$/,""); print }'`
 daemon_args=`/usr/sbin/svccfg -s $SMF_FMRI listprop routeadm/daemon-args | \
-	/usr/bin/nawk '{ for (i = 3; i <= NF; i++) printf $i" " }' | \
-	/usr/bin/nawk '{ sub(/^\"/,""); sub(/\"[ \t]*$/,""); print }'`
+	/usr/xpg4/bin/awk '{ for (i = 3; i <= NF; i++) printf $i" " }' | \
+	/usr/xpg4/bin/awk '{ sub(/^\"/,""); sub(/\"[ \t]*$/,""); print }'`
 daemon_stop=`/usr/sbin/svccfg -s $SMF_FMRI listprop routeadm/daemon-stop-cmd | \
-	/usr/bin/nawk '{ for (i = 3; i <= NF; i++) printf $i" " }' | \
-	/usr/bin/nawk '{ sub(/^\"/,""); sub(/\"[ \t]*$/,""); print }'`
+	/usr/xpg4/bin/awk '{ for (i = 3; i <= NF; i++) printf $i" " }' | \
+	/usr/xpg4/bin/awk '{ sub(/^\"/,""); sub(/\"[ \t]*$/,""); print }'`
 
 method="$1"
 proto="$2"
--- old/usr/src/cmd/dtrace/test/cmd/scripts/dtfailures.ksh	2013-05-27 09:45:06.237633195 +0000
+++ new/usr/src/cmd/dtrace/test/cmd/scripts/dtfailures.ksh	2013-05-27 09:45:06.257518807 +0000
@@ -30,7 +30,7 @@
 
 while [[ -d failure.$failure ]]; do
 	dir=failure.$failure
-	tst=`cat $dir/README | head -1 | nawk '{ print $2 }'`
+	tst=`cat $dir/README | head -1 | /usr/xpg4/bin/awk '{ print $2 }'`
 	kind=`basename $(dirname $tst)`
 	name=`basename $tst`
 	cols=$(expr `tput cols` - 47)
--- old/usr/src/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh	2013-05-27 09:45:06.656604573 +0000
+++ new/usr/src/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh	2013-05-27 09:45:06.666760929 +0000
@@ -23,7 +23,6 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 
 script()
 {
@@ -87,7 +86,7 @@
 		status=100
 	fi
 	
-	i=`wc -l $errfile | nawk '{ print $1 }'`
+	i=`wc -l $errfile | /usr/xpg4/bin/awk '{ print $1 }'`
 
 	if [ "$i" -lt 6 ]; then
 		echo "$0: expected at least 6 lines of stderr, found $i lines"
--- old/usr/src/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh	2013-05-27 09:45:06.988961473 +0000
+++ new/usr/src/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh	2013-05-27 09:45:07.001658528 +0000
@@ -61,7 +61,7 @@
 
 validate()
 {
-	/usr/bin/nawk '
+	/usr/xpg4/bin/awk '
 	BEGIN {
 		while (("/usr/sbin/xm vcpu-list" | getline)) {
 			if ($1 != "Name") {
--- old/usr/src/cmd/fs.d/nfs/nfsfind/nfsfind.sh	2013-05-27 09:45:07.299083784 +0000
+++ new/usr/src/cmd/fs.d/nfs/nfsfind/nfsfind.sh	2013-05-27 09:45:07.310900404 +0000
@@ -37,7 +37,7 @@
 
 # Get all NFS filesystems exported with read-write permission.
 
-DIRS=`/usr/bin/nawk '($3 != "nfs") { next }
+DIRS=`/usr/xpg4/bin/awk '($3 != "nfs") { next }
 	($4 ~ /^rw$|^rw,|^rw=|,rw,|,rw=|,rw$/) { print $1; next }
 	($4 !~ /^ro$|^ro,|^ro=|,ro,|,ro=|,ro$/) { print $1 }' /etc/dfs/sharetab`
 
--- old/usr/src/cmd/getmajor/getmajor.sh	2013-05-27 09:45:07.656940809 +0000
+++ new/usr/src/cmd/getmajor/getmajor.sh	2013-05-27 09:45:07.672361656 +0000
@@ -23,7 +23,6 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 
 if [ $# -ne 1 ]
 then
@@ -31,7 +30,7 @@
 	exit 2
 fi
 
-exec nawk -v a="$1" -v del='#' '$1 !~ /^#|^$/ && $1 == a { \
+exec /usr/xpg4/bin/awk -v a="$1" -v del='#' '$1 !~ /^#|^$/ && $1 == a { \
     num = split($2, maj, del); \
     if (num > 1) { print maj[1] } else { print $2 } \
     found = 1; exit 0 } \
--- old/usr/src/cmd/ldap/ns_ldap/idsconfig.sh	2013-05-27 09:45:07.987447536 +0000
+++ new/usr/src/cmd/ldap/ns_ldap/idsconfig.sh	2013-05-27 09:45:07.997086304 +0000
@@ -974,7 +974,7 @@
     DEBUG=0             # Set Debug OFF
     BACKUP=no_ldap	# backup suffix
     HOST=""		# NULL or <hostname>
-    NAWK="/usr/bin/nawk"
+    AWK="/usr/xpg4/bin/awk"
     RM="/usr/bin/rm"
     WC="/usr/bin/wc"
     CAT="/usr/bin/cat"
@@ -1424,10 +1424,10 @@
 get_krb_realm() {
 
     # To upper cases
-    LDAP_KRB_REALM=`${ECHO} ${LDAP_DOMAIN} | ${NAWK} '{ print toupper($0) }'`
+    LDAP_KRB_REALM=`${ECHO} ${LDAP_DOMAIN} | ${AWK} '{ print toupper($0) }'`
     get_ans_req "Enter Kerberos Realm:" "$LDAP_KRB_REALM"
     # To upper cases
-    LDAP_KRB_REALM=`${ECHO} ${ANS} | ${NAWK} '{ print toupper($0) }'`
+    LDAP_KRB_REALM=`${ECHO} ${ANS} | ${AWK} '{ print toupper($0) }'`
 }
 
 # $1: DN
@@ -5063,7 +5063,7 @@
     # but We do not know the value of the ${LDAP_PROXYAGENT} here, so
     # 1. if only one match found, delete it
     # 2. if more than one matches found, ask the user which one to delete
-    HOWMANY=`${WC} -l ${TMPDIR}/grep_proxyread_aci | ${NAWK} '{print $1}'`
+    HOWMANY=`${WC} -l ${TMPDIR}/grep_proxyread_aci | ${AWK} '{print $1}'`
     if [ $HOWMANY -eq 0 ]; then
 	${ECHO} "Proxy ACI ${PROXY_ACI_NAME} does not exist for ${LDAP_BASEDN}."
 	return 0
@@ -5087,7 +5087,7 @@
 	    	${TMPDIR}/proxy_agent_list
 
 	    # print the proxy agent list
-	    ${NAWK} '{print NR ": " $0}' ${TMPDIR}/proxy_agent_list
+	    ${AWK} '{print NR ": " $0}' ${TMPDIR}/proxy_agent_list
 
 	    # ask the user to pick one
 	    _MENU_PROMPT="Select the proxy agent (1-$HOWMANY): "
--- old/usr/src/cmd/lvm/etc/svm.cleanup.sh	2013-05-27 09:45:08.571091488 +0000
+++ new/usr/src/cmd/lvm/etc/svm.cleanup.sh	2013-05-27 09:45:08.593782748 +0000
@@ -21,8 +21,6 @@
 # CDDL HEADER END
 #
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -46,7 +44,7 @@
 	# Full flash install, remove master's SVM configuration from clone.
 
 	# Remove any SVM root entry from /etc/system file.
-	nawk '
+	/usr/xpg4/bin/awk '
 	BEGIN {delroot=0}
 	/^\* Begin MDD root info \(do not edit\)$/ {delroot=1}
 	/^\* End MDD root info \(do not edit\)$/ {delroot=0; next}
@@ -66,7 +64,7 @@
 	# been created from the currently running system.
 	if [ -h /kernel/drv/md.conf ]; then
 		# Remove SVM mddb entries from /kernel/drv/md.conf.
-		nawk '
+		/usr/xpg4/bin/awk '
 		BEGIN {delmddb=0}
 		/^# Begin MDD database info \(do not edit\)$/ {delmddb=1}
 		/^# End MDD database info \(do not edit\)$/ {delmddb=0; next}
@@ -75,7 +73,7 @@
 		cp ${TMP_CONF} ${IN_CONF}
 
 		# Remove SVM mddb entries from /etc/lvm/mddb.cf.
-		nawk '
+		/usr/xpg4/bin/awk '
 		/^#/ {print $0}
 		' ${IN_CF} > ${TMP_CF}
 		cp ${TMP_CF} ${IN_CF}
@@ -146,7 +144,7 @@
 	fi
 
 	# Get any SVM root entry from master /etc/system file.
-	MASTER_ROOT=`nawk '
+	MASTER_ROOT=`/usr/xpg4/bin/awk '
 	BEGIN {inroot=0}
 	/^\* Begin MDD root info \(do not edit\)$/ {inroot=1; next}
 	/^\* End MDD root info \(do not edit\)$/ {inroot=0}
@@ -154,7 +152,7 @@
 	' ${IN_SYS}`
 
 	# Get any SVM root entry from clone /etc/system file.
-	CLONE_ROOT=`nawk '
+	CLONE_ROOT=`/usr/xpg4/bin/awk '
 	BEGIN {inroot=0}
 	/^\* Begin MDD root info \(do not edit\)$/ {inroot=1; next}
 	/^\* End MDD root info \(do not edit\)$/ {inroot=0}
@@ -168,7 +166,7 @@
 	    if [ "${CLONE_ROOT}" ]; then
 
 		# Restore clone SVM root entry in /etc/system file.
-		nawk -v clone_root="${CLONE_ROOT}" '
+		/usr/xpg4/bin/awk -v clone_root="${CLONE_ROOT}" '
 		BEGIN {newroot=0}
 		/^\* Begin MDD root info \(do not edit\)$/ {
 		    newroot=1
@@ -184,7 +182,7 @@
 
 		# There is no SVM root entry in the clone so remove the entry
 		# from the /etc/system file.
-		nawk '
+		/usr/xpg4/bin/awk '
 		BEGIN {delroot=0}
 		/^\* Begin MDD root info \(do not edit\)$/ {delroot=1}
 		/^\* End MDD root info \(do not edit\)$/ {delroot=0; next }
--- old/usr/src/cmd/lvm/rpc.metamhd/i386/Makefile	2013-05-27 09:45:10.973802466 +0000
+++ new/usr/src/cmd/lvm/rpc.metamhd/i386/Makefile	2013-05-27 09:45:10.984149983 +0000
@@ -23,8 +23,6 @@
 # Copyright 1996, 2001-2003 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 # Makefile for logical volume management 
 #
 
@@ -125,4 +123,4 @@
 
 mhdx_xdr.c: $(SRC)/uts/common/sys/lvm/mhdx.x
 	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/mhdx.x | \
-	nawk '{sub(/uts\/common\/sys\/lvm/, "head") ; print $$0}' >$@
+	/usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head") ; print $$0}' >$@
--- old/usr/src/cmd/lvm/rpc.metamhd/sparc/Makefile	2013-05-27 09:45:11.345161046 +0000
+++ new/usr/src/cmd/lvm/rpc.metamhd/sparc/Makefile	2013-05-27 09:45:11.360082462 +0000
@@ -23,8 +23,6 @@
 # Copyright 1996, 2001-2003 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 # Makefile for logical volume management 
 #
 
@@ -125,4 +123,4 @@
 
 mhdx_xdr.c: $(SRC)/uts/common/sys/lvm/mhdx.x
 	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/mhdx.x | \
-	nawk '{sub(/uts\/common\/sys\/lvm/, "head") ; print $$0}' >$@
+	/usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head") ; print $$0}' >$@
--- old/usr/src/cmd/lvm/util/svc-metasync	2013-05-27 09:45:11.732426609 +0000
+++ new/usr/src/cmd/lvm/util/svc-metasync	2013-05-27 09:45:11.743821328 +0000
@@ -23,8 +23,6 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 # Start mirror resync threads.
 
 DEVFSADM=/usr/sbin/devfsadm
@@ -57,7 +55,7 @@
 		# into the TMPFILE
 		name_str=`gettext "Set name"`
 		mn_str=`gettext "Multi-owner"` 
-		$METASET | /bin/nawk -F ' |\t|,' -v snm="$name_str" \
+		$METASET | /usr/xpg4/bin/awk -F ' |\t|,' -v snm="$name_str" \
 		    -v mstr="$mn_str" '$0 ~ snm { \
 		    if (index($0, mstr) == 0) print $4 \
 		}' > $TMPFILE 2>&1
--- old/usr/src/cmd/mdb/tools/scripts/hdr2map.sh	2013-05-27 09:45:12.059685521 +0000
+++ new/usr/src/cmd/mdb/tools/scripts/hdr2map.sh	2013-05-27 09:45:12.068316520 +0000
@@ -23,8 +23,6 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 #
 # Given a header file, extract function prototypes and global variable
@@ -112,7 +110,7 @@
 	typeset header="$1"
 	typeset prefix="$2"
 
-	nawk -v prefix="$prefix" <$header '
+	/usr/xpg4/bin/awk -v prefix="$prefix" <$header '
 		/^.*MAPFILE: export \"[^\"]*\"$/ {
 			if (protoexclude) {
 				print "ERROR: export after exclude\n";
@@ -194,7 +192,7 @@
 	typeset skel="$1"
 	typeset secname="$2"
 
-	nawk <$skel -v name=$secname -v skel=$skel '
+	/usr/xpg4/bin/awk <$skel -v name=$secname -v skel=$skel '
 	    /\/\* [^ ]* [^ ]* \*\// && $3 == name {
 		if ($2 == "BEGIN") {
 			printing = 1;
--- old/usr/src/cmd/mdb/tools/scripts/map2linktest.sh	2013-05-27 09:45:12.428102449 +0000
+++ new/usr/src/cmd/mdb/tools/scripts/map2linktest.sh	2013-05-27 09:45:12.441970477 +0000
@@ -23,8 +23,6 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 #
 # Create dummy functions for each of the functions in the module API.  We can
@@ -33,7 +31,7 @@
 # If the module uses functions outside of the module API, then it cannot be
 # used as a kmdb module.
 #
-nawk '
+/usr/xpg4/bin/awk '
 	/^[ 	]*global:[ 	]*$/ {
 		printing = 1;
 		next;
--- old/usr/src/cmd/mdb/tools/scripts/tigen.sh	2013-05-27 09:45:12.786358694 +0000
+++ new/usr/src/cmd/mdb/tools/scripts/tigen.sh	2013-05-27 09:45:12.799842943 +0000
@@ -54,7 +54,7 @@
 	typeset skel="$1"
 	typeset secname="$2"
 
-	nawk <$skel -v name=$secname -v skel=$skel '
+	/usr/xpg4/bin/awk <$skel -v name=$secname -v skel=$skel '
 	    /\/\* [^ ]* [^ ]* \*\// && $3 == name {
 		if ($2 == "BEGIN") {
 			printing = 1;
--- old/usr/src/cmd/print/scripts/conv_lpd	2013-05-27 09:45:13.116758439 +0000
+++ new/usr/src/cmd/print/scripts/conv_lpd	2013-05-27 09:45:13.132472008 +0000
@@ -24,8 +24,6 @@
 # Copyright (c) 1994, 1995, 1996 by Sun Microsystems, Inc.
 # All Rights Reserved
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 #  Printcap <-> Printers.conf conversion utility...
 #
 #	Usage: conv_lpd [ -c (printers|printcap) ] [ -n ] (file)
@@ -103,7 +101,7 @@
 # Empty colons ":[ <TAB>]*:" are now stripped.  Continue processing.
 #
 
-nawk '
+/usr/xpg4/bin/awk '
 BEGIN {
 	"uname -n" | getline ; 
 	host = $0 ;
--- old/usr/src/cmd/print/scripts/getmakes	2013-05-27 09:45:13.444889557 +0000
+++ new/usr/src/cmd/print/scripts/getmakes	2013-05-27 09:45:13.454618402 +0000
@@ -22,8 +22,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 #
 # get a list of the Manufacturers from the ppdcache
@@ -31,7 +29,7 @@
 
 [[ -f /var/lp/ppd/ppdcache ]] || exit 1
 /bin/cat /var/lp/ppd/ppdcache |
-    nawk '{FS=":"; print $1}' |
-    nawk '{print $1}' |
+    /usr/xpg4/bin/awk '{FS=":"; print $1}' |
+    /usr/xpg4/bin/awk '{print $1}' |
     /bin/sort -u
 exit 0
--- old/usr/src/cmd/print/scripts/getmodels	2013-05-27 09:45:13.755093390 +0000
+++ new/usr/src/cmd/print/scripts/getmodels	2013-05-27 09:45:13.764704179 +0000
@@ -22,8 +22,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 #
 # get a list of the Models for this Model from the ppdcache
@@ -41,5 +39,5 @@
 
 cachefile=/var/lp/ppd/ppdcache
 [[ -f $cachefile ]] || exit 1
-/bin/grep "^$1" $cachefile | nawk '{FS=":"; print $2}' | uniq 
+/bin/grep "^$1" $cachefile | /usr/xpg4/bin/awk '{FS=":"; print $2}' | uniq 
 exit 0
--- old/usr/src/cmd/print/scripts/getppdfile	2013-05-27 09:45:14.083282615 +0000
+++ new/usr/src/cmd/print/scripts/getppdfile	2013-05-27 09:45:14.093731576 +0000
@@ -22,8 +22,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 #
 # Get the path/ppdfilename for this ppd NickName
@@ -62,13 +60,13 @@
 fi
 
 [[ -f /var/lp/ppd/ppdcache ]] || exit 1
-make=$(echo $* | /usr/bin/nawk '{FS=":"; print $1}')
+make=$(echo $* | /usr/xpg4/bin/awk '{FS=":"; print $1}')
 # strip leading blanks
-model=$(echo $* | /usr/bin/nawk '{FS=":"; print $2}' |
+model=$(echo $* | /usr/xpg4/bin/awk '{FS=":"; print $2}' |
     /bin/sed -e 's/^[ ]*//')
-extppdlabel=$(echo $* | /usr/bin/nawk '{FS=":"; print $3}' |
+extppdlabel=$(echo $* | /usr/xpg4/bin/awk '{FS=":"; print $3}' |
     /bin/sed -e 's/^[ ]*//')
-ppd=$(echo $* | /usr/bin/nawk '{FS=":"; print $4}' |
+ppd=$(echo $* | /usr/xpg4/bin/awk '{FS=":"; print $4}' |
     /bin/sed -e 's/^[ ]*//')
 
 #
@@ -83,6 +81,6 @@
     /bin/grep "${model}:" |
     /bin/grep "${ppd}:"  |
     /bin/grep "$(rep_path ${extppdlabel})/${extppdlabel%\(*}" |
-    /usr/bin/nawk '{FS=":"; print $6}' 
+    /usr/xpg4/bin/awk '{FS=":"; print $6}' 
 
 exit 0
--- old/usr/src/cmd/print/scripts/ppdfilename2mmp	2013-05-27 09:45:14.419328871 +0000
+++ new/usr/src/cmd/print/scripts/ppdfilename2mmp	2013-05-27 09:45:14.432590988 +0000
@@ -22,8 +22,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 #
 # Get the make/model/nickname as well as the repository/label from ppdfilename
@@ -57,14 +55,14 @@
 # Use only the first word in manufacturer entry
 #
 manuf=$(echo "$cacheentry" | 
-nawk '{FS=":"; print $1}' |
-nawk '{print $1}')
+/usr/xpg4/bin/awk '{FS=":"; print $1}' |
+/usr/xpg4/bin/awk '{print $1}')
 
 # Retrieve the model
-model=$(echo "$cacheentry" | nawk '{FS=":"; print $2}')
+model=$(echo "$cacheentry" | /usr/xpg4/bin/awk '{FS=":"; print $2}')
 
 # Retrieve the driver
-driver=$(echo "$cacheentry" | nawk '{FS=":"; print $3}')
+driver=$(echo "$cacheentry" | /usr/xpg4/bin/awk '{FS=":"; print $3}')
 
 #
 # Retrieve the PPD path.  Parse the PPD path to get the
@@ -74,7 +72,7 @@
 # in the cache entry.  This is may need to be modified if the
 # format changes.
 #
-ppdpath=$(echo "$cacheentry" | /bin/nawk '{FS=":"; print $6}' )
+ppdpath=$(echo "$cacheentry" | /usr/xpg4/bin/awk '{FS=":"; print $6}' )
 manupath=$(/bin/dirname "$ppdpath")
 labelpath=$(/bin/dirname "$manupath")
 
--- old/usr/src/cmd/sendmail/cf/sh/check-permissions.sh	2013-05-27 09:45:14.706655798 +0000
+++ new/usr/src/cmd/sendmail/cf/sh/check-permissions.sh	2013-05-27 09:45:14.715578866 +0000
@@ -30,7 +30,6 @@
 # Use is subject to license terms.
 #
 # %W% (Sun) %G%
-# ident	"%Z%%M%	%I%	%E% SMI"
 
 PATH=/bin
 
@@ -103,14 +102,14 @@
 # user.  O/w, do it for all arguments.
 
 if [ $# -eq 0 ] ; then
-	arg=`id | nawk -F'(' '{n = split($2,id,")"); print id[1]}'`
+	arg=`id | /usr/xpg4/bin/awk -F'(' '{n = split($2,id,")"); print id[1]}'`
 elif [ $1 = "ALL" ] ; then
 	arg=""
 else
 	arg="$*"
 fi
 
-for i in `getent passwd $arg | nawk -F: '{print $6}'`
+for i in `getent passwd $arg | /usr/xpg4/bin/awk -F: '{print $6}'`
 do
 	if [ -f $i/.forward ] ; then
 		break_down $i/.forward
--- old/usr/src/cmd/sendmail/lib/smtp-sendmail	2013-05-27 09:45:15.810046318 +0000
+++ new/usr/src/cmd/sendmail/lib/smtp-sendmail	2013-05-27 09:45:15.836716049 +0000
@@ -96,7 +96,7 @@
 		/usr/sbin/etrn -b $SERVER $CLIENTS >/dev/null 2>&1 &
 	done
 
-	if /usr/bin/nawk 'BEGIN{s = 1}
+	if /usr/xpg4/bin/awk 'BEGIN{s = 1}
 	    $2 == "/var/mail" && $3 == "nfs" && $4 !~ /actimeo=0/ &&
 	    $4 !~ /noac/{s = 0} END{exit s}' /etc/mnttab; then
 
--- old/usr/src/cmd/sgs/packages/Makefile.targ	2013-05-27 09:45:16.197842569 +0000
+++ new/usr/src/cmd/sgs/packages/Makefile.targ	2013-05-27 09:45:16.208831869 +0000
@@ -22,7 +22,7 @@
 # Use is subject to license terms.
 
 pkginfo: ../common/pkginfo.tmpl awk_pkginfo
-	$(RM) $@; nawk -f awk_pkginfo ../common/$@.tmpl > $@
+	$(RM) $@; /usr/xpg4/bin/awk -f awk_pkginfo ../common/$@.tmpl > $@
 
 pkg: FRC
 	@ $(RM) -r $(PACKAGE)
--- old/usr/src/cmd/sgs/tools/chkmsg.sh	2013-05-27 09:45:16.553351259 +0000
+++ new/usr/src/cmd/sgs/tools/chkmsg.sh	2013-05-27 09:45:16.561995223 +0000
@@ -24,7 +24,6 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
 
 TOOLDIR="${SRC}/cmd/sgs/tools/"
 
@@ -37,7 +36,7 @@
 while getopts "m:" Arg
 do
 	case $Arg in
-	m)	nawk -f ${TOOLDIR}/catalog.awk $OPTARG ;;
+	m)	/usr/xpg4/bin/awk -f ${TOOLDIR}/catalog.awk $OPTARG ;;
 	\?)	echo "usage: chkmsg -m msgfile source-files" ; exit 1 ;;
 	esac
 done
@@ -64,7 +63,7 @@
 #
 # Generate the lists for the source files and sort them
 #
-nawk -f  ${TOOLDIR}/getmessage.awk	$*
+/usr/xpg4/bin/awk -f  ${TOOLDIR}/getmessage.awk	$*
 
 if [ -s MSG_INTL_LIST ] ; then
 	sed -e "s/_32$//" -e "s/_64$//" MSG_INTL_LIST | sort | uniq > _TMP
--- old/usr/src/cmd/svc/milestone/fs-local	2013-05-27 09:45:16.864558026 +0000
+++ new/usr/src/cmd/svc/milestone/fs-local	2013-05-27 09:45:16.874323585 +0000
@@ -53,19 +53,19 @@
 #
 
 # vlist is the non-global filesystems in vfstab requesting quotas
-vlist=`/usr/bin/nawk '$1 !~ /^(#|-)/ && $4 == "ufs" {
+vlist=`/usr/xpg4/bin/awk '$1 !~ /^(#|-)/ && $4 == "ufs" {
 	if (match($7, "(^|,)(quota|rq)(,|$)") != 0 &&
 	    match($7, "(^|,)global(,|$)") == 0) print $1; }' /etc/vfstab`
 
 if [ -n "$vlist" ]; then
 	# mlist is the filesystems in mnttab that are ufs, mounted rw,
 	# and without quotas turned on
-	mlist=`/usr/sbin/mount -p | /usr/bin/nawk '$4 == "ufs" {
+	mlist=`/usr/sbin/mount -p | /usr/xpg4/bin/awk '$4 == "ufs" {
 		if (match($7, "(^|,)ro(,|$)") == 0) print $1; }'`
 
 	# qlist is the intersection of vlist and mlist
 	qlist=`echo "$vlist\n-\n$mlist" | \
-		/usr/bin/nawk '{if ($1 == "-") { mlist = 1; }
+		/usr/xpg4/bin/awk '{if ($1 == "-") { mlist = 1; }
 			else if (mlist == 0) { vlist[$1] = 1; }
 			else if (vlist[$1]) { print $1; } }'`
 
--- old/usr/src/cmd/svc/milestone/fs-usr	2013-05-27 09:45:17.243973292 +0000
+++ new/usr/src/cmd/svc/milestone/fs-usr	2013-05-27 09:45:17.264720655 +0000
@@ -180,7 +180,7 @@
 			exit $SMF_EXIT_OK
 		fi
 		boot_prop=`/usr/sbin/svccfg -s svc:/system/boot-config:default listprop config/auto-reboot-safe | \
-			/usr/bin/nawk '{ print $3}'`
+			/usr/xpg4/bin/awk '{ print $3}'`
 		if [ "$boot_prop" != "true" ]; then 
 			cecho ""
 			cecho "WARNING: Reboot required."
--- old/usr/src/cmd/svc/milestone/net-loc	2013-05-27 09:45:17.638851324 +0000
+++ new/usr/src/cmd/svc/milestone/net-loc	2013-05-27 09:45:17.651185814 +0000
@@ -46,7 +46,7 @@
 LDAPCLIENT=/usr/sbin/ldapclient
 MKDIR=/usr/bin/mkdir
 MV=/usr/bin/mv
-NAWK=/usr/bin/nawk
+AWK=/usr/xpg4/bin/awk
 NWAMADM=/usr/sbin/nwamadm
 NWAMCFG=/usr/sbin/nwamcfg
 RM=/usr/bin/rm
@@ -75,7 +75,7 @@
 	#    or INFORMATION state
 	# 2. make a space-separated list of interface names
 	#
-	netstat -D -f inet | $NAWK '
+	netstat -D -f inet | $AWK '
 	    $2 ~ /BOUND/ { printf "%s ", $1 }
 	    $2 ~ /INFORMATION/ { printf "%s ", $1 }'
 }
@@ -215,18 +215,18 @@
 
 		# Write DNS settings
 		if [ -n "$DNS_DOMAIN" ]; then
-			echo "$DNS_DOMAIN" | $NAWK \
+			echo "$DNS_DOMAIN" | $AWK \
 			    '{ for (i = 1; i <= NF; i++) \
 			    print "domain ", $i }' >> $file.$$
 		fi
 		if [ -n "$DNS_SEARCH" ]; then
-			echo "$DNS_SEARCH" | $NAWK \
+			echo "$DNS_SEARCH" | $AWK \
                             '{ printf("search"); \
 			    for (i = 1; i <= NF; i++) printf(" %s", $i); \
 			    printf("\n") }' >> $file.$$
 		fi
 		if [ -n "$DNS_SERVERS" ]; then
-			echo "$DNS_SERVERS" | $NAWK \
+			echo "$DNS_SERVERS" | $AWK \
 			    '{ for (i = 1; i <= NF; i++) \
 			    print "nameserver ", $i }' >> $file.$$
 		fi
@@ -273,7 +273,7 @@
 		'dhcp')
 			# Use only the first name
 			DEFAULT_DOMAIN=`get_dhcpinfo NISdmain | \
-			    $NAWK '{ print $1 }'`
+			    $AWK '{ print $1 }'`
 			NIS_SERVERS=`get_dhcpinfo NISservs`
 			$DOMAINNAME $DEFAULT_DOMAIN
 			$DOMAINNAME > $ETC_DEFAULT_DOMAIN
@@ -288,7 +288,7 @@
 			$MKDIR -p $NIS_BIND_PATH/$DEFAULT_DOMAIN
 		fi
 		if [ -n "$NIS_SERVERS" ]; then
-			echo "$NIS_SERVERS" | $NAWK \
+			echo "$NIS_SERVERS" | $AWK \
 			    '{ for (i = 1; i <= NF; i++) print $i }' \
 			    > $NIS_BIND_PATH/$DEFAULT_DOMAIN/ypservers
 		fi
--- old/usr/src/cmd/svc/milestone/net-nwam	2013-05-27 09:45:18.087149152 +0000
+++ new/usr/src/cmd/svc/milestone/net-nwam	2013-05-27 09:45:18.097276079 +0000
@@ -57,7 +57,7 @@
 LDAPCLIENT=/usr/sbin/ldapclient
 MKDIR=/usr/bin/mkdir
 MKFIFO=/usr/bin/mkfifo
-NAWK=/usr/bin/nawk
+AWK=/usr/xpg4/bin/awk
 NWAMCFG=/usr/sbin/nwamcfg
 RM=/usr/bin/rm
 SVCADM=/usr/sbin/svcadm
@@ -174,11 +174,11 @@
 			DNS_NAMESERVICE_CONFIGSRC="dhcp"
 		else
 			DNS_NAMESERVICE_CONFIGSRC="manual"
-			DNS_NAMESERVICE_DOMAIN=`$NAWK '$1 == "domain" {\
+			DNS_NAMESERVICE_DOMAIN=`$AWK '$1 == "domain" {\
 			    print $2 }' < /etc/resolv.conf`
-			DNS_NAMESERVICE_SERVERS=`$NAWK '$1 == "nameserver" \
+			DNS_NAMESERVICE_SERVERS=`$AWK '$1 == "nameserver" \
 			    { printf "%s,", $2 }' < /etc/resolv.conf`
-			DNS_NAMESERVICE_SEARCH=`$NAWK '$1 == "search" \
+			DNS_NAMESERVICE_SEARCH=`$AWK '$1 == "search" \
 			    { printf "%s,", $2 }' < /etc/resolv.conf`
 			copy_to_legacy_loc /etc/resolv.conf
 		fi
@@ -190,14 +190,14 @@
 		NIS_NAMESERVICE_CONFIGSRC="manual"
 		DEFAULT_DOMAIN=`$CAT /etc/defaultdomain`
 
-		yp_servers=`$NAWK '{ printf "%s ", $1 }' \
+		yp_servers=`$AWK '{ printf "%s ", $1 }' \
 		    < $NIS_BIND_PATH/$DEFAULT_DOMAIN/ypservers`
 		for serv in $yp_servers; do
 			if is_valid_addr $serv; then
 				addr="$serv,"
 			else
 				addr=`$GREP -iw $serv /etc/inet/hosts | \
-				    $NAWK '{ printf "%s,", $1 }'`
+				    $AWK '{ printf "%s,", $1 }'`
 			fi
 			NIS_NAMESERVICE_SERVERS="${NIS_NAMESERVICE_SERVERS}$addr"
 		done
@@ -209,7 +209,7 @@
 		NAMESERVICES="${NAMESERVICES}ldap,"
 		LDAP_NAMESERVICE_CONFIGSRC="manual"
 		LDAP_NAMESERVICE_SERVERS=`$LDAPCLIENT list 2>/dev/null | \
-		    $NAWK '$1 == "preferredServerList:" { print $2 }'`
+		    $AWK '$1 == "preferredServerList:" { print $2 }'`
 		DEFAULT_DOMAIN=`$CAT /etc/defaultdomain`
 	fi
 
@@ -365,7 +365,7 @@
 			$MKDIR -p $NIS_BIND_PATH/$DEFAULT_DOMAIN
 		fi
 		if [ -n "$NIS_SERVERS" ]; then
-			echo "$NIS_SERVERS" | $NAWK \
+			echo "$NIS_SERVERS" | $AWK \
 			    'FS="," { for (i = 1; i <= NF; i++) print $i }' \
 			    > $NIS_BIND_PATH/$DEFAULT_DOMAIN/ypservers
 		fi
@@ -421,7 +421,7 @@
 		# change /none, /allow, and /deny to firewall policy
 		if [ "$ipf_file" = "/none" -o "$ipf_file" = "/allow" \
 		    -o "$ipf_file" = "/deny" ]; then
-			policy=`echo "$ipf_file" | $NAWK 'FS="/" { print $2 }'`
+			policy=`echo "$ipf_file" | $AWK 'FS="/" { print $2 }'`
 			set_smf_prop $IPFILTER_FMRI \
 			    firewall_config_default/policy $policy
 			# no need to clear custom_policy_file as it isn't "custom"
--- old/usr/src/cmd/svc/milestone/net-routing-setup	2013-05-27 09:45:18.500339545 +0000
+++ new/usr/src/cmd/svc/milestone/net-routing-setup	2013-05-27 09:45:18.514820797 +0000
@@ -53,7 +53,7 @@
 # routing daemons (or at least they are enabled to run).
 #
 dynamic_routing_test=`/sbin/routeadm -p | \
-nawk '/^ipv[46]-routing [.]*/ { print $2 }'  | /usr/bin/grep "current=enabled"`
+/usr/xpg4/bin/awk '/^ipv[46]-routing [.]*/ { print $2 }'  | /usr/bin/grep "current=enabled"`
 if [ -n "$dynamic_routing_test" ]; then
 	dynamic_routing="true"
 fi
--- old/usr/src/cmd/svc/milestone/net-svc	2013-05-27 09:45:18.917132774 +0000
+++ new/usr/src/cmd/svc/milestone/net-svc	2013-05-27 09:45:18.933061691 +0000
@@ -137,7 +137,7 @@
 		/usr/bin/touch /etc/resolv.conf
 	fi
 	export dnsservers dnsdomain
-	/usr/bin/nawk </etc/resolv.conf >/tmp/resolv.conf.$$ '
+	/usr/xpg4/bin/awk </etc/resolv.conf >/tmp/resolv.conf.$$ '
 		function writedomain() {
 			if (updated == 0) {
 			    	# Use only first domain, not a search list
@@ -219,7 +219,7 @@
 #
 cleanup_hosts ()
 {
-	/usr/bin/nawk '{
+	/usr/xpg4/bin/awk '{
 		if (index($0, "# Added by DHCP") == 0 ||
 		    $1 == "127.0.0.1" || $1 == "::1") {
 			print $0
--- old/usr/src/cmd/svc/shell/net_include.sh	2013-05-27 09:45:19.279781249 +0000
+++ new/usr/src/cmd/svc/shell/net_include.sh	2013-05-27 09:45:19.298149101 +0000
@@ -719,7 +719,7 @@
 	(
 		# Find datalinks using VLAN 1 explicitly
 		# configured by dladm
-		/usr/bin/nawk '
+		/usr/xpg4/bin/awk '
 			/^#/ || NF < 2 { next }
 			{ linkdata[$1]=$2; }
 			/;vid=int,1;/ {
@@ -730,7 +730,7 @@
 				sub(/;.*/, "", link);
 				print link;
 			}' $datalink
-	) | ( /usr/bin/sort -u; echo END; cat $datalink ) | /usr/bin/nawk '
+	) | ( /usr/bin/sort -u; echo END; cat $datalink ) | /usr/xpg4/bin/awk '
 	    /^END$/ { state=1; }
 	    state == 0 { usingpvid[++nusingpvid]=$1; next; }
 	    /^#/ || NF < 2 { next; }
--- old/usr/src/cmd/svc/shell/routing_include.sh	2013-05-27 09:45:19.710822138 +0000
+++ new/usr/src/cmd/svc/shell/routing_include.sh	2013-05-27 09:45:19.719206957 +0000
@@ -169,7 +169,7 @@
 	pos=$OPTIND
 	for prop in $4
 	do
-		val=`/usr/bin/echo $2 | /usr/bin/nawk -v POS=$pos \
+		val=`/usr/bin/echo $2 | /usr/xpg4/bin/awk -v POS=$pos \
 		    '{ print $POS }'`
 		if [ -z "$val" ]; then
 			val="$5"
@@ -188,8 +188,8 @@
 get_daemon_args()
 {
 	args=`/usr/sbin/svccfg -s $1 listprop routeadm/daemon-args | \
-	    /usr/bin/nawk '{ for (i = 3; i <= NF; i++) printf "%s ", $i }' | \
-	    /usr/bin/nawk '{sub(/^\"/, ""); sub(/\"[ \t]*$/,""); print}'`
+	    /usr/xpg4/bin/awk '{ for (i = 3; i <= NF; i++) printf "%s ", $i }' | \
+	    /usr/xpg4/bin/awk '{sub(/^\"/, ""); sub(/\"[ \t]*$/,""); print}'`
 	echo "$args"
 }
 
@@ -210,7 +210,7 @@
 
 get_routeadm_property()
 {
-	propval=`/sbin/routeadm -l $1 | /usr/bin/nawk -v PROP=$2 \
+	propval=`/sbin/routeadm -l $1 | /usr/xpg4/bin/awk -v PROP=$2 \
 	    '($1 == PROP) { for (i = 3; i < NF; i++) printf $i" "; \
 	    if (NF >= 3) {printf $NF}}'`
 	echo "$propval"
@@ -255,10 +255,10 @@
 {
 	# get property values, removing trailing delimiter.
 	propvals=`get_routeadm_property $1 $2 | \
-	    /usr/bin/nawk '{sub(/;[ \t]*$/, ""); print }'`
+	    /usr/xpg4/bin/awk '{sub(/;[ \t]*$/, ""); print }'`
 	# Substitute switch for internal delimiters.
 	fixed_propvals=`/usr/bin/echo $propvals | \
-	    /usr/bin/nawk -v SWITCH=" -${3} " \
+	    /usr/xpg4/bin/awk -v SWITCH=" -${3} " \
 	    '{sub(/;/, SWITCH); print }'`
 	if [ -n "$fixed_propvals" ]; then
 		echo "-${3} $fixed_propvals"
--- old/usr/src/cmd/svr4pkg/pkgscripts/i.CompCpio.sh	2013-05-27 09:45:20.095203338 +0000
+++ new/usr/src/cmd/svr4pkg/pkgscripts/i.CompCpio.sh	2013-05-27 09:45:20.106576321 +0000
@@ -98,7 +98,7 @@
 Rm=usr/bin/rm
 Ln=usr/bin/ln
 Mv=usr/bin/mv
-Nawk=usr/bin/nawk
+Awk=usr/xpg4/bin/awk
 Zcat=usr/bin/zcat
 
 # Set up the default paths
@@ -110,8 +110,8 @@
 ZCAT_cmd=$ZCAT_xpath/zcat
 LN_xpath=/usr/bin
 LN_cmd=$LN_xpath/ln
-NAWK_xpath=/usr/bin
-NAWK_cmd=$NAWK_xpath/nawk
+AWK_xpath=/usr/xpg4/bin/
+AWK_cmd=$AWK_xpath/awk
 RM_xpath=/usr/bin
 RM_cmd=$RM_xpath/rm
 Tmp_xpath=/usr/tmp$$dir
@@ -119,7 +119,7 @@
 rm_cpio=0
 rm_ln=0
 rm_zcat=0
-rm_nawk=0
+rm_awk=0
 rm_rm=0
 rm_mv=0
 no_select=0
@@ -158,7 +158,7 @@
 			$Cpio)		rm_cpio=1; Spcl_exec=1;;
 			$Ln)		rm_ln=1; Spcl_exec=1;;
 			$Zcat)		rm_zcat=1; Spcl_exec=1;;
-			$Nawk)		rm_nawk=1; Spcl_exec=1;;
+			$Awk)		rm_awk=1; Spcl_exec=1;;
 			$Rm)		rm_rm=1; Spcl_exec=1;;
 			$Mv)		rm_mv=1; Spcl_exec=1;;
 		esac
@@ -207,11 +207,11 @@
 				LN_cmd="$Tmp_xpath/ln"
 				Movelist="$1 ln $Movelist"
 				rm_ln=0
-			elif [ $rm_nawk -eq 1 ]; then
-				$LN_cmd -s ../..$Tmp_xpath/nawk $1
-				NAWK_cmd="$Tmp_xpath/nawk"
-				Movelist="$1 nawk $Movelist"
-				rm_nawk=0
+			elif [ $rm_awk -eq 1 ]; then
+				$LN_cmd -s ../..$Tmp_xpath/awk $1
+				AWK_cmd="$Tmp_xpath/awk"
+				Movelist="$1 awk $Movelist"
+				rm_awk=0
 			elif [ $rm_zcat -eq 1 ]; then
 				$LN_cmd -s ../..$Tmp_xpath/zcat $1
 				ZCAT_cmd="$Tmp_xpath/zcat"
@@ -240,7 +240,7 @@
 #
 exec_clean() {	# $1 =1 means be quiet
 	if [ ! -z "${Movelist}" ]; then
-		echo $Movelist | $NAWK_cmd '
+		echo $Movelist | $AWK_cmd '
 			{ split ($0, line)
 			for (n=1; n <= NF; n++) {
 				print line[n]
@@ -264,7 +264,7 @@
 					$Cpio)	CPIO_cmd="$CPIO_xpath/cpio";;
 					$Ln)	LN_cmd="$LN_xpath/ln";;
 					$Zcat)	ZCAT_cmd="$ZCAT_xpath/zcat";;
-					$Nawk)	NAWK_cmd="$NAWK_xpath/nawk";;
+					$Awk)	AWK_cmd="$AWK_xpath/awk";;
 					$Rm)	RM_cmd="$RM_xpath/rm";;
 					$Mv)	MV_cmd="$MV_xpath/mv";;
 				esac
@@ -418,7 +418,7 @@
 			# If there's a path containing a '$' then we can't
 			# use the extraction list because of the shell
 			if [ $list_empty -eq 0 ]; then
-				s=`LD_PRELOAD="$Ld_Preload" $NAWK_cmd ' /\\$/ { print } ' $FILELIST`
+				s=`LD_PRELOAD="$Ld_Preload" $AWK_cmd ' /\\$/ { print } ' $FILELIST`
 
 				if [ ! -z "${s}" ]; then
 					is_a_filelist=0
@@ -449,7 +449,7 @@
 			# If there's a path containing a '$' then we can't
 			# use the extraction list because of the shell
 			if [ $list_empty -eq 0 ]; then
-				s=`LD_PRELOAD="$Ld_Preload" $NAWK_cmd ' /\\$/ { print } ' $FILELIST`
+				s=`LD_PRELOAD="$Ld_Preload" $AWK_cmd ' /\\$/ { print } ' $FILELIST`
 
 				if [ ! -z "${s}" ]; then
 					is_a_filelist=0
--- old/usr/src/cmd/svr4pkg/pkgscripts/i.awk.sh	2013-05-27 09:45:20.469729088 +0000
+++ new/usr/src/cmd/svr4pkg/pkgscripts/i.awk.sh	2013-05-27 09:45:20.478410639 +0000
@@ -37,7 +37,7 @@
 
 	if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
 		client_dest=`echo $dest | \
-			/usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+			/usr/xpg4/bin/awk -v rootdir="$PKG_INSTALL_ROOT" '{
 				{ print substr($0, length(rootdir)+1)} }'`
 		savepath=$PKGSAV/awk${client_dest}
 	else
--- old/usr/src/cmd/svr4pkg/pkgscripts/i.build.sh	2013-05-27 09:45:20.813028981 +0000
+++ new/usr/src/cmd/svr4pkg/pkgscripts/i.build.sh	2013-05-27 09:45:20.824228922 +0000
@@ -37,7 +37,7 @@
 
 	if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
 		client_dest=`echo $dest | \
-			/usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+			/usr/xpg4/bin/awk -v rootdir="$PKG_INSTALL_ROOT" '{
 				{ print substr($0, length(rootdir)+1)} }'`
 		savepath=$PKGSAV/build${client_dest}
 	else
--- old/usr/src/cmd/svr4pkg/pkgscripts/i.sed.sh	2013-05-27 09:45:21.133530549 +0000
+++ new/usr/src/cmd/svr4pkg/pkgscripts/i.sed.sh	2013-05-27 09:45:21.147315524 +0000
@@ -37,7 +37,7 @@
 
 	if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
 		client_dest=`echo $dest | \
-			/usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+			/usr/xpg4/bin/awk -v rootdir="$PKG_INSTALL_ROOT" '{
 				{ print substr($0, length(rootdir)+1)} }'`
 		savepath=$PKGSAV/sed${client_dest}
 	else
--- old/usr/src/cmd/svr4pkg/pkgscripts/r.awk.sh	2013-05-27 09:45:21.488685938 +0000
+++ new/usr/src/cmd/svr4pkg/pkgscripts/r.awk.sh	2013-05-27 09:45:21.501490969 +0000
@@ -41,7 +41,7 @@
 
 		if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
 			client_dest=`echo $dest | \
-				/usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+				/usr/xpg4/bin/awk -v rootdir="$PKG_INSTALL_ROOT" '{
 				    { print substr($0, length(rootdir)+1)} }'`
 			savepath=$PKGSAV/awk${client_dest}
 		else
--- old/usr/src/cmd/svr4pkg/pkgscripts/r.build.sh	2013-05-27 09:45:21.827998214 +0000
+++ new/usr/src/cmd/svr4pkg/pkgscripts/r.build.sh	2013-05-27 09:45:21.836932860 +0000
@@ -41,7 +41,7 @@
 
 		if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
 			client_dest=`echo $dest | \
-				/usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+				/usr/xpg4/bin/awk -v rootdir="$PKG_INSTALL_ROOT" '{
 				    { print substr($0, length(rootdir)+1)} }'`
 			savepath=$PKGSAV/build${client_dest}
 		else
--- old/usr/src/cmd/svr4pkg/pkgscripts/r.sed.sh	2013-05-27 09:45:22.146566911 +0000
+++ new/usr/src/cmd/svr4pkg/pkgscripts/r.sed.sh	2013-05-27 09:45:22.156067226 +0000
@@ -41,7 +41,7 @@
 
 		if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
 			client_dest=`echo $dest | \
-				/usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+				/usr/xpg4/bin/awk -v rootdir="$PKG_INSTALL_ROOT" '{
 				    { print substr($0, length(rootdir)+1)} }'`
 			savepath=$PKGSAV/sed${client_dest}
 		else
--- old/usr/src/cmd/tsol/demo/runwlabel.ksh	2013-05-27 09:45:22.443018239 +0000
+++ new/usr/src/cmd/tsol/demo/runwlabel.ksh	2013-05-27 09:45:22.452864356 +0000
@@ -22,8 +22,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
-#
 #
 # Usage:
 # runwlabel "my-label" my-program
@@ -39,7 +37,7 @@
 progname="$2"
 
 # Find the zone name that is associated with this zone path
-for zone in `zoneadm list -pi | nawk -F: -v zonepath=${zonepath} '{
+for zone in `zoneadm list -pi | /usr/xpg4/bin/awk -F: -v zonepath=${zonepath} '{
 	if ("$4" == "${zonepath}") {
 		print $2
 	}
--- old/usr/src/cmd/tsol/zones/zoneshare.sh	2013-05-27 09:45:22.759692775 +0000
+++ new/usr/src/cmd/tsol/zones/zoneshare.sh	2013-05-27 09:45:22.772151235 +0000
@@ -22,8 +22,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
-#
 # zoneshare  -- share zone resources
 
 # Processes a non-global zone's dfstab file after translating
@@ -76,6 +74,6 @@
 do
 	echo $line
 done < $infile |
-	`egrep -v "(^[#])" | nawk  -v rootpath=$rootpath \
+	`egrep -v "(^[#])" | /usr/xpg4/bin/awk -v rootpath=$rootpath \
 	    '/share/ { ORS = " "; for (i = 1; i < NF; i++) print $i ; \
 	     print rootpath $NF ";" } ' | /sbin/sh`
--- old/usr/src/cmd/tsol/zones/zoneunshare.sh	2013-05-27 09:45:23.187332936 +0000
+++ new/usr/src/cmd/tsol/zones/zoneunshare.sh	2013-05-27 09:45:23.197592830 +0000
@@ -22,8 +22,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
-#
 # zoneunshare  -- unshare zone resources
 
 # Processes the specified sharetab file and unshare
@@ -74,4 +72,4 @@
 do
 	echo $line
 done < $infile |
-	`egrep "^$rootpath"|nawk '{ print "/usr/sbin/unshare " $1 ";" }'|/sbin/sh`
+	`egrep "^$rootpath"|/usr/xpg4/bin/awk '{ print "/usr/sbin/unshare " $1 ";" }'|/sbin/sh`
--- old/usr/src/cmd/ypcmd/multi.awk.sh	2013-05-27 09:45:23.575150220 +0000
+++ new/usr/src/cmd/ypcmd/multi.awk.sh	2013-05-27 09:45:23.588299086 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/nawk -f
+#!/usr/xpg4/bin/awk -f
 #
 # CDDL HEADER START
 #
@@ -21,8 +21,6 @@
 # CDDL HEADER END
 #
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
-#
 # Copyright (c) 1996, by Sun Microsystems, Inc.
 # All rights reserved.
 #
--- old/usr/src/cmd/ypcmd/net_files/Makefile	2013-05-27 09:45:23.983618959 +0000
+++ new/usr/src/cmd/ypcmd/net_files/Makefile	2013-05-27 09:45:23.993803650 +0000
@@ -94,11 +94,11 @@
 
 passwd.time: $(PWDIR)/passwd $(PWDIR)/shadow
 	-@if [ -f $(PWDIR)/security/passwd.adjunct ]; then \
-		(nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ { $$2 = "##" $$1; printf "%s\t%s\n", $$1, $$0 }' $(PWDIR)/passwd $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byname; \
-		(nawk 'BEGIN { FS=":"; OFS=":"  } /^[a-zA-Z0-9_]/ { $$2 = "##" $$1; printf "%-10d\t%s\n", $$3, $$0 }' $(PWDIR)/passwd $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byuid; \
+		(/usr/xpg4/bin/awk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ { $$2 = "##" $$1; printf "%s\t%s\n", $$1, $$0 }' $(PWDIR)/passwd $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byname; \
+		(/usr/xpg4/bin/awk 'BEGIN { FS=":"; OFS=":"  } /^[a-zA-Z0-9_]/ { $$2 = "##" $$1; printf "%-10d\t%s\n", $$3, $$0 }' $(PWDIR)/passwd $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byuid; \
 	elif [ -f $(PWDIR)/shadow ]; then \
-		(nawk 'BEGIN { FS=":"; OFS=":"; while ( getline < "$(PWDIR)/shadow" > 0) shadow[$$1] = $$2; } /^[a-zA-Z0-9_]/ { $$2 = shadow[$$1]; printf "%s\t%s\n",$$1,$$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byname; \
-		(nawk 'BEGIN { FS=":"; OFS=":"; while ( getline < "$(PWDIR)/shadow" > 0) shadow[$$1] = $$2; } /^[a-zA-Z0-9_]/ { $$2 = shadow[$$1]; printf "%-10d\t%s\n",$$3,$$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byuid; \
+		(/usr/xpg4/bin/awk 'BEGIN { FS=":"; OFS=":"; while ( getline < "$(PWDIR)/shadow" > 0) shadow[$$1] = $$2; } /^[a-zA-Z0-9_]/ { $$2 = shadow[$$1]; printf "%s\t%s\n",$$1,$$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byname; \
+		(/usr/xpg4/bin/awk 'BEGIN { FS=":"; OFS=":"; while ( getline < "$(PWDIR)/shadow" > 0) shadow[$$1] = $$2; } /^[a-zA-Z0-9_]/ { $$2 = shadow[$$1]; printf "%-10d\t%s\n",$$3,$$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byuid; \
 	else \
 		(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/passwd  $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byname; \
 		(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { printf("%-10d ", $$3); print $$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byuid; \
@@ -289,7 +289,7 @@
 
 passwd.adjunct.time: $(PWDIR)/security/passwd.adjunct $(PWDIR)/shadow
 	-@if [ -f $(PWDIR)/shadow ]; then \
-		(nawk 'BEGIN { FS=":"; while (getline < "$(PWDIR)/shadow" > 0) shadow[$$1] = $$2; } /^[a-zA-Z0-9_]/ { $$2 = shadow[$$1]; OFS=":"; printf "%s\t%s\n", $$1, $$0 }' $(PWDIR)/security/passwd.adjunct $(CHKPIPE)) | $(MAKEDBM) -s - $(YPDBDIR)/$(DOM)/passwd.adjunct.byname; \
+		(/usr/xpg4/bin/awk 'BEGIN { FS=":"; while (getline < "$(PWDIR)/shadow" > 0) shadow[$$1] = $$2; } /^[a-zA-Z0-9_]/ { $$2 = shadow[$$1]; OFS=":"; printf "%s\t%s\n", $$1, $$0 }' $(PWDIR)/security/passwd.adjunct $(CHKPIPE)) | $(MAKEDBM) -s - $(YPDBDIR)/$(DOM)/passwd.adjunct.byname; \
 	else \
 		(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/security/passwd.adjunct $(CHKPIPE)) | \
 		$(MAKEDBM) -s - $(YPDBDIR)/$(DOM)/passwd.adjunct.byname; \
@@ -366,7 +366,7 @@
 		sed -e "/^#/d" -e s/#.*$$// $(RBACDIR)/auth_attr \
 		|sed -e '/\\$$/{:l' -e 'N;s/\\\n//;t h' -e ':h' \
 		-e 's/\\$$/\\/;t l' -e } \
-		| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
+		| (/usr/xpg4/bin/awk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
 		{printf "%s:%s\n", $$1, $$0 }' $(CHKPIPE)) \
 		| $(MAKEDBM) -S ":" -E - $(YPDBDIR)/$(DOM)/auth_attr; \
 		touch auth.attr.time; \
@@ -386,7 +386,7 @@
 		sed -e "/^#/d" -e s/#.*$$// $(RBACDIR)/exec_attr \
 		|sed -e '/\\$$/{:l' -e 'N;s/\\\n//;t h' -e ':h' \
 		-e 's/\\$$/\\/;t l' -e } \
-		| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
+		| (/usr/xpg4/bin/awk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
 		{printf "%s:%s:%s:%s\n", $$1, $$2, $$6, $$0 }' $(CHKPIPE)) \
 		| $(MAKEDBM) -S ":" -E -D 2 - $(YPDBDIR)/$(DOM)/exec_attr; \
 		touch exec.attr.time; \
@@ -406,7 +406,7 @@
 		sed -e "/^#/d" -e s/#.*$$// $(RBACDIR)/prof_attr \
 		|sed -e '/\\$$/{:l' -e 'N;s/\\\n//;t h' -e ':h' \
 		-e 's/\\$$/\\/;t l' -e } \
-		| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
+		| (/usr/xpg4/bin/awk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
 		{printf "%s:%s\n", $$1, $$0 }' $(CHKPIPE)) \
 		| $(MAKEDBM) -S ":" -E - $(YPDBDIR)/$(DOM)/prof_attr; \
 		touch prof.attr.time; \
@@ -426,7 +426,7 @@
 		sed -e "/^#/d" -e s/#.*$$// $(DIR)/user_attr \
 		|sed -e '/\\$$/{:l' -e 'N;s/\\\n//;t h' -e ':h' \
 		-e 's/\\$$/\\/;t l' -e } \
-		| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
+		| (/usr/xpg4/bin/awk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
 		{printf "%s:%s\n", $$1, $$0 }' $(CHKPIPE)) \
 		| $(MAKEDBM) -S ":" -E - $(YPDBDIR)/$(DOM)/user_attr; \
 		touch user.attr.time; \
--- old/usr/src/cmd/ypcmd/ypstart.sh	2013-05-27 09:45:24.426904975 +0000
+++ new/usr/src/cmd/ypcmd/ypstart.sh	2013-05-27 09:45:24.439924797 +0000
@@ -23,8 +23,6 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 # Enable appropriate NIS daemons based on the current configuration.
 
 enable () {
@@ -66,7 +64,7 @@
 		passwdfile=/var/yp/$domain/passwd.byname
 	fi
 	master=`/usr/sbin/makedbm -u $passwdfile | grep YP_MASTER_NAME \
-	    | nawk '{ print tolower($2) }'`
+	    | /usr/xpg4/bin/awk '{ print tolower($2) }'`
 fi
 
 # Enabling the YP client is not strictly necessary, but it is
--- old/usr/src/cmd/zic/do_pofile.sh	2013-05-27 09:45:24.835463369 +0000
+++ new/usr/src/cmd/zic/do_pofile.sh	2013-05-27 09:45:24.849878991 +0000
@@ -3,12 +3,11 @@
 # Copyright (c) 2001 by Sun Microsystems, Inc.
 # All rights reserved.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
 
 #
 # Create messages file for zone_sun.tab, country.tab, continent.tab
 #
-AWK=/usr/bin/nawk
+AWK=/usr/xpg4/bin/awk
 ECHO=/usr/bin/echo
 
 ZONE_SUN_FILE=zone_sun.tab
--- old/usr/src/cmd/zic/tzselect.ksh	2013-05-27 09:45:25.212906719 +0000
+++ new/usr/src/cmd/zic/tzselect.ksh	2013-05-27 09:45:25.230713455 +0000
@@ -38,7 +38,7 @@
 #	mawk
 #	</a>
 
-AWK=/usr/bin/nawk
+AWK=/usr/xpg4/bin/awk
 GREP=/usr/bin/grep
 EXPR=/usr/bin/expr
 LOCALE=/usr/bin/locale
--- old/usr/src/cmd/zoneadm/svc-zones	2013-05-27 09:45:25.588467329 +0000
+++ new/usr/src/cmd/zoneadm/svc-zones	2013-05-27 09:45:25.597788802 +0000
@@ -30,7 +30,7 @@
 #
 shutdown_zones()
 {
-	zoneadm list -p | nawk -F: '{
+	zoneadm list -p | /usr/xpg4/bin/awk -F: '{
 		if ($2 != "global") {
 			print $2
 		}
@@ -57,7 +57,7 @@
 	# set and invoke the sysboot hook for all other installed zones.
 	#
 	ZONES=""
-	for zone in `zoneadm list -pi | nawk -F: '{
+	for zone in `zoneadm list -pi | /usr/xpg4/bin/awk -F: '{
 			if ($3 == "installed") {
 				print $2
 			}
--- old/usr/src/common/mapfiles/gen/Makefile	2013-05-27 09:45:25.946864771 +0000
+++ new/usr/src/common/mapfiles/gen/Makefile	2013-05-27 09:45:25.957843793 +0000
@@ -23,8 +23,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 include		$(SRC)/Makefile.master
 
@@ -98,10 +96,10 @@
 %map.noexeglobs:main.c $(TEMPLATE1) $(TEMPLATE2)
 	$(LINK) -o $(MAIN1) -M$(TEMPLATE1) main.c
 	$(ELFDUMP) -s -N.dynsym $(MAIN1) | $(EGREP) "WEAK|GLOB" | \
-	    $(GREP) -v UNDEF | $(NAWK) '{print $$9 }' | $(SORT) > $(SYMS1)
+	    $(GREP) -v UNDEF | $(AWK) '{print $$9 }' | $(SORT) > $(SYMS1)
 	$(LINK) -o $(MAIN2) -M$(TEMPLATE2) main.c
 	$(ELFDUMP) -s -N.dynsym $(MAIN2) | $(EGREP) "WEAK|GLOB" | \
-	    $(GREP) -v UNDEF | $(NAWK) '{print $$9 }' | $(SORT) > $(SYMS2)
+	    $(GREP) -v UNDEF | $(AWK) '{print $$9 }' | $(SORT) > $(SYMS2)
 	$(ECHO) "# GENERATED FILE - DO NOT EDIT"	>  $@
 	$(GREP) MAP-HEAD $(TEMPLATE2) | \
 	    $(SED) -e "s/	*# MAP-HEAD//"		>> $@
--- old/usr/src/head/Makefile	2013-05-27 09:45:26.354111397 +0000
+++ new/usr/src/head/Makefile	2013-05-27 09:45:26.373546479 +0000
@@ -467,8 +467,8 @@
 
 mdiox.h:	../uts/common/sys/lvm/mdiox.x
 	$(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mdiox.x | \
-	nawk '{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
-	nawk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
+	/usr/xpg4/bin/awk '{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
+	/usr/xpg4/bin/awk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
 	awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
 	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
 	{ print $0 } \
@@ -476,7 +476,7 @@
 
 metamed.h:	../uts/common/sys/lvm/metamed.x
 	$(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/metamed.x | \
-	nawk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
+	/usr/xpg4/bin/awk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
 	awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
 	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
 	{ print $0 } \
--- old/usr/src/lib/Makefile.lib	2013-05-27 09:45:26.763885646 +0000
+++ new/usr/src/lib/Makefile.lib	2013-05-27 09:45:26.779424084 +0000
@@ -30,7 +30,7 @@
 
 LORDER=		lorder
 TSORT=		tsort
-AWK=		awk
+AWK=		/usr/xpg4/bin/awk
 
 #
 # By default, we define the source directory for libraries to be
--- old/usr/src/lib/brand/shared/zone/common.ksh	2013-05-27 09:45:27.133460539 +0000
+++ new/usr/src/lib/brand/shared/zone/common.ksh	2013-05-27 09:45:27.143979461 +0000
@@ -249,7 +249,7 @@
 #
 get_fs_info()
 {
-	zonecfg -z $zonename info fs | nawk '{
+	zonecfg -z $zonename info fs | /usr/xpg4/bin/awk '{
 		if ($1 == "options:") {
 			# Remove brackets.
 			options=substr($2, 2, length($2) - 2);
@@ -274,7 +274,7 @@
 	fi
 
 	# Sort the fs entries so we can handle nested mounts.
-	sort $fstmpfile | nawk -v zonepath=$zonepath '{
+	sort $fstmpfile | /usr/xpg4/bin/awk -v zonepath=$zonepath '{
 		if (NF == 4)
 			options="-o " $4;
 		else
@@ -304,7 +304,7 @@
 	fi
 
 	# Reverse sort the fs entries so we can handle nested unmounts.
-	sort -r $fstmpfile | nawk -v zonepath=$zonepath '{
+	sort -r $fstmpfile | /usr/xpg4/bin/awk -v zonepath=$zonepath '{
 		cmd="/usr/sbin/umount " zonepath "/root" $1
 		if (system(cmd) != 0) {
 			printf("command failed: %s\n", cmd);
@@ -315,7 +315,7 @@
 # Find the dataset mounted on the zonepath.
 get_zonepath_ds() {
 	ZONEPATH_DS=`/usr/sbin/zfs list -H -t filesystem -o name,mountpoint | \
-	    /usr/bin/nawk -v zonepath=$1 '{
+	    /usr/xpg4/bin/awk -v zonepath=$1 '{
 		if ($2 == zonepath)
 			print $1
 	}'`
@@ -569,7 +569,7 @@
 
 	vlog "$m_analyse_archive"
 
-	base=`$stage1 $archive | $stage2 2>/dev/null | nawk -F/ '{
+	base=`$stage1 $archive | $stage2 2>/dev/null | /usr/xpg4/bin/awk -F/ '{
 		# Check for an absolute path archive
 		if (substr($0, 1, 1) == "/")
 			exit 1
--- old/usr/src/lib/brand/shared/zone/uninstall.ksh	2013-05-27 09:45:27.607123821 +0000
+++ new/usr/src/lib/brand/shared/zone/uninstall.ksh	2013-05-27 09:45:27.621872216 +0000
@@ -249,7 +249,7 @@
 uninstall_get_zonepath_ds()
 {
 	ZONEPATH_DS=`/sbin/zfs list -t filesystem -o name,mountpoint | \
-	    /bin/nawk -v zonepath=$zonepath '{
+	    /usr/xpg4/bin/awk -v zonepath=$zonepath '{
 		if ($2 == zonepath)
 			print $1
 	}'`
--- old/usr/src/lib/brand/solaris10/zone/common.ksh	2013-05-27 09:45:28.050116721 +0000
+++ new/usr/src/lib/brand/solaris10/zone/common.ksh	2013-05-27 09:45:28.060345539 +0000
@@ -106,7 +106,7 @@
 	#
 	image_vers="unknown"
 	if [[ -f $dir/var/sadm/system/admin/INST_RELEASE ]]; then
-		image_vers=$(nawk -F= '{if ($1 == "VERSION") print $2}' \
+		image_vers=$(/usr/xpg4/bin/awk -F= '{if ($1 == "VERSION") print $2}' \
 		    $dir/var/sadm/system/admin/INST_RELEASE)
 	fi
 
@@ -139,7 +139,7 @@
 	found=0
 	for i in $dir/var/sadm/pkg/SUNWcakr*/pkginfo
 	do
-		patches=$(nawk -F= '{if ($1 == "PATCHLIST") print $2}' $i)
+		patches=$(/usr/xpg4/bin/awk -F= '{if ($1 == "PATCHLIST") print $2}' $i)
 		for patch in $patches
 		do
 			if [[ $patch == $req_patch ]]; then
@@ -313,7 +313,7 @@
 {
         typeset ZONENAME="$1"
 
-	ZONEUUID=`zoneadm -z $ZONENAME list -p | nawk -F: '{print $5}'`
+	ZONEUUID=`zoneadm -z $ZONENAME list -p | /usr/xpg4/bin/awk -F: '{print $5}'`
 	[[ $? -ne 0 || -z $ZONEUUID ]] && return 1
 
 	INSTANCE_UUID="urn:st:${ZONEUUID}"
--- old/usr/src/lib/brand/solaris10/zone/p2v.ksh	2013-05-27 09:45:28.433662468 +0000
+++ new/usr/src/lib/brand/solaris10/zone/p2v.ksh	2013-05-27 09:45:28.443974789 +0000
@@ -101,7 +101,7 @@
 		return
 	fi
 
-	NETIF=$(echo $NET | /usr/bin/nawk '{
+	NETIF=$(echo $NET | /usr/xpg4/bin/awk '{
 		for (i = 1; i < NF; i++) {
 			if ($i == "physical:") {
 				if (length(net) == 0) {
@@ -150,7 +150,7 @@
 		return
 	fi
 
-	/usr/bin/nawk '{
+	/usr/xpg4/bin/awk '{
 		if (substr($1, 0, 1) == "#") {
 			print $0
 		} else {
@@ -198,7 +198,7 @@
 		return
 	fi
 
-	/usr/bin/nawk '{
+	/usr/xpg4/bin/awk '{
 		if (substr($1, 0, 1) == "#") {
 			print $0
 		} else if ($1 == "fd" || $1 == "/proc" || $1 == "swap" ||
@@ -261,7 +261,7 @@
 		/usr/bin/egrep -s "SUNW_PKG_HOLLOW=true" \
 		    $ZONEROOT/var/sadm/pkg/$pkg/pkginfo || continue
 
-		for j in $(/usr/bin/nawk '{if ($2 == "f" &&
+		for j in $(/usr/xpg4/bin/awk '{if ($2 == "f" &&
 		    substr($4, 1, 17) == "var/svc/manifest/") print $4}' \
 		    $ZONEROOT/var/sadm/pkg/$pkg/save/pspool/$pkg/pkgmap)
 		do
@@ -326,7 +326,7 @@
 
 	# Get a list of the svcs that now exist in the zone.
 	LANG=C /usr/sbin/zlogin -S $ZONENAME /usr/bin/svcs -aH | \
-	    /usr/bin/nawk '{print $3}' >>$insttmpfile
+	    /usr/xpg4/bin/awk '{print $3}' >>$insttmpfile
 
 	[[ -n $LOGFILE ]] && \
 	    printf "[$(date)] ${MSG_PREFIX}${v_svcsinzone}\n" >&2
@@ -456,7 +456,7 @@
 		return
 	fi
 
-	NGZ=$(/usr/bin/nawk -F: '{
+	NGZ=$(/usr/xpg4/bin/awk -F: '{
 		if (substr($1, 0, 1) == "#" || $1 == "global")
 			continue
 
@@ -469,7 +469,7 @@
 
 	log "$v_rmzones" "$NGZ"
 
-	NGZP=$(/usr/bin/nawk -F: '{
+	NGZP=$(/usr/xpg4/bin/awk -F: '{
 		if (substr($1, 0, 1) == "#" || $1 == "global")
 			continue
 
@@ -582,7 +582,7 @@
 #
 
 STACK_TYPE=$(/usr/sbin/zoneadm -z $ZONENAME list -p | \
-    /usr/bin/nawk -F: '{print $7}')
+    /usr/xpg4/bin/awk -F: '{print $7}')
 if (( $? != 0 )); then
 	error "$e_badinfo" "stacktype"
 fi
@@ -625,7 +625,7 @@
 	grep 'SUNW_PKG_HOLLOW=true' $pkg_name/pkginfo >/dev/null 2>&1 && \
 	    basename $pkg_name >>$hollow_pkgs
 done
-/usr/bin/nawk -v hollowpkgs=$hollow_pkgs -v filelist=$hollow_file_list \
+/usr/xpg4/bin/awk -v hollowpkgs=$hollow_pkgs -v filelist=$hollow_file_list \
     -v dirlist=$hollow_dir_list '
 	BEGIN {
 		while (getline p <hollowpkgs > 0)
--- old/usr/src/lib/libbsm/mkhdr.sh	2013-05-27 09:45:28.843851842 +0000
+++ new/usr/src/lib/libbsm/mkhdr.sh	2013-05-27 09:45:28.857001936 +0000
@@ -76,7 +76,7 @@
 
 EOF
 
-nawk -F: '{if ((NF == 4) && substr($1,0,1) != "#")
+/usr/xpg4/bin/awk -F: '{if ((NF == 4) && substr($1,0,1) != "#")
 		if ($1 >= 2048) {
 			tlen = length($2);
 
--- old/usr/src/lib/libdtrace/common/mknames.sh	2013-05-27 09:45:29.236738277 +0000
+++ new/usr/src/lib/libdtrace/common/mknames.sh	2013-05-27 09:45:29.245854804 +0000
@@ -24,7 +24,6 @@
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 
 echo "\
 /*\n\
@@ -32,8 +31,6 @@
  * Use is subject to license terms.\n\
  */\n\
 \n\
-#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n\
-\n\
 #include <dtrace.h>\n\
 \n\
 /*ARGSUSED*/
@@ -42,7 +39,7 @@
 {\n\
 	switch (subr) {"
 
-nawk '
+/usr/xpg4/bin/awk '
 /^#define[ 	]*DIF_SUBR_/ && $2 != "DIF_SUBR_MAX" {
 	printf("\tcase %s: return (\"%s\");\n", $2, tolower(substr($2, 10)));
 }'
--- old/usr/src/lib/libsecdb/common/i.rbac	2013-05-27 09:45:29.646011677 +0000
+++ new/usr/src/lib/libsecdb/common/i.rbac	2013-05-27 09:45:29.658809844 +0000
@@ -49,7 +49,7 @@
 cp_cmd=cp
 egrep_cmd=egrep
 mv_cmd=mv
-nawk_cmd=nawk
+awk_cmd=/usr/xpg4/bin/awk
 rm_cmd=rm
 sed_cmd=sed
 sort_cmd=sort
@@ -59,7 +59,7 @@
 # $3 is the "new (to be merged)" file
 # $4 is the output file
 # returns 0 on success
-# returns 2 on failure if nawk fails with non-zero exit status
+# returns 2 on failure if awk fails with non-zero exit status
 #
 dbmerge() {
 #
@@ -153,21 +153,21 @@
  	    -e '/\\$/{N;s/\\\n//;}'  -e '/\\$/{N;s/\\\n//;}' \
  	    $3 > $4.new
 #
-# The nawk script below processes the old and new files using up to
+# The awk script below processes the old and new files using up to
 # three passes.  If the old file is empty, only the final pass over
 # the new file is required.
 #
 	if [ -s $4.old ]; then
-		nawk_pass1=$4.old
-		nawk_pass2=$4.new
-		nawk_pass3=$4.new
+		awk_pass1=$4.old
+		awk_pass2=$4.new
+		awk_pass3=$4.new
 	else
-		nawk_pass1=
-		nawk_pass2=
-		nawk_pass3=$4.new
+		awk_pass1=
+		awk_pass2=
+		awk_pass3=$4.new
 	fi
 #
-#!/usr/bin/nawk -f
+#!/usr/xpg4/bin/awk -f
 #
 #       dbmerge type=[auth|prof|user|exec] [ old-file new-file ] new-file
 #
@@ -198,7 +198,7 @@
 #	which will appear first in the output.
 #
 #
-	$nawk_cmd  '
+	$awk_cmd  '
 
 # This script may be invoked with up to three file names.  Each file
 # name corresponds to a separate processing pass.  The passes are
@@ -234,7 +234,7 @@
 	FS=":"
 }
 
-# When FNR (current file record number) is 1 it indicates that nawk
+# When FNR (current file record number) is 1 it indicates that awk
 # is starting to read the next file specified on its command line,
 # and is beginning the next processing pass.
 FNR == 1 {
@@ -242,15 +242,15 @@
 }
 
 /^#/ || /^$/ {
-	continue;
+	next;
 }
 
 {
-	# For each input line, nawk automatically assigns the complete
+	# For each input line, awk automatically assigns the complete
 	# line to $0 and also splits the line at field separators and
 	# assigns each field to a variable $1..$n.  Assignment to $0
 	# re-splits the line into the field variables.  Conversely,
-	# assgnment to a variable $1..$n will cause $0 to be recomputed
+	# assignment to a variable $1..$n will cause $0 to be recomputed
 	# from the field variable values.
 	#
 	# This code adds awareness of escaped field separators by using
@@ -420,7 +420,7 @@
 	return keyword "=" unsplit(list, cnt, ",");
 }
 
-# This function is similar to the nawk built-in split() function,
+# This function is similar to the awk built-in split() function,
 # except that a "\" character may be used to escape any subsequent
 # character, so that the escaped character will not be treated as a
 # field separator or as part of a field separator regular expression.
@@ -471,7 +471,7 @@
 		str = str delim list[i];
 	return str;
 }' \
-	type=$1 $nawk_pass1 $nawk_pass2 $nawk_pass3 > $4.unsorted
+	type=$1 $awk_pass1 $awk_pass2 $awk_pass3 > $4.unsorted
 	rc=$?
 	$sort_cmd < $4.unsorted >> $4
 	return $rc
--- old/usr/src/lib/libshell/common/tests/quoting.sh	2013-05-27 09:45:30.064908807 +0000
+++ new/usr/src/lib/libshell/common/tests/quoting.sh	2013-05-27 09:45:30.073068467 +0000
@@ -329,7 +329,7 @@
 } 2> /dev/null || err_exit 'skipping over `` failed'
 [[ $x == x ]] || err_exit 'assignment ${x:=`...`} failed'
 [[ $($SHELL -c 'print a[') == 'a[' ]] || err_exit "unbalanced '[' in command arg fails"
-$SHELL -c $'false && (( `wc -l /dev/null | nawk \'{print $1}\'` > 2 )) && true;:' 2> /dev/null ||  err_exit 'syntax error with ` in arithmetic expression'
+$SHELL -c $'false && (( `wc -l /dev/null | /usr/xpg4/bin/awk \'{print $1}\'` > 2 )) && true;:' 2> /dev/null ||  err_exit 'syntax error with ` in arithmetic expression'
 { $SHELL  -c '((  1`: "{ }"` ))' ;} 2> /dev/null || err_exit 'problem with ` inside (())'
 varname=foobarx
 x=`print '"\$'${varname}'"'`
--- old/usr/src/lib/libshell/common/tests/sun_solaris_builtin_sum.sh	2013-05-27 09:45:30.413636316 +0000
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_builtin_sum.sh	2013-05-27 09:45:30.428521399 +0000
@@ -93,7 +93,7 @@
 [[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]]	|| err_exit "pipe: /usr/bin/sum $x != sum $x"
 [[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]]			|| err_exit "file: /usr/bin/sum $x != sum $x"
 
-x="/usr/bin/nawk"
+x="/usr/xpg4/bin/awk"
 [[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]]	|| err_exit "pipe: /usr/bin/sum $x != sum $x"
 [[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]]			|| err_exit "file: /usr/bin/sum $x != sum $x"
 
--- old/usr/src/lib/libsmbfs/Makefile.com	2013-05-27 09:45:30.792607330 +0000
+++ new/usr/src/lib/libsmbfs/Makefile.com	2013-05-27 09:45:30.802191814 +0000
@@ -116,7 +116,7 @@
 
 # Filter out the less important lint.
 # See lgrep.awk
-LGREP =	nawk -f $(SRCDIR)/lgrep.awk
+LGREP =	/usr/xpg4/bin/awk -f $(SRCDIR)/lgrep.awk
 LTAIL	+=	2>&1 | $(LGREP)
 
 all:	$(LIBS)
--- old/usr/src/lib/libsmbfs/smb/lgrep.awk	2013-05-27 09:45:31.170412073 +0000
+++ new/usr/src/lib/libsmbfs/smb/lgrep.awk	2013-05-27 09:45:31.186782807 +0000
@@ -28,7 +28,7 @@
 
 # This is a "lint tail" that removes all the
 # uninteresting lines from our lint output.
-# It's nawk because sed doesn't do (a|b).
+# It's awk because sed doesn't do (a|b).
 # Also comments are easier here.
 
 # There's no lintlib for krb5 yet (CR 6911968)
--- old/usr/src/lib/libxcurses/Makefile	2013-05-27 09:45:31.600805118 +0000
+++ new/usr/src/lib/libxcurses/Makefile	2013-05-27 09:45:31.612073122 +0000
@@ -72,16 +72,15 @@
 	@cd $@; pwd; $(MAKE) $(TARGET)
 
 # derived C files
-# mknames.awk defines functions so needs nawk
 $(NAMES) : src/libc/xcurses/mknames.awk src/libc/xcurses/caps
 	$(RM) $(NAMES)
-	cd src/libc/xcurses; $(NAWK) -f mknames.awk caps
+	cd src/libc/xcurses; $(AWK) -f mknames.awk caps
 
 h/term.h : src/libc/xcurses/mkterm.awk src/libc/xcurses/caps
 	$(RM) $@
-	cd src/libc/xcurses; $(NAWK) -f mkterm.awk caps > term.h
+	cd src/libc/xcurses; $(AWK) -f mkterm.awk caps > term.h
 	$(MV) src/libc/xcurses/term.h h/term.h
 
 src/libc/xcurses/keyindex.c : src/libc/xcurses/mkkey.awk src/libc/xcurses/caps
 	$(RM) $@
-	cd src/libc/xcurses; $(NAWK) -f mkkey.awk caps > keyindex.c
+	cd src/libc/xcurses; $(AWK) -f mkkey.awk caps > keyindex.c
--- old/usr/src/lib/libxcurses2/Makefile	2013-05-27 09:45:31.996466073 +0000
+++ new/usr/src/lib/libxcurses2/Makefile	2013-05-27 09:45:32.007827595 +0000
@@ -80,16 +80,15 @@
 	@cd $@; pwd; $(MAKE) $(TARGET)
 
 # derived C files
-# mknames.awk defines functions so needs nawk
 $(NAMES) : src/libc/xcurses/mknames.awk src/libc/xcurses/caps
 	$(RM) $(NAMES)
-	cd src/libc/xcurses; $(NAWK) -f mknames.awk caps
+	cd src/libc/xcurses; $(AWK) -f mknames.awk caps
 
 h/term.h : src/libc/xcurses/mkterm.awk src/libc/xcurses/caps
 	$(RM) $@
-	cd src/libc/xcurses; $(NAWK) -f mkterm.awk caps > term.h
+	cd src/libc/xcurses; $(AWK) -f mkterm.awk caps > term.h
 	$(MV) src/libc/xcurses/term.h h/term.h
 
 src/libc/xcurses/keyindex.c : src/libc/xcurses/mkkey.awk src/libc/xcurses/caps
 	$(RM) $@
-	cd src/libc/xcurses; $(NAWK) -f mkkey.awk caps > keyindex.c
+	cd src/libc/xcurses; $(AWK) -f mkkey.awk caps > keyindex.c
--- old/usr/src/lib/lvm/libmeta/Makefile.com	2013-05-27 09:45:32.407044737 +0000
+++ new/usr/src/lib/lvm/libmeta/Makefile.com	2013-05-27 09:45:32.421838805 +0000
@@ -22,8 +22,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 LIBRARY=       	libmeta.a 
 VERS=          	.1 
@@ -160,11 +158,11 @@
 
 mdiox_xdr.c: $(SRC)/uts/common/sys/lvm/mdiox.x
 	$(RPCGEN) $(RPCGENFLAGS) -c -i 100 $(SRC)/uts/common/sys/lvm/mdiox.x | \
-	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
+	/usr/xpg4/bin/awk  '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
 
 meta_basic_xdr.c: $(SRC)/uts/common/sys/lvm/meta_basic.x
 	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/meta_basic.x | \
-	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
+	/usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
 
 metad_clnt.c: $(SRC)/head/metad.x 
 	$(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metad.x -o $@
@@ -174,11 +172,11 @@
 
 metamed_clnt.c: $(SRC)/uts/common/sys/lvm/metamed.x
 	$(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/uts/common/sys/lvm/metamed.x | \
-	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
+	/usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
 
 metamed_xdr.c: $(SRC)/uts/common/sys/lvm/metamed.x 
 	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/metamed.x | \
-	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
+	/usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
 
 metamhd_clnt.c: $(SRC)/head/metamhd.x 
 	$(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metamhd.x -o $@
@@ -188,7 +186,7 @@
 
 mhdx_xdr.c: $(SRC)/uts/common/sys/lvm/mhdx.x
 	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/mhdx.x | \
-	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
+	/usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
 
 mdmn_commd_xdr.c: $(SRC)/uts/common/sys/lvm/mdmn_commd.x
 	$(RPCGEN) -c $(SRC)/uts/common/sys/lvm/mdmn_commd.x -o $@
--- old/usr/src/lib/smbsrv/libsmb/Makefile	2013-05-27 09:45:32.849050037 +0000
+++ new/usr/src/lib/smbsrv/libsmb/Makefile	2013-05-27 09:45:32.862057732 +0000
@@ -32,5 +32,5 @@
 include ../Makefile.smbsrv
 
 $(GENSRCS): common/smb_status_gen.awk $(SRC)/uts/common/smb/ntstatus.h
-	nawk -f common/smb_status_gen.awk \
+	/usr/xpg4/bin/awk -f common/smb_status_gen.awk \
 	  $(SRC)/uts/common/smb/ntstatus.h > $@
--- old/usr/src/man/man1/Makefile	2013-05-27 09:45:33.220738499 +0000
+++ new/usr/src/man/man1/Makefile	2013-05-27 09:45:33.230594995 +0000
@@ -245,7 +245,7 @@
 	 	msgget.1			\
 	 	mt.1				\
 	 	mv.1				\
-	 	nawk.1				\
+		nawk.1				\
 	 	nc.1				\
 	 	nca.1				\
 	 	ncab2clf.1			\
--- old/usr/src/man/man1/cputrack.1	2013-05-27 09:45:33.642895768 +0000
+++ new/usr/src/man/man1/cputrack.1	2013-05-27 09:45:33.657253199 +0000
@@ -235,7 +235,7 @@
 .sp
 .LP
 The output of \fBcputrack\fR is designed to be readily parseable by
-\fBnawk\fR(1) and \fBperl\fR(1), thereby allowing performance tools to be
+\fBawk\fR(1) and \fBperl\fR(1), thereby allowing performance tools to be
 composed by embedding \fBcputrack\fR in scripts. Alternatively, tools may be
 constructed directly using the same \fBAPI\fRs that \fBcputrack\fR is built
 upon, using the facilities of \fBlibcpc\fR(3LIB) and \fBlibpctx\fR(3LIB). See
@@ -411,7 +411,7 @@
 .SH SEE ALSO
 .sp
 .LP
-\fBnawk\fR(1), \fBperl\fR(1), \fBproc\fR(1), \fBtruss\fR(1), \fBprstat\fR(1M),
+\fBawk\fR(1), \fBperl\fR(1), \fBproc\fR(1), \fBtruss\fR(1), \fBprstat\fR(1M),
 \fBcpustat\fR(1M), \fBexec\fR(2), \fBexit\fR(2), \fBfork\fR(2),
 \fBsetuid\fR(2), \fBvfork\fR(2), \fBgethrtime\fR(3C), \fBstrtoll\fR(3C),
 \fBcpc\fR(3CPC), \fBcpc_bind_pctx\fR(3CPC), \fBcpc_enable\fR(3CPC),
--- old/usr/src/man/man1/nawk.1	2013-05-27 09:45:34.087271852 +0000
+++ new/usr/src/man/man1/nawk.1	2013-05-27 09:45:34.102564422 +0000
@@ -15,12 +15,6 @@
 .SH SYNOPSIS
 .LP
 .nf
-\fB/usr/bin/nawk\fR [\fB-F\fR \fIERE\fR] [\fB-v\fR \fIassignment\fR] \fI\&'program'\fR | \fB-f\fR \fIprogfile\fR...
-     [\fIargument\fR]...
-.fi
-
-.LP
-.nf
 \fB/usr/xpg4/bin/awk\fR [\fB-F\fR \fIERE\fR] [\fB-v\fR \fIassignment\fR]... \fI\&'program'\fR | \fB-f\fR \fIprogfile\fR...
      [\fIargument\fR]...
 .fi
@@ -28,7 +22,7 @@
 .SH DESCRIPTION
 .sp
 .LP
-The \fB/usr/bin/nawk\fR and \fB/usr/xpg4/bin/awk\fR utilities execute
+The \fB/usr/xpg4/bin/awk\fR utility executes
 \fIprogram\fRs written in the \fBnawk\fR programming language, which is
 specialized for textual data manipulation. A \fBnawk\fR \fIprogram\fR is a
 sequence of patterns and corresponding actions. The string specifying
--- old/usr/src/man/man1m/cpustat.1m	2013-05-27 09:45:34.563965439 +0000
+++ new/usr/src/man/man1m/cpustat.1m	2013-05-27 09:45:34.574152796 +0000
@@ -195,7 +195,7 @@
 frequently so that less than 4 billion clock cycles can occur between samples.
 .sp
 .LP
-The output of cpustat is designed to be readily parseable by \fBnawk\fR(1) and
+The output of cpustat is designed to be readily parseable by \fBawk\fR(1) and
 \fBperl\fR(1), thereby allowing performance tools to be composed by embedding
 \fBcpustat\fR in scripts. Alternatively, tools can be constructed directly
 using the same \fBAPI\fRs that \fBcpustat\fR is built upon using the facilities
@@ -341,7 +341,7 @@
 .SH SEE ALSO
 .sp
 .LP
-\fBcputrack\fR(1), \fBnawk\fR(1), \fBperl\fR(1), \fBiostat\fR(1M),
+\fBcputrack\fR(1), \fBawk\fR(1), \fBperl\fR(1), \fBiostat\fR(1M),
 \fBprstat\fR(1M), \fBpsrset\fR(1M), \fBvmstat\fR(1M), \fBcpc\fR(3CPC),
 \fBcpc_open\fR(3CPC), \fBcpc_bind_cpu\fR(3CPC), \fBgethrtime\fR(3C),
 \fBstrtoll\fR(3C), \fBlibcpc\fR(3LIB), \fBattributes\fR(5)
--- old/usr/src/man/man5/largefile.5	2013-05-27 09:45:34.961328093 +0000
+++ new/usr/src/man/man5/largefile.5	2013-05-27 09:45:34.969454258 +0000
@@ -45,7 +45,7 @@
 \fBgzip\fR	\fBhead\fR	\fBjoin\fR	\fBjsh\fR	\fBksh\fR
 \fBksh93\fR	\fBln\fR	\fBls\fR	\fBmailcompat\fR	\fBmailstats\fR
 \fBmdb\fR	\fBmkdir\fR	\fBmkfifo\fR	\fBmore\fR	\fBmv\fR
-\fBnawk\fR	\fBpage\fR	\fBpaste\fR	\fBpathchck\fR	\fBpg\fR
+\fBpage\fR	\fBpaste\fR	\fBpathchck\fR	\fBpg\fR
 \fBpraliases\fR	\fBrcp\fR	\fBremsh\fR	\fBrksh\fR	\fBrksh93\fR
 \fBrm\fR	\fBrmdir\fR	\fBrsh\fR	\fBsed\fR	\fBsh\fR
 \fBsort\fR	\fBsplit\fR	\fBsum\fR	\fBtail\fR	\fBtar\fR
--- old/usr/src/pkg/Makefile	2013-05-27 09:45:35.305761541 +0000
+++ new/usr/src/pkg/Makefile	2013-05-27 09:45:35.319856263 +0000
@@ -153,7 +153,7 @@
 sparc_ARCH64= sparcv9
 
 OPENSSL	=	/usr/bin/openssl
-OPENSSL10.cmd = $(OPENSSL) version | $(NAWK) '{if($$2<1){print "\043";}}'
+OPENSSL10.cmd = $(OPENSSL) version | $(AWK) '{if($$2<1){print "\043";}}'
 OPENSSL10_ONLY	=	$(OPENSSL10.cmd:sh)
 
 #
@@ -610,7 +610,7 @@
 	r=$${sdotr%.+(?)}; s=$${sdotr#+(?).}; \
 	print "Generating $$r $$s package list"; \
 	$(RM) $(@); $(TOUCH) $(@); \
-	$(NAWK) 'BEGIN { \
+	$(AWK) 'BEGIN { \
 		if (ARGC < 2) { \
 			exit; \
 		} \
@@ -663,7 +663,7 @@
 stage-licenses: license-list FRC
 	$(PKGDEBUG)$(MAKE) -e -f Makefile.lic \
 		PKGDEBUG=$(PKGDEBUG) LICROOT=$(PKGROOT)/licenses \
-		`$(NAWK) '{ \
+		`$(AWK) '{ \
 			print "$(PKGROOT)/licenses/" $$0; \
 			print "$(PKGROOT)/licenses/" $$0 ".descrip"; \
 		}' license-list` > /dev/null;
--- old/usr/src/pkg/manifests/system-extended-system-utilities.mf	2013-05-27 09:45:35.774207450 +0000
+++ new/usr/src/pkg/manifests/system-extended-system-utilities.mf	2013-05-27 09:45:35.784324585 +0000
@@ -114,7 +114,6 @@
 file path=usr/bin/lgrpinfo mode=0555
 file path=usr/bin/look mode=0755
 file path=usr/bin/mkfifo mode=0555
-file path=usr/bin/nawk mode=0555
 file path=usr/bin/newform mode=0555
 file path=usr/bin/news mode=0555
 file path=usr/bin/nl mode=0555
--- old/usr/src/test/zfs-tests/include/commands.cfg	2013-05-27 09:45:36.218530891 +0000
+++ new/usr/src/test/zfs-tests/include/commands.cfg	2013-05-27 09:45:36.228507760 +0000
@@ -93,7 +93,7 @@
 export MODUNLOAD="/usr/sbin/modunload"
 export MOUNT="/usr/sbin/mount"
 export MV="/usr/bin/mv"
-export NAWK="/usr/bin/nawk"
+export AWK="/usr/xpg4/bin/awk"
 export NCHECK="/usr/sbin/ncheck"
 export NEWFS="/usr/sbin/newfs"
 export PACK="/usr/bin/pack"
--- old/usr/src/test/zfs-tests/include/libtest.shlib	2013-05-27 09:45:36.644979614 +0000
+++ new/usr/src/test/zfs-tests/include/libtest.shlib	2013-05-27 09:45:36.658723457 +0000
@@ -687,7 +687,7 @@
 	fi
 
 	typeset -i endcyl=$($PRTVTOC -h /dev/rdsk/${disk}s2 |
-		$NAWK -v token="$slice" '{if ($1==token) print $6}')
+		$AWK -v token="$slice" '{if ($1==token) print $6}')
 
 	((endcyl = (endcyl + 1) / ratio))
 	echo $endcyl
@@ -1347,7 +1347,7 @@
 {
 	typeset disklist=""
 
-	disklist=$($ZPOOL iostat -v $1 | $NAWK '(NR >4) {print $1}' | \
+	disklist=$($ZPOOL iostat -v $1 | $AWK '(NR >4) {print $1}' | \
 	    $GREP -v "\-\-\-\-\-" | \
 	    $EGREP -v -e "^(mirror|raidz1|raidz2|spare|log|cache)$")
 
@@ -1469,7 +1469,7 @@
 	typeset token=$2
 	typeset keyword=$3
 
-	$ZPOOL status -v "$pool" 2>/dev/null | $NAWK -v token="$token:" '
+	$ZPOOL status -v "$pool" 2>/dev/null | $AWK -v token="$token:" '
 		($1==token) {print $0}' \
 	| $GREP -i "$keyword" > /dev/null 2>&1
 
@@ -1690,7 +1690,7 @@
 # we're creating the awk script.
 # -------------------
 	$CAT > /tmp/find_disks.awk <<EOF
-#!/bin/nawk -f
+#!/usr/xpg4/bin/awk -f
 	BEGIN { FS="."; }
 
 	/^Specify disk/{
@@ -2327,7 +2327,7 @@
 	typeset field=${3:-$pool}
 
 	state=$($ZPOOL status -v "$pool" 2>/dev/null | \
-		$NAWK -v device=$disk -v pool=$pool -v field=$field \
+		$AWK -v device=$disk -v pool=$pool -v field=$field \
 		'BEGIN {startconfig=0; startfield=0; }
 		/config:/ {startconfig=1}
 		(startconfig==1) && ($1==field) {startfield=1; next;}
@@ -2471,7 +2471,7 @@
 	typeset pos offset
 
 	$ECHO $1 | \
-		$NAWK -v pos=$2 -v offset=$3 '{print substr($0, pos, offset)}'
+		$AWK -v pos=$2 -v offset=$3 '{print substr($0, pos, offset)}'
 }
 
 #
--- old/usr/src/test/zfs-tests/tests/functional/acl/acl_common.kshlib	2013-05-27 09:45:37.176713832 +0000
+++ new/usr/src/test/zfs-tests/tests/functional/acl/acl_common.kshlib	2013-05-27 09:45:37.186992938 +0000
@@ -54,7 +54,7 @@
 		return 1
 	fi
 
-	$LS -vd $obj | $NAWK '(NR != 1) {print $0}'
+	$LS -vd $obj | $AWK '(NR != 1) {print $0}'
 }
 
 #
@@ -69,7 +69,7 @@
 		return 1
 	fi
 
-	$LS -Vd $obj | $NAWK '(NR != 1) {print $0}'
+	$LS -Vd $obj | $AWK '(NR != 1) {print $0}'
 }
 
 #
@@ -198,7 +198,7 @@
 		return 1
 	fi
 
-	$LS -vd $obj | $NAWK '(NR == 1) {print $1}' | $GREP "+\>" > /dev/null
+	$LS -vd $obj | $AWK '(NR == 1) {print $1}' | $GREP "+\>" > /dev/null
 
         return $?
 }
@@ -248,7 +248,7 @@
 		return 1
 	fi
 
-	$LS -vd $1 | $NAWK 'BEGIN {count=0}
+	$LS -vd $1 | $AWK 'BEGIN {count=0}
 			(NR != 1)&&(/[0-9]:/) {count++}
 			END {print count}'
 
--- old/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_006_pos.ksh	2013-05-27 09:45:37.556062296 +0000
+++ new/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_006_pos.ksh	2013-05-27 09:45:37.565956981 +0000
@@ -77,10 +77,10 @@
 	typeset file_size=$2
 	typeset refer_diff=$($ECHO "$refer_size - $estimate_size" | bc)
 	refer_diff=$($ECHO "$refer_diff / 1" | bc)
-	refer_diff=$($ECHO "$refer_diff" | $NAWK '{print ($1 < 0) ? ($1 * -1): $1'})
+	refer_diff=$($ECHO "$refer_diff" | $AWK '{print ($1 < 0) ? ($1 * -1): $1'})
 	typeset file_diff=$($ECHO "$file_size - $estimate_size" | bc)
 	file_diff=$($ECHO "$file_diff / 1" | bc)
-	file_diff=$($ECHO "$file_diff" | $NAWK '{print ($1 < 0) ? ($1 * -1):$1'})
+	file_diff=$($ECHO "$file_diff" | $AWK '{print ($1 < 0) ? ($1 * -1):$1'})
 	typeset expected_diff=$(cal_percentage $refer_size)
 
 	[[ -z $refer_diff && -z $file_diff && -z $expected_diff ]] && \
--- old/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh	2013-05-27 09:45:37.940405844 +0000
+++ new/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh	2013-05-27 09:45:37.949117283 +0000
@@ -77,9 +77,9 @@
 log_note "verify multiple snapshot transaction group"
 txg_group=$($ZDB -Pd $TESTPOOL | $GREP snap | $AWK '{print $7}')
 for i in 1 2 3; do
-	txg_tag=$($ECHO "$txg_group" | $NAWK -v j=$i 'FNR == j {print}')
+	txg_tag=$($ECHO "$txg_group" | $AWK -v j=$i 'FNR == j {print}')
 	[[ $txg_tag != $($ECHO "$txg_group" | \
-	    $NAWK -v j=$i 'FNR == j {print}') ]] \
+	    $AWK -v j=$i 'FNR == j {print}') ]] \
 	    && log_fail "snapshots belong to differnt transaction groups"
 done
 log_note "verify snapshot contents"
--- old/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_001_pos.ksh	2013-05-27 09:45:38.366394400 +0000
+++ new/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_001_pos.ksh	2013-05-27 09:45:38.374789211 +0000
@@ -70,7 +70,7 @@
 typeset expect_str3="The following filesystems are out of date, and can be upgraded"
 typeset -i COUNT OLDCOUNT
 
-$ZFS upgrade | $NAWK '$1 ~ "^[0-9]+$" {print $2}'> $oldoutput
+$ZFS upgrade | $AWK '$1 ~ "^[0-9]+$" {print $2}'> $oldoutput
 OLDCOUNT=$( $WC -l $oldoutput | $AWK '{print $1}' )
 
 old_datasets=""
@@ -98,7 +98,7 @@
 # we also check that the usage message contains at least a description
 # of the current ZFS version.
 log_must eval '$GREP "${expect_str1} $ZFS_VERSION" $output > /dev/null 2>&1'
-$ZFS upgrade | $NAWK '$1 ~ "^[0-9]+$" {print $2}'> $output
+$ZFS upgrade | $AWK '$1 ~ "^[0-9]+$" {print $2}'> $output
 COUNT=$( $WC -l $output | $AWK '{print $1}' )
 
 typeset -i i=0
@@ -125,7 +125,7 @@
 else
 	log_must eval '$GREP "${expect_str3}" $output > /dev/null 2>&1'
 fi
-$ZFS upgrade | $NAWK '$1 ~ "^[0-9]+$" {print $2}'> $output
+$ZFS upgrade | $AWK '$1 ~ "^[0-9]+$" {print $2}'> $output
 COUNT=$( $WC -l $output | $AWK '{print $1}' )
 
 if (( COUNT != OLDCOUNT )); then
--- old/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_002_pos.ksh	2013-05-27 09:45:38.768552056 +0000
+++ new/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_002_pos.ksh	2013-05-27 09:45:38.778757721 +0000
@@ -56,7 +56,7 @@
 
 log_must eval '$ZFS upgrade -v > /dev/null 2>&1'
 
-$ZFS upgrade -v | $NAWK '$1 ~ "^[0-9]+$" {print $0}'> $output
+$ZFS upgrade -v | $AWK '$1 ~ "^[0-9]+$" {print $0}'> $output
 log_must eval '$GREP "${expect_str1}" $output > /dev/null 2>&1'
 log_must eval '$GREP "${expect_str2}" $output > /dev/null 2>&1'
 
--- old/usr/src/tools/ndrgen/ndrgen.sh	2013-05-27 09:45:39.187216516 +0000
+++ new/usr/src/tools/ndrgen/ndrgen.sh	2013-05-27 09:45:39.208137983 +0000
@@ -48,7 +48,7 @@
 	ndl_file=$1
 	ndr_file=$2
 
-	nawk 'BEGIN { copy=0; }
+	/usr/xpg4/bin/awk 'BEGIN { copy=0; }
 	/^\/\* NDRGEN_HEADER_BEGIN \*\// { copy=1; next; }
 	/^\/\* NDRGEN_HEADER_END \*\// { copy=0; next; }
 	/./ { if (copy==1) print; }' < $ndl_file > $ndr_file
--- old/usr/src/tools/scripts/Install.sh	2013-05-27 09:45:39.689075632 +0000
+++ new/usr/src/tools/scripts/Install.sh	2013-05-27 09:45:39.702610426 +0000
@@ -235,7 +235,7 @@
 #
 
 function fixglom {
-	nawk \
+	/usr/xpg4/bin/awk \
 	    -v glomname=$2 \
 	    -v karch=$KARCH ' 
 	$1 == "MOD" || $1 == "SYMLINK" {
@@ -270,7 +270,7 @@
 #
 
 function filtimpl {
-	nawk \
+	/usr/xpg4/bin/awk \
 	    -v impl=$2 '
 	$1 == "MOD" || $1 == "SYMLINK" {
 		if ($6 == "all" || $6 == impl)
@@ -293,7 +293,7 @@
 # Usage: filtmod listfile modules
 #
 function filtmod {
-	nawk -v reqstring="$2" '
+	/usr/xpg4/bin/awk -v reqstring="$2" '
 	function modmatch(modname) {
 		if (reqstring == "All") {
 			return (1)
@@ -453,7 +453,7 @@
 
 # Sanity-check the given module list.
 function check_modlist {
-	nawk '
+	/usr/xpg4/bin/awk '
 	BEGIN {
 		nfields["MOD"] = 6
 		nfields["CONF"] = 6
@@ -956,7 +956,7 @@
 #
 
 if [ "$IMODE" != "n" ]; then
-	eval `echo $TARGET | nawk -F':' '{ 
+	eval `echo $TARGET | /usr/xpg4/bin/awk -F':' '{ 
 		if (NF != 2 || !length($1) || !length($2))
 			print "usage \"Invalid target\""
 		m = $1; d = $2
--- old/usr/src/tools/scripts/bindrop.sh	2013-05-27 09:45:40.113893729 +0000
+++ new/usr/src/tools/scripts/bindrop.sh	2013-05-27 09:45:40.123953148 +0000
@@ -234,7 +234,7 @@
 #
 MACH=$(uname -p)
 (cd "$SRC/pkg/packages.$MACH"; \
-	nawk '/^dir/ {sub(/.+ path=/, ""); print $1;}' *.metadata.*.redist | \
+	/usr/xpg4/bin/awk '/^dir/ {sub(/.+ path=/, ""); print $1;}' *.metadata.*.redist | \
 	sort -u > "$needdirs")
 
 #
--- old/usr/src/tools/scripts/checkpaths.sh	2013-05-27 09:45:40.470337172 +0000
+++ new/usr/src/tools/scripts/checkpaths.sh	2013-05-27 09:45:40.482168995 +0000
@@ -93,7 +93,7 @@
 		e="$CODEMGR_WS/exception_lists/packaging"
 		for f in $e; do
 			if [ -f $f ]; then
-				nawk 'NF == 1 || /[ 	]\+'$arch'$/ { print; }' \
+				/usr/xpg4/bin/awk 'NF == 1 || /[ 	]\+'$arch'$/ { print; }' \
 				    < $f | validate_paths -b $ROOT -n $f
 			fi
 		done
--- old/usr/src/tools/scripts/nightly.sh	2013-05-27 09:45:40.902449875 +0000
+++ new/usr/src/tools/scripts/nightly.sh	2013-05-27 09:45:40.911197959 +0000
@@ -1838,7 +1838,7 @@
 
 	while ! staffer ln -s $hostname.$STAFFER.$$ $lockf 2> /dev/null; do
 		basews=`basename $CODEMGR_WS`
-		ls -l $lockf | nawk '{print $NF}' | IFS=. read host user pid
+		ls -l $lockf | /usr/xpg4/bin/awk '{print $NF}' | IFS=. read host user pid
 		if [ "$host" != "$hostname" ]; then
 			echo "$MACH build of $basews apparently" \
 			    "already started by $user on $host as $pid."
@@ -2438,7 +2438,7 @@
 	else
 		typeset root
 		root=$(staffer svn info $CODEMGR_WS |
-			nawk '/^Repository Root:/ {print $NF}')
+			/usr/xpg4/bin/awk '/^Repository Root:/ {print $NF}')
 		if [[ $root != $BRINGOVER_WS ]]; then
 			# We fail here because there's no way to update
 			# from a named repo.
@@ -2779,7 +2779,7 @@
 			# whether it was built with -X or not.
 			#
 			IHV_REF_PROTO_LIST=$SRC/pkg/proto_list_ihv_$MACH
-			grepfor=$(nawk '$1 == "f" { print $2; exit }' \
+			grepfor=$(/usr/xpg4/bin/awk '$1 == "f" { print $2; exit }' \
 				$IHV_REF_PROTO_LIST 2> /dev/null)
 			if [ $? = 0 -a -n "$grepfor" ]; then
 				if [ "$X_FLAG" = "y" ]; then
--- old/usr/src/tools/scripts/protocmp.terse.sh	2013-05-27 09:45:41.397555038 +0000
+++ new/usr/src/tools/scripts/protocmp.terse.sh	2013-05-27 09:45:41.408923251 +0000
@@ -24,7 +24,6 @@
 # Copyright 1993-2003 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 # 
-#ident	"%Z%%M%	%I%	%E% SMI"
 
 opts=""
 while getopts guplmsLv arg
@@ -49,7 +48,7 @@
 errlog=/tmp/protocmp.err.$$
 
 protocmp $opts "$@" 2>$errlog |
-	nawk -v old="$old" -v new="$new" -v differ="$differ" '
+	/usr/xpg4/bin/awk -v old="$old" -v new="$new" -v differ="$differ" '
 	/^\**$/ {
 		next;
 	}
--- old/usr/src/tools/scripts/webrev.sh	2013-05-27 09:45:41.722479907 +0000
+++ new/usr/src/tools/scripts/webrev.sh	2013-05-27 09:45:41.736174504 +0000
@@ -1460,7 +1460,7 @@
 	set -A sids $($SCCS prs -l -r$psid -d:I: $cfile 2>/dev/null)
 	N=${#sids[@]}
 
-	nawkprg='
+	awkprg='
 		/^COMMENTS:/	{p=1; continue}
 		/^D [0-9]+\.[0-9]+/ {printf "--- %s ---\n", $2; p=0; }
 		NF == 0u	{ continue }
@@ -1471,12 +1471,12 @@
 
 		if [[ $fmt == "text" ]]; then
 			$SCCS prs -l -r$sid1 $cfile  2>/dev/null | \
-			    $AWK "$nawkprg"
+			    $AWK "$awkprg"
 			return
 		fi
 
 		$SCCS prs -l -r$sid1 $cfile  2>/dev/null | \
-		    html_quote | its2url | $AWK "$nawkprg"
+		    html_quote | its2url | $AWK "$awkprg"
 	fi
 }
 
@@ -2799,7 +2799,7 @@
 
 	# Try to figure out the parent based on the branch the current
 	# branch is tracking, if we fail, use origin/master
-	this_branch=$($GIT branch | nawk '$1 == "*" { print $2 }')
+	this_branch=$($GIT branch | /usr/xpg4/bin/awk '$1 == "*" { print $2 }')
 	par_branch="origin/master"
 
         # If we're not on a branch there's nothing we can do
--- old/usr/src/ucbcmd/sbcp/mksysent	2013-05-27 09:45:42.266890547 +0000
+++ new/usr/src/ucbcmd/sbcp/mksysent	2013-05-27 09:45:42.278953577 +0000
@@ -24,11 +24,9 @@
 # Copyright 1993-2003 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-#
 #	mksysent - generate the sysent table from the list of system calls
 #
-nawk '
+/usr/xpg4/bin/awk '
 BEGIN {
 	print "#include <sys/asm_linkage.h>"
 	print "#include <sys/syscall.h>"
--- old/usr/src/uts/common/Makefile.rules	2013-05-27 09:45:42.678387860 +0000
+++ new/usr/src/uts/common/Makefile.rules	2013-05-27 09:45:42.687222983 +0000
@@ -1579,13 +1579,13 @@
 
 $(MD_XDR_CSRC)/meta_basic_xdr.c:	$(MD_XDR_XSRC)/meta_basic.x
 	$(RPCGEN) $(RPCGENFLAGS) -c -i 100 $(MD_XDR_XSRC)/meta_basic.x | \
-	nawk '{sub(/^#include "(\.\.\/\.\.\/)/,"#include \"\.\.\/\.\.\/\.\.\/\.\.\/"); print $$0}'  | \
-	nawk '{sub(/meta_basic.h/, "md_basic.h"); print $$0}' >$@
+	/usr/xpg4/bin/awk '{sub(/^#include "(\.\.\/\.\.\/)/,"#include \"\.\.\/\.\.\/\.\.\/\.\.\/"); print $$0}'  | \
+	/usr/xpg4/bin/awk '{sub(/meta_basic.h/, "md_basic.h"); print $$0}' >$@
 
 $(MD_XDR_CSRC)/metamed_xdr.c:	$(MD_XDR_XSRC)/metamed.x
 	$(RPCGEN) $(RPCGENFLAGS) -c -i 100 $(MD_XDR_XSRC)/metamed.x |  \
-	nawk '{sub(/^#include "(\.\.\/\.\.\/)/,"#include \"\.\.\/\.\.\/\.\.\/\.\.\/"); print $$0}' | \
-	nawk '{sub(/metamed.h/, "mdmed.h"); print $$0}' >$@
+	/usr/xpg4/bin/awk '{sub(/^#include "(\.\.\/\.\.\/)/,"#include \"\.\.\/\.\.\/\.\.\/\.\.\/"); print $$0}' | \
+	/usr/xpg4/bin/awk '{sub(/metamed.h/, "mdmed.h"); print $$0}' >$@
 
 #
 #	Section 1b:	Lint `objects'
--- old/usr/src/uts/common/sys/Makefile	2013-05-27 09:45:43.159164536 +0000
+++ new/usr/src/uts/common/sys/Makefile	2013-05-27 09:45:43.169772741 +0000
@@ -1363,13 +1363,13 @@
 all_h: $(GENHDRS)
 
 priv_const.h: $(PRIVS_AWK) $(PRIVS_DEF)
-	$(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) -v privhfile=$@
+	$(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) -v privhfile=$@
 
 priv_names.h: $(PRIVS_AWK) $(PRIVS_DEF)
-	$(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) -v pubhfile=$@
+	$(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) -v pubhfile=$@
 
 usb/usbdevs.h: $(USBDEVS_AWK) $(USBDEVS_DATA)
-	$(NAWK) -f $(USBDEVS_AWK) $(USBDEVS_DATA) -H > $@
+	$(AWK) -f $(USBDEVS_AWK) $(USBDEVS_DATA) -H > $@
 
 LVMDERIVED_H:
 	cd $(SRC)/uts/common/sys/lvm; pwd; $(MAKE)
--- old/usr/src/uts/i86pc/Makefile.rules	2013-05-27 09:45:43.573404890 +0000
+++ new/usr/src/uts/i86pc/Makefile.rules	2013-05-27 09:45:43.582969154 +0000
@@ -306,7 +306,7 @@
 
 $(OBJS_DIR)/dtracestubs.s:	$(UNIX_O) $(LIBS)
 	$(NM) -u $(UNIX_O) $(LIBS) | $(GREP) __dtrace_probe_ | $(SORT) | \
-	    $(UNIQ) | $(NAWK) '{ \
+	    $(UNIQ) | $(AWK) '{ \
 	    printf("\t.globl %s\n\t.type %s,@function\n%s:\n", \
 	    $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
 
--- old/usr/src/uts/intel/Makefile	2013-05-27 09:45:43.914573084 +0000
+++ new/usr/src/uts/intel/Makefile	2013-05-27 09:45:43.927968371 +0000
@@ -90,7 +90,7 @@
 PRIVS_C = $(SRC)/uts/common/os/priv_const.c
 
 $(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
-	$(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
+	$(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
 
 #
 # Prerequisites
--- old/usr/src/uts/intel/config/Makefile	2013-05-27 09:45:44.253851462 +0000
+++ new/usr/src/uts/intel/config/Makefile	2013-05-27 09:45:44.263548685 +0000
@@ -114,7 +114,7 @@
 	$(INS.file)
 
 $(SRCDIR)/priv_names: $(PRIVS_DEF) $(PRIVS_AWK)
-	$(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) -v pnamesfile=$@
+	$(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) -v pnamesfile=$@
 
 clean clobber lint:
 
--- old/usr/src/uts/sparc/config/Makefile	2013-05-27 09:45:44.606858206 +0000
+++ new/usr/src/uts/sparc/config/Makefile	2013-05-27 09:45:44.617481042 +0000
@@ -77,7 +77,7 @@
 	$(INS.file)
 
 $(SRCDIR)/priv_names: $(PRIVS_DEF) $(PRIVS_AWK)
-	$(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) -v pnamesfile=$@
+	$(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) -v pnamesfile=$@
 
 clean clobber lint:
 
--- old/usr/src/uts/sun4u/Makefile	2013-05-27 09:45:44.968918539 +0000
+++ new/usr/src/uts/sun4u/Makefile	2013-05-27 09:45:44.979936489 +0000
@@ -113,7 +113,7 @@
 PRIVS_C = $(UTSBASE)/common/os/priv_const.c
 
 $(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
-	$(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
+	$(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
 
 
 #
--- old/usr/src/uts/sun4u/Makefile.rules	2013-05-27 09:45:45.362390544 +0000
+++ new/usr/src/uts/sun4u/Makefile.rules	2013-05-27 09:45:45.371319432 +0000
@@ -170,7 +170,7 @@
 
 $(OBJS_DIR)/dtracestubs.s:	$(UNIX_O) $(LIBS)
 	$(NM) -u $(UNIX_O) $(LIBS) | $(GREP) __dtrace_probe_ | $(SORT) | \
-	    $(UNIQ) | $(NAWK) '{ \
+	    $(UNIQ) | $(AWK) '{ \
 	    printf("\t.global %s\n\t.type %s, #function\n%s:\n", \
 	    $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
 
--- old/usr/src/uts/sun4v/Makefile.rules	2013-05-27 09:45:45.708213338 +0000
+++ new/usr/src/uts/sun4v/Makefile.rules	2013-05-27 09:45:45.720034886 +0000
@@ -162,7 +162,7 @@
 
 $(OBJS_DIR)/dtracestubs.s:	$(UNIX_O) $(LIBS)
 	$(NM) -u $(UNIX_O) $(LIBS) | $(GREP) __dtrace_probe_ | $(SORT) | \
-	    $(UNIQ) | $(NAWK) '{ \
+	    $(UNIQ) | $(AWK) '{ \
 	    printf("\t.global %s\n\t.type %s, #function\n%s:\n", \
 	    $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
 
