I need to check for passwd expiration and am trying to use ksh. What is the best way to read a file, assign variables values etc? I was thinking about something like this but I don't know how ksh knows it is at the end of the file. I don't want it to loop forever.
for i in `cat $SHADOW_WORK`
do
USER_NAME=`echo $i | awk -F: '{print \$1}`
STA_TUS=`echo $i | awk -F: '{print \$2}`
LAST_CHANGE=`echo $i | awk -F: '{print \$3}`
integer DAYS_TILL="$EPOCH_DATE - $LAST_CHANGE"
if something
then
elif
then
elif then
else
done
Any suggestions are greatly appreciated.
gallows
for i in `cat $SHADOW_WORK`
do
USER_NAME=`echo $i | awk -F: '{print \$1}`
STA_TUS=`echo $i | awk -F: '{print \$2}`
LAST_CHANGE=`echo $i | awk -F: '{print \$3}`
integer DAYS_TILL="$EPOCH_DATE - $LAST_CHANGE"
if something
then
elif
then
elif then
else
done
Any suggestions are greatly appreciated.
gallows