Print this page
XXX Remove nawk(1)

@@ -55,11 +55,11 @@
 DOMAINNAME=/usr/bin/domainname
 GREP=/usr/bin/grep
 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
 SVCCFG=/usr/sbin/svccfg
 SVCPROP=/usr/bin/svcprop

@@ -172,15 +172,15 @@
                 $GREP -i "added by dhcp" /etc/nsswitch.conf >/dev/null
                 if [ $? -eq 0 ]; then
                         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
         fi
 

@@ -188,18 +188,18 @@
         if service_is_enabled $NIS_CLIENT_FMRI; then
                 NAMESERVICES="${NAMESERVICES}nis,"
                 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
         fi
 

@@ -207,11 +207,11 @@
         if [ -f /var/ldap/ldap_client_file ]; then
                 copy_to_legacy /var/ldap/ldap_client_file
                 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
 
         # Now, write nwamcfg commands for nameservices
         write_loc_prop "nameservices" $NAMESERVICES $CREATE_LOC_LEGACY_FILE

@@ -363,11 +363,11 @@
         if [ -n "$NIS_CONFIGSRC" ]; then
                 if [ ! -d "$NIS_BIND_PATH/$DEFAULT_DOMAIN" ]; then
                         $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
                 $SVCADM enable nis/client
         fi

@@ -419,11 +419,11 @@
         refresh_ipf=false
         if [ -n "$ipf_file" ]; then
                 # 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"
                 else
                         copy_from_legacy_loc $ipf_file