Hello, and thank you for help in advance, i seem to have this script working, except for the email part, it sends me a blank email, am i not redirecting the output of my text file the right way?
#!/usr/bin/ksh
rm installed_zones.txt
installed=/home/xxx/stuff/installed_zones.txt
for EACH in `cat serverlist.txt`
do
ssh $EACH zoneadm list -ipc | grep running | grep -v "global" >> installed_zones.txt
done
if [ -s installed_zones.txt ] ; then
cat /home/xxx/stuff/installed_zones.txt | mail xxx@xxx.com
exit
else
echo NO INSTALLED ZONES | mail xxx@xxx.com
exit
fi