Print this page
XXX Remove nawk(1)
*** 685,695 ****
if ((ratio == 0)); then
return
fi
typeset -i endcyl=$($PRTVTOC -h /dev/rdsk/${disk}s2 |
! $NAWK -v token="$slice" '{if ($1==token) print $6}')
((endcyl = (endcyl + 1) / ratio))
echo $endcyl
}
--- 685,695 ----
if ((ratio == 0)); then
return
fi
typeset -i endcyl=$($PRTVTOC -h /dev/rdsk/${disk}s2 |
! $AWK -v token="$slice" '{if ($1==token) print $6}')
((endcyl = (endcyl + 1) / ratio))
echo $endcyl
}
*** 1345,1355 ****
#
function get_disklist # pool
{
typeset disklist=""
! disklist=$($ZPOOL iostat -v $1 | $NAWK '(NR >4) {print $1}' | \
$GREP -v "\-\-\-\-\-" | \
$EGREP -v -e "^(mirror|raidz1|raidz2|spare|log|cache)$")
$ECHO $disklist
}
--- 1345,1355 ----
#
function get_disklist # pool
{
typeset disklist=""
! disklist=$($ZPOOL iostat -v $1 | $AWK '(NR >4) {print $1}' | \
$GREP -v "\-\-\-\-\-" | \
$EGREP -v -e "^(mirror|raidz1|raidz2|spare|log|cache)$")
$ECHO $disklist
}
*** 1467,1477 ****
{
typeset pool=$1
typeset token=$2
typeset keyword=$3
! $ZPOOL status -v "$pool" 2>/dev/null | $NAWK -v token="$token:" '
($1==token) {print $0}' \
| $GREP -i "$keyword" > /dev/null 2>&1
return $?
}
--- 1467,1477 ----
{
typeset pool=$1
typeset token=$2
typeset keyword=$3
! $ZPOOL status -v "$pool" 2>/dev/null | $AWK -v token="$token:" '
($1==token) {print $0}' \
| $GREP -i "$keyword" > /dev/null 2>&1
return $?
}
*** 1688,1698 ****
# 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
BEGIN { FS="."; }
/^Specify disk/{
searchdisks=0;
}
--- 1688,1698 ----
# 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
! #!/usr/xpg4/bin/awk -f
BEGIN { FS="."; }
/^Specify disk/{
searchdisks=0;
}
*** 2325,2335 ****
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 \
'BEGIN {startconfig=0; startfield=0; }
/config:/ {startconfig=1}
(startconfig==1) && ($1==field) {startfield=1; next;}
(startfield==1) && ($1==device) {print $2; exit;}
(startfield==1) &&
--- 2325,2335 ----
typeset pool=$1
typeset disk=${2#/dev/dsk/}
typeset field=${3:-$pool}
state=$($ZPOOL status -v "$pool" 2>/dev/null | \
! $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,2479 ****
function get_substr #src_str pos offset
{
typeset pos offset
$ECHO $1 | \
! $NAWK -v pos=$2 -v offset=$3 '{print substr($0, pos, offset)}'
}
#
# Check if the given device is physical device
#
--- 2469,2479 ----
function get_substr #src_str pos offset
{
typeset pos offset
$ECHO $1 | \
! $AWK -v pos=$2 -v offset=$3 '{print substr($0, pos, offset)}'
}
#
# Check if the given device is physical device
#