in reply to AIX reset users
My recommendation to you regarding your code is don't write scripts like this. You will end up copy/pasting all over the place. Instead, write modules that expose AIX admin commands in a consistent manner that can be re-used in script after script. Isn't the following more appealing:
... my $account = AIX::Account->new($user); if ($account->locked) { print "Attempting to unlock account for '$user'\n"; if (! $account->unlock) { print "Failed to unlock account for '$user': ", $account->last +_error; } else { print "Account for '$user' successfully unlocked\n"; } } else { print "Account for '$user' was not locked\n"; }
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: AIX reset users
by TechFly (Scribe) on Feb 11, 2011 at 17:39 UTC | |
|
Re^2: AIX reset users
by ambrus (Abbot) on Feb 12, 2011 at 14:49 UTC | |
by Limbic~Region (Chancellor) on Feb 12, 2011 at 21:43 UTC |