Skip to content

Instantly share code, notes, and snippets.

@pfig
Created August 26, 2009 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfig/175445 to your computer and use it in GitHub Desktop.
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
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