Many thanks to all that replied to my request for help, and Specially to
Barry Branch who very kindly provided me with a easy to understand script
that was short and simply: -but does the job!
#!/bin/sh
MAILTO=${*:-"root"}
mm=`date +%b | tr '[a-z]' '[A-Z]'`
yy=`date +%Y`
expire=`/usr/sbin/lmf list full | grep -p ${mm}-${yy}`
if [ "${expire}" ]; then
mailx -s "The following licenses will expire this month for `hostname`"
$MAILTO <<EOF
$expire
EOF
fi
Rather than trying to exract the Termination date field, just use grep -p
which is a paragraph separator and look for the current month.
Regards
Mark
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
Received on Fri Mar 09 2001 - 11:32:20 NZDT