I'm doing a forloop on a file containing servers with Veritas on them. The 'else' statement is giving problems. All I want is the entire line that contains the following 'error' or 'failing'. Here's what I have so far -
#!/bin/ksh
touch vxdisk_check && chmod 777 vxdisk_check
echo "Veritas Disk Failure Report"
echo "As of:" `date`
echo ""
echo ""
for host in `cat /home/dtalley/scripts/vxdisklist`
do
echo $host
rsh $host /usr/sbin/vxdisk list |
nawk
'{
if($0~/error/) print $0}
else {print "All is good"}
fi
}'
done
Any help would be appreciated.
#!/bin/ksh
touch vxdisk_check && chmod 777 vxdisk_check
echo "Veritas Disk Failure Report"
echo "As of:" `date`
echo ""
echo ""
for host in `cat /home/dtalley/scripts/vxdisklist`
do
echo $host
rsh $host /usr/sbin/vxdisk list |
nawk
'{
if($0~/error/) print $0}
else {print "All is good"}
fi
}'
done
Any help would be appreciated.