#!/bin/ksh # # Yves Dorfsman, 2000/01/21 # /usr/sbin/vgdisplay |\ while read LINE do case $LINE in *VG?Name*) VGNAME=${LINE##*/} print -n "$VGNAME:\t" ;; *PE?Size*) UNIT=${LINE##*\(} UNIT=${UNIT%%\)*} SIZE=${LINE##* } ## print "Size: $SIZE $UNIT" ;; *Free?PE*) FREEPE=${LINE##* } let "FREETOTAL = FREEPE * SIZE" ## print "FREEPE $FREEPE" print "$FREETOTAL $UNIT free to be allocated" ;; esac done