for line in `cat $file`
do
statusfield=`echo $line | tr -s " " | cut -d " " -f5`
if [ $statusfield = "up" ]
then
echo " system is up"
else
----
fi
done
Is the status field always the fifth field? What's there when it's not up? Are there supposed to be empty lines between the records? Is it okay to simply ignore the header line? (I have made reasonable assumptions to all of these in the above script, but feel free to check those assumptions. Respectively: yes, anything or nothing, no, yes.)