Print this page
XXX Remove nawk(1)

@@ -685,11 +685,11 @@
         if ((ratio == 0)); then
                 return
         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
 }
 

@@ -1345,11 +1345,11 @@
 #
 function get_disklist # pool
 {
         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)$")
 
         $ECHO $disklist
 }

@@ -1467,11 +1467,11 @@
 {
         typeset pool=$1
         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
 
         return $?
 }

@@ -1688,11 +1688,11 @@
 # to produce a list of disks we know about. Note that we have
 # to escape "$2" so that the shell doesn't interpret it while
 # we're creating the awk script.
 # -------------------
         $CAT > /tmp/find_disks.awk <<EOF
-#!/bin/nawk -f
+#!/usr/xpg4/bin/awk -f
         BEGIN { FS="."; }
 
         /^Specify disk/{
                 searchdisks=0;
         }

@@ -2325,11 +2325,11 @@
         typeset pool=$1
         typeset disk=${2#/dev/dsk/}
         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;}
                 (startfield==1) && ($1==device) {print $2; exit;}
                 (startfield==1) &&

@@ -2469,11 +2469,11 @@
 function get_substr #src_str pos offset
 {
         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)}'
 }
 
 #
 # Check if the given device is physical device
 #