#!/usr/bin/perl open (MERGED , "> /tmp/passwords"); open (PASSWD , "/etc/passwd"); while ( my $line = <PASSWD> ) { my @fields = split(":", $line); my $fletter = substr($fields[0],0,1); my $trusted_file = "/tcb/files/auth/$fletter/$fields[0]"; if ( -r $trusted_file ) { open (TRUSTED , $trusted_file); while ( my $entry = <TRUSTED> ) { next unless ( $entry =~ /u_pwd/ ); if ( $entry =~ /u_pwd=(.*):.*$/ ) { $fields[1] = $1; } } } close (TRUSTED); print MERGED join ':' , @fields; } close (PASSWD); close (MERGED);
In reply to HPUX password merger by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |