#!/bin/sh
#
#  4791791 number of nodes missing in SUNWbau/install/space file
#
LS=/bin/ls
RM=/bin/rm
CAT=/bin/cat
WC=/bin/wc
AWK=/bin/awk
CP=/bin/cp
DATE=/bin/date

Date=`$DATE +%m%d%y%M`
if test -f $ROOTDIR/var/sadm/pkg/SUNWbau/install/space
then
    cd $ROOTDIR/var/sadm/pkg/SUNWbau/install
	if `$LS space.* > /dev/null 2>&1 `; then
	    $RM space.* 
	fi
	$CAT space | while read line
	do
	    nw=`echo $line | $WC -w | $AWK ' { print $0 } '`
	    if [ $nw -eq 2 ]; then
		echo "$line 0" >> space.$Date
	    else
		echo "$line" >> space.$Date
	    fi
	done	
	$CP -p space.$Date space
	$RM space.$Date
fi
exit 0
