Created
August 26, 2009 10:16
-
-
Save pfig/175445 to your computer and use it in GitHub Desktop.
Fills in "FirstName LastName" for users who don't have it set on /etc/passwd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my ( $name, @u ); | |
while ( @u = getpwent() ) { | |
if ( $u[0] =~ /^\w+\.\w+$/ && $u[6] eq '' ) { | |
( $name = $u[0] ) =~ s/(\w+)\.(\w+)/ucfirst($1).' '.ucfirst($2)/e; | |
system( '/usr/sbin/usermod', '-c', $name, $u[0] ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment