This may be flavour dependent, but in my experience expire is usually in epoch seconds, so in addition to testing for truth (to see if the account has an expire time) you need to also compare against time().
use strict; use User::pwent; while ( my $user = getpwent ) { if ( $user->expire && $user->expire <= time ) { printf "%s expired (%s)\n", $user->name, scalar(localtime($user->expire)); } }
--k.
In reply to Re: Re: Re: Detecting Expired User Accounts
by Kanji
in thread Detecting Expired User Accounts
by hux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |