I need a loop that pulls out the user name into a variable and then pulls out the LastUpdate field into another variable so I can then perform a comparison against the last update field.
Requirements are AIX tools including AWK, SED and Perl
I am writing a script to check AIX users password expiration dates and if they are within the alerting period (ie. 7 days etc) it will email the user.
I will release the full script into the public domain once completed.
The text file I want to parse is formatted like:
Code:
colettel:
password = XSON0m4SdIQDw
lastupdate = 1260829398
andrewwa:
password = ktttjY3Q1ay22
lastupdate = 1260829665
davidm:
password = cb5vaQT9NOP0Y
lastupdate = 1260830289
peterr:
password = l40lbIXyrvRHw
lastupdate = 1260996018
flags = ADMCHG
polarisb:
password = emGciT1C/VPJw
lastupdate = 1274912595
Usually I would grep and cut fields but thats not really going to happen for me with these multi line files - Thanks in advance
*Cam